emacs-diffs
[Top][All Lists]
Advanced

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

master 144bbfc 1/3: Allow customizing hooks defined via define-minor-mod


From: Lars Ingebrigtsen
Subject: master 144bbfc 1/3: Allow customizing hooks defined via define-minor-mode
Date: Sat, 19 Sep 2020 12:23:38 -0400 (EDT)

branch: master
commit 144bbfc6625c4e5c8a247d05f7a1dc45c2b62553
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Allow customizing hooks defined via define-minor-mode
    
    * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Allow using
    Customize on the hooks (bug#10773).
---
 lisp/emacs-lisp/easy-mmode.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index e3eb929..fdc1233 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -335,6 +335,9 @@ or call the function `%s'."))))
 No problems result if this variable is not bound.
 `add-hook' automatically binds it.  (This is true for all hook variables.)"
                        modefun)))
+       ;; Allow using using `M-x customize-variable' on the hook.
+       (put ',hook 'custom-type 'hook)
+       (put ',hook 'standard-value (list nil))
 
        ;; Define the minor-mode keymap.
        ,(unless (symbolp keymap)       ;nil is also a symbol.



reply via email to

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