unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* autoload function with arguments
@ 2024-08-15  1:09 Heime
  2024-08-15  5:19 ` Joel Reicher
  0 siblings, 1 reply; 5+ messages in thread
From: Heime @ 2024-08-15  1:09 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

I am making a minor-mode.  Is an autoload function with arguments allowed.

As with

;;;###autoload
(defun tema-mdhooks (actn)
  "Manage the activation of tema-minor-mode for various major modes."

  (let ( (mdhooks '(sh-mode-hook emacs-lisp-mode-hook))

         (hook-fn (cond
                    ((eq actn 'add) #'add-hook)
                    ((eq actn 'remove) #'remove-hook)
                    (t (error "ACTM %s is invalid" actm)))) )

    (dolist (mdhook mdhooks)
      (funcall hook-fn mdhook #'tema-minor-mode)) ))

  






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

end of thread, other threads:[~2024-08-18 22:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-15  1:09 autoload function with arguments Heime
2024-08-15  5:19 ` Joel Reicher
2024-08-15 12:07   ` Heime
2024-08-16 11:14     ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-08-18 22:35       ` Heime

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).