diff options
author | Glenn Morris <rgm@gnu.org> | 2012-01-30 20:35:57 -0800 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2012-01-30 20:35:57 -0800 |
commit | 6c9b47ae84ee5e2f4c7e388d8b1b6fd67daeb61b (patch) | |
tree | a78a39c7511eb74f841a180c5164951d75c1ee69 /lisp/emacs-lisp/easy-mmode.el | |
parent | e4070def538c1ffc40241f3beb79c55a9fbac13e (diff) | |
download | emacs-6c9b47ae84ee5e2f4c7e388d8b1b6fd67daeb61b.tar.gz emacs-6c9b47ae84ee5e2f4c7e388d8b1b6fd67daeb61b.tar.bz2 emacs-6c9b47ae84ee5e2f4c7e388d8b1b6fd67daeb61b.zip |
Small define-minor-mode fix for variable: keyword.
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode):
Allow named functions to be used as the cdr of variable:.
Diffstat (limited to 'lisp/emacs-lisp/easy-mmode.el')
-rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 7d412f0fcd4..9e1a079df5c 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -160,7 +160,7 @@ For example, you could write (hook (intern (concat mode-name "-hook"))) (hook-on (intern (concat mode-name "-on-hook"))) (hook-off (intern (concat mode-name "-off-hook"))) - keyw keymap-sym) + keyw keymap-sym tmp) ;; Check keys. (while (keywordp (setq keyw (car body))) @@ -177,7 +177,15 @@ For example, you could write (:require (setq require (pop body))) (:keymap (setq keymap (pop body))) (:variable (setq variable (pop body)) - (if (not (functionp (cdr-safe variable))) + (setq tmp (cdr-safe variable)) + (if (not (or (functionp tmp) + (and tmp + (symbolp tmp) + ;; Hack to allow for named functions not within + ;; eval-when-compile. + ;; Cf define-compilation-mode. + (boundp 'byte-compile-function-environment) + (assq tmp byte-compile-function-environment)))) ;; PLACE is not of the form (GET . SET). (setq mode variable) (setq mode (car variable)) |