Navigation


RSS / Atom



Dropping wanderlust, back to mutt

2009-08-28 , , R. Lonstein , Comment

I’ve given wanderlust, a mail user agent for Emacs, a solid six month try as my only mail reader after a prior year of dabbling with it. It’s good but not great. I found no improvement over mutt with Emacs as my editor. That combination just lets me read mail most of the time instead of swearing and grovelling through the code.

Comment


macports emacs quick fix

2008-01-23 , , R. Lonstein ,

The macports version of emacs 22.1_1 (no x11, no carbon) is broken. I use it. Fortunately, Yamamoto Mitsuharu’s patch http://article.gmane.org/gmane.emacs.bugs/16867 allows it to build and install on Leopard x86. The bug tracker has Ticket #13942 for 1.6 and Ticket #13471 for 1.5.2 that have not been acknowledged by the maintainer.

Seems to work so I’ve slapped together a patch file and a portfile to use it until the fixes get incorporated:

Comment


Calculator expansion

2007-08-13 , , R. Lonstein , Comments [1]

Great idea and public doman code from Michele Bini for tying the Emacs calculator into hippie expand.

Comment


Reflow using Text::Autoformat

2005-10-01 , , R. Lonstein ,

Filladapt mode is good but the Perl module [Text::Autoformat](http://www.perl.com/CPAN/modules/by-module/Text/Text-Autoformat-1.13.tar.gz) is better at reflowing text for email. I cobbled together the following elisp to make that easy.

   (defun rel-autoformatter (begin end rightmargin)
      "Run Text::Autoformat on region"
      (shell-command-on-region begin end
       (format "perl -MText::Autoformat -e 'autoformat({all=>1,right=>%d})'" rightmargin) t t )
      (message "done."))
   (defun rel-autoformat (begin end)
      Text::Autoformat on region, RFC recommended right margin of 72"
      (interactive "r")
      (rel-autoformatter begin end 72))
   (defun rel-autoformat-quote (begin end)
      "Text::Autoformat on region, right margin of 60, suitable for quoting replies"
      (interactive "r")
      (rel-autoformatter begin end 60))
   (global-set-key (kbd "C-c f f") 'rel-autoformat)
   (global-set-key (kbd "C-c f q") 'rel-autoformat-quote)

It might be nice to handle parameters other than right margin- and do it in a cleaner way than explicitly specifying them. I doubt I’ll get around to it since Text::Autoformat usually does the right thing for me with just the margin hint.

Comment


A little useful elisp

2005-03-05 , , R. Lonstein ,

I get a lot of email at work and at home and I’m always deleting sections and
inlining responses so I decided that I needed a key binding in XEmacs to do
that work for me. Thanks to my growing familiarity with Scheme, writing elisp doesn’t seem so bad (well, as long as I have the [XEmacs Lisp Reference Manual](http://xemacs.org/Documentation/21.5/html/lispref.html) handy).

It’s ugly but it works and it’s my first useful creation in Lisp/Scheme:

   (defun region-is-active ()           ;; stolen from eparker's dot file
      (if (string-match "XEmacs" emacs-version)
          (region-exists-p)  mark-active) ) 
   (defun whack () "text killer, region, to sig, or next paragraph"
           (interactive)
           (let ((start (point)))
             (cond 
              ((region-is-active) (delete-region (point) (mark)))
              ((re-search-forward "^--" nil t) 
                (forward-line -1) (delete-region start (point)))
              (t (forward-paragraph) (delete-region start (point)))))
           (insert "    [snip]\n\n\n")
           (forward-line -1))
   (global-set-key (kbd "C-x !") 'whack)

Comment