all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] desktop.el: do not save some minor modes
@ 2007-10-25  5:53 Levin
  2007-10-25  6:53 ` martin rudalics
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Levin @ 2007-10-25  5:53 UTC (permalink / raw)
  To: emacs-devel

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))))

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-10-30 11:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-25  5:53 [PATCH] desktop.el: do not save some minor modes Levin
2007-10-25  6:53 ` martin rudalics
2007-10-25  8:16   ` Levin
2007-10-25  8:40 ` Juanma Barranquero
2007-10-26  1:09   ` Levin
2007-10-26  3:49 ` Richard Stallman
2007-10-26  4:53   ` Levin
2007-10-26  8:31     ` Juanma Barranquero
2007-10-27  2:28     ` Richard Stallman
2007-10-29  1:03       ` Michael Olson
2007-10-29 15:48         ` CHENG Gao
2007-10-30  0:51           ` Michael Olson
2007-10-30 11:22             ` CHENG Gao

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.