Add remove-hook!

This commit is contained in:
Henrik Lissner 2017-02-28 15:38:47 -05:00
parent e2cb712b18
commit de7e8c33a7

View file

@ -119,11 +119,18 @@ Examples:
(dolist (fn funcs) (dolist (fn funcs)
(setq fn (if (symbolp fn) `(quote ,fn) `(lambda (&rest args) ,@args))) (setq fn (if (symbolp fn) `(quote ,fn) `(lambda (&rest args) ,@args)))
(dolist (h hooks) (dolist (h hooks)
(push `(add-hook ',(if quoted-p h (intern (format "%s-hook" h))) (push `(,(if (boundp 'hook-fn) hook-fn 'add-hook)
',(if quoted-p h (intern (format "%s-hook" h)))
,fn ,append-p ,local-p) ,fn ,append-p ,local-p)
forms))) forms)))
`(progn ,@(reverse forms))))) `(progn ,@(reverse forms)))))
(defmacro remove-hook! (&rest args)
"Convenience macro for `remove-hook'. Takes the same arguments as
`add-hook!'."
(let ((hook-fn 'remove-hook))
(macroexpand `(add-hook! ,@args))))
(defmacro associate! (mode &rest plist) (defmacro associate! (mode &rest plist)
"Associate a major or minor mode to certain patterns and project files." "Associate a major or minor mode to certain patterns and project files."
(declare (indent 1)) (declare (indent 1))