unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Merge multiple hooks into one directive.
@ 2021-07-05 23:45 Hongyi Zhao
  2021-07-06  0:04 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 2+ messages in thread
From: Hongyi Zhao @ 2021-07-05 23:45 UTC (permalink / raw)
  To: help-gnu-emacs

Consider the multiple hooks as follows:

(add-hook 'A-hook 'foo)
(add-hook 'B-hook #'bar)
(add-hook 'C-hook (baz))
...


If I want to merge them into one directive. What's the preferable way?

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Vocational University of Technology and Engineering
NO. 552 North Gangtie Road, Xingtai, China



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Merge multiple hooks into one directive.
  2021-07-05 23:45 Merge multiple hooks into one directive Hongyi Zhao
@ 2021-07-06  0:04 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 2+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-07-06  0:04 UTC (permalink / raw)
  To: help-gnu-emacs

Hongyi Zhao wrote:

> Consider the multiple hooks as follows:
>
> (add-hook 'A-hook 'foo)
> (add-hook 'B-hook #'bar)
> (add-hook 'C-hook (baz))
> ...
>
> If I want to merge them into one directive. What's the
> preferable way?

Try this:

  (setq my-directive (list A-hook B-hook C-hook))

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-06  0:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-05 23:45 Merge multiple hooks into one directive Hongyi Zhao
2021-07-06  0:04 ` Emanuel Berg via Users list for the GNU Emacs text editor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).