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

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

Re: problem getting hooks to be active


From: Barry Margolin
Subject: Re: problem getting hooks to be active
Date: Mon, 11 Aug 2003 18:30:12 GMT

In article <87ptjc3x6r.fsf@lorien.concordia.ca>,
Peter Solodov  <peter@alcor.concordia.ca> wrote:
>On 11 Aug 2003, Eric Pement wrote:
>>    (add-hook 'sgml-mode-hook'
>
>That second quote is really there???  In this case you're adding to
>"sgml-mode-hook'", and not sgml-mode-hook.

No he isn't.  Lisp has no provisions for turning single-quotes into
double-quotes.  What he wrote is actually equivalent to:

(add-hook 'sgml-mode-hook
  '(lambda ...))

because Lisp doesn't care about the presence or absence of whitespace
before or after quotes.

But I agree that his layout suggests a serious misunderstanding of how Lisp
quoting works.

>(add-hook 'sgml-mode-hook
>  (lambda ()
>    ...

That should work the same as his version, because (lambda ...) is a macro
invocation that expands into '(lambda ...).

-- 
Barry Margolin, barry.margolin@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


reply via email to

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