emacs-devel
[Top][All Lists]
Advanced

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

[PATCH] desktop.el: do not save some minor modes


From: Levin
Subject: [PATCH] desktop.el: do not save some minor modes
Date: Thu, 25 Oct 2007 13:53:59 +0800
User-agent: KMail/1.9.7

I use desktop.el, and find that it will save all the minor modes, which is not 
proper. Like erc-track-mode, if ERC is not started, this minor mode is 
meaningless. 

So I add a customizable variable `desktop-minor-modes-not-to-save' to handle 
this situation.

--
Levin

--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -355,6 +355,12 @@ modes are restored automatically; they should not be 
listed here."
   :type '(repeat symbol)
   :group 'desktop)
 
+(defcustom desktop-minor-modes-not-to-save
+  '(erc-track-minor-mode)
+  "List of major modes whose buffers should not be saved."
+  :type '(repeat symbol)
+  :group 'desktop)
+
 (defcustom desktop-file-name-format 'absolute
   "*Format in which desktop file names should be saved.
 Possible values are:
@@ -661,6 +667,7 @@ is nil, ask the user where to save the desktop."
       #'(lambda (minor-mode)
          (and (boundp minor-mode)
               (symbol-value minor-mode)
+              (not (memq minor-mode desktop-minor-modes-not-to-save))
               (let* ((special (assq minor-mode desktop-minor-mode-table))
                      (value (cond (special (cadr special))
                                   ((functionp minor-mode) minor-mode))))




reply via email to

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