all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Levin <zslevin@gmail.com>
To: emacs-devel@gnu.org
Subject: [PATCH] desktop.el: do not save some minor modes
Date: Thu, 25 Oct 2007 13:53:59 +0800	[thread overview]
Message-ID: <200710251354.00086.zslevin@gmail.com> (raw)

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	other threads:[~2007-10-25  5:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-25  5:53 Levin [this message]
2007-10-25  6:53 ` [PATCH] desktop.el: do not save some minor modes 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200710251354.00086.zslevin@gmail.com \
    --to=zslevin@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.