emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107024: Small define-minor-mode fix


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107024: Small define-minor-mode fix for variable: keyword.
Date: Mon, 30 Jan 2012 20:35:57 -0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107024
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Mon 2012-01-30 20:35:57 -0800
message:
  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:.
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/easy-mmode.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-01-31 02:57:00 +0000
+++ b/lisp/ChangeLog    2012-01-31 04:35:57 +0000
@@ -9,7 +9,9 @@
 
 2012-01-31  Glenn Morris  <address@hidden>
 
-       * emacs-lisp/easy-mmode.el (define-minor-mode): Fix :variable case.
+       * emacs-lisp/easy-mmode.el (define-minor-mode):
+       Fix :variable handling of mode a symbol not equal to modefun.
+       Allow named functions to be used as the cdr of variable:.
 
 2012-01-30  Glenn Morris  <address@hidden>
 

=== modified file 'lisp/emacs-lisp/easy-mmode.el'
--- a/lisp/emacs-lisp/easy-mmode.el     2012-01-31 01:53:20 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el     2012-01-31 04:35:57 +0000
@@ -160,7 +160,7 @@
         (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 @@
        (: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))


reply via email to

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