]> git.eshelyaron.com Git - emacs.git/commitdiff
(desktop-save): Don't save minor modes without a known mode initialization function.
authorLars Hansen <larsh@soem.dk>
Mon, 31 May 2004 21:45:51 +0000 (21:45 +0000)
committerLars Hansen <larsh@soem.dk>
Mon, 31 May 2004 21:45:51 +0000 (21:45 +0000)
lisp/ChangeLog
lisp/desktop.el

index bf08d2643f3674262ec44353ad8c52d112fb362d..064f7a01f10627b2765ba5516efc7d7709ce2a6e 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-31  Lars Hansen  <larsh@math.ku.dk>
+
+       * desktop.el (desktop-save): Don't save minor modes without a
+       known mode initialization function.
+
 2004-05-30  Luc Teirlinck  <teirllm@auburn.edu>
 
        * replace.el (query-replace-interactive): Convert defvar into
index a21d132e03bfdf1d0faabbe44d0b6c6415ac82a1..3888262f02fd531ae78985a610a047df82203784 100644 (file)
@@ -326,7 +326,7 @@ NAME is the name of the buffer-local variable indicating that the minor
 mode is active.  RESTORE-FUNCTION is the function to activate the minor mode.
 called.  RESTORE-FUNCTION nil means don't try to restore the minor mode.
 Only minor modes for which the name of the buffer-local variable
-and the name of the minor mode function are different have to added to
+and the name of the minor mode function are different have to be added to
 this table."
   :type 'sexp
   :group 'desktop)
@@ -589,16 +589,17 @@ See also `desktop-base-file-name'."
                     major-mode
                     ;; minor modes
                     (let (ret)
-                      (mapcar
-                        #'(lambda (mim)
+                      (mapc
+                        #'(lambda (minor-mode)
                           (and
-                            (boundp mim)
-                            (symbol-value mim)
-                            (setq ret
-                              (cons
-                                (let ((special (assq mim desktop-minor-mode-table)))
-                                  (if special (cadr special) mim))
-                                ret))))
+                            (boundp minor-mode)
+                            (symbol-value minor-mode)
+                            (let ((special (assq minor-mode desktop-minor-mode-table)))
+                              (when (or special (functionp minor-mode))
+                                (setq ret
+                                  (cons
+                                    (if special (cadr special) minor-mode)
+                                    ret))))))
                         (mapcar #'car minor-mode-alist))
                       ret)
                     (point)