emacs-devel
[Top][All Lists]
Advanced

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

Re: Idempotency of add-hook wrt lambda expressions


From: David Reitter
Subject: Re: Idempotency of add-hook wrt lambda expressions
Date: Wed, 4 Mar 2009 16:00:01 -0500

On 4 Mar 2009, at 09:18, Stefan Monnier wrote:

As a general rule, you should not put a lambda but a function name
(i.e. a symbol) instead, to avoid all those problems (and be able to
replace the function with a newer version of it).  But occasionally
a lambda is really exactly what you want, of course.


People haven't adopted this, and this is pretty annoying.

A similar case are commands bound to menu items (or any other keys): C- h k does not bring up something useful for keys that are just bound to a lambda term.

As for hooks, is a lambda expression ever suitable to be added to a hook? Would it make sense to change add-hook such that only true function names are allowed?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]