bug-gnu-emacs
[Top][All Lists]
Advanced

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

Re: "custom" threatens modular thinking?


From: Per Abrahamsen
Subject: Re: "custom" threatens modular thinking?
Date: Tue, 12 Feb 2002 09:04:12 +0100
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.1 (i686-pc-linux-gnu)

address@hidden (Francis Litterio) writes:

> Here's something to beware of when setting hooks in your .emacs file.  If
> your .emacs file contains:
>
>   (add-hook 'xyzzy-hook 'my-xyzzy-hook-func)
>
> and later package xyzzy.el is loaded, and xyzzy.el contains a default
> value for xyzzy-hook, such as:
>
>   (defvar xyzzy-hook 'xyzzy-do-it "...")
>
> then the value of the hook ends up being:
>
>   (my-xyzzy-hook-func)
>
> and not:
>
>   (xyzzy-do-it my-xyzzy-hook-func)
>
> which might make the package malfunction.

Which is why hooks should always have a default value of nil.  Lisp
programmers, take note.



reply via email to

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