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

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

Re: add-hook


From: Barry Margolin
Subject: Re: add-hook
Date: Sat, 26 Jan 2013 00:33:55 -0500
User-agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)

In article <mailman.18346.1359173059.855.help-gnu-emacs@gnu.org>,
 Dmitry Gutov <dgutov@yandex.ru> wrote:

> "Drew Adams" <drew.adams@oracle.com> writes:
> > If HOOK is void then it is initialized to nil.
> >
> > (add-hook 'ruby-mode-hook (lambda () (ruby-electric-mode t)))
> 
> Or, even shorter:
> 
> (add-hook 'ruby-mode-hook 'ruby-electric-mode)

Not the same. With no argument it toggles, with an argument it turns the 
mode on or off as specified by the argument.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


reply via email to

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