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

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

RE: Hooks and c/c++-mode


From: Drew Adams
Subject: RE: Hooks and c/c++-mode
Date: Tue, 10 May 2011 17:09:33 -0700

> Is there a smart way to set a hook for several modes at once?
> Maybe using a regex or similar.
> (add-hook '{c|c++}-mode-hook '(lambda () 'do-something))

Not that I know of.  Just use `dolist' or `mapc'.

(dolist (hk  '(c-mode-hook c++-mode-hook))
  (add-hook hk 'do-something))

(BTW, there is no need to quote the lambda form.)




reply via email to

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