[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pretty-lambdas



Hi,

I just want to mention a simple and good-enough-for-me solution to the
"lambda is too many characters" problem: have Emacs "fontify" the
string "lambda" as a lambda character. Then it uses less screen space
even than 'fn'.

Here is Stefan Monnier's hack to do this:

  (defun pretty-lambdas ()
    (font-lock-add-keywords
     nil `(("\\<lambda\\>"
            (0 (progn (compose-region (match-beginning 0) (match-end 0)
                                      ,(make-char 'greek-iso8859-7 107))
                      nil))))))

  (add-hook 'emacs-lisp-mode-hook 'pretty-lambdas)

.. and add the hook for any other modes you want, e.g. scheme-mode.

You need to have an appropriate font installed - more on that in the
usenet thread that comes up first on a search for "pretty lambda" at
groups.google.com. I don't know if this works on Emacsen other than
GNU version 21.

Cheers,
Luke