unofficial mirror of emacs-devel@gnu.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

* Re: [PATCH] desktop.el: do not save some minor modes
  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  3:49 ` Richard Stallman
  2 siblings, 1 reply; 13+ messages in thread
From: martin rudalics @ 2007-10-25  6:53 UTC (permalink / raw)
  To: Levin; +Cc: emacs-devel

> +(defcustom desktop-minor-modes-not-to-save
> +  '(erc-track-minor-mode)
> +  "List of major modes whose buffers should not be saved."

You probably mean something like

 > +  "List of minor modes that should not be saved by desktop."

here.

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

* Re: [PATCH] desktop.el: do not save some minor modes
  2007-10-25  6:53 ` martin rudalics
@ 2007-10-25  8:16   ` Levin
  0 siblings, 0 replies; 13+ messages in thread
From: Levin @ 2007-10-25  8:16 UTC (permalink / raw)
  To: emacs-devel; +Cc: martin rudalics

martin rudalics wrote:
> > +(defcustom desktop-minor-modes-not-to-save
> > +  '(erc-track-minor-mode)
> > +  "List of major modes whose buffers should not be saved."
>
> You probably mean something like
>
>  > +  "List of minor modes that should not be saved by desktop."
>
> here.

Oh yes, you're right :) Fast copy-paste problem.

--
Levin

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

* Re: [PATCH] desktop.el: do not save some minor modes
  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:40 ` Juanma Barranquero
  2007-10-26  1:09   ` Levin
  2007-10-26  3:49 ` Richard Stallman
  2 siblings, 1 reply; 13+ messages in thread
From: Juanma Barranquero @ 2007-10-25  8:40 UTC (permalink / raw)
  To: Levin; +Cc: emacs-devel

On 10/25/07, Levin <zslevin@gmail.com> wrote:

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

Isn't enough to add (erc-track-mode nil) to `desktop-minor-mode-table'?

             Juanma

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

* Re: [PATCH] desktop.el: do not save some minor modes
  2007-10-25  8:40 ` Juanma Barranquero
@ 2007-10-26  1:09   ` Levin
  0 siblings, 0 replies; 13+ messages in thread
From: Levin @ 2007-10-26  1:09 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: emacs-devel

Juanma Barranquero Wrote:
> On 10/25/07, Levin <zslevin@gmail.com> wrote:
> > 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.
>
> Isn't enough to add (erc-track-mode nil) to `desktop-minor-mode-table'?
>
>              Juanma

Yes, you are right. That's enough. Thank you for pointing that out.

Levin

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

* Re: [PATCH] desktop.el: do not save some minor modes
  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:40 ` Juanma Barranquero
@ 2007-10-26  3:49 ` Richard Stallman
  2007-10-26  4:53   ` Levin
  2 siblings, 1 reply; 13+ messages in thread
From: Richard Stallman @ 2007-10-26  3:49 UTC (permalink / raw)
  To: emacs-devel; +Cc: Levin

What do people think of this patch?  The feature seems useful.  Does
anyone see a reason to do it differently?

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

* Re: [PATCH] desktop.el: do not save some minor modes
  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
  0 siblings, 2 replies; 13+ messages in thread
From: Levin @ 2007-10-26  4:53 UTC (permalink / raw)
  To: emacs-devel, rms

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 311 bytes --]

On Friday 11:49:13£¬Richard Stallman wrote£º
> What do people think of this patch?  The feature seems useful.  Does
> anyone see a reason to do it differently?

This line:

   (add-to-list 'desktop-minor-mode-table '(erc-track-minor-mode nil))

solves my problem, so this patch is not needed.

Levin

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

* Re: [PATCH] desktop.el: do not save some minor modes
  2007-10-26  4:53   ` Levin
@ 2007-10-26  8:31     ` Juanma Barranquero
  2007-10-27  2:28     ` Richard Stallman
  1 sibling, 0 replies; 13+ messages in thread
From: Juanma Barranquero @ 2007-10-26  8:31 UTC (permalink / raw)
  To: Levin; +Cc: emacs-devel

On 10/26/07, Levin <zslevin@gmail.com> wrote:

> This line:
>
>    (add-to-list 'desktop-minor-mode-table '(erc-track-minor-mode nil))
>
> solves my problem, so this patch is not needed.

OTOH, if restoring erc-track-minor-mode from desktop is never a
meaningful operation, we should patch erc-track.el to add it
automatically to `desktop-minor-mode-table'.

             Juanma

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

* Re: [PATCH] desktop.el: do not save some minor modes
  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
  1 sibling, 1 reply; 13+ messages in thread
From: Richard Stallman @ 2007-10-27  2:28 UTC (permalink / raw)
  To: Levin; +Cc: emacs-devel

       (add-to-list 'desktop-minor-mode-table '(erc-track-minor-mode nil))

    solves my problem, so this patch is not needed.

Should we do that by default?  Is it clear that users will
prefer not to record that minor mode?

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

* Re: [PATCH] desktop.el: do not save some minor modes
  2007-10-27  2:28     ` Richard Stallman
@ 2007-10-29  1:03       ` Michael Olson
  2007-10-29 15:48         ` CHENG Gao
  0 siblings, 1 reply; 13+ messages in thread
From: Michael Olson @ 2007-10-29  1:03 UTC (permalink / raw)
  To: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 593 bytes --]

Richard Stallman <rms@gnu.org> writes:

>        (add-to-list 'desktop-minor-mode-table '(erc-track-minor-mode nil))
>
>     solves my problem, so this patch is not needed.
>
> Should we do that by default?  Is it clear that users will
> prefer not to record that minor mode?

I've now checked in a change to this effect.

-- 
       Michael Olson -- FSF Associate Member #652     |
 http://mwolson.org/ -- Jabber: mwolson_at_hcoop.net  |  /` |\ | | |
            Sysadmin -- Hobbies: Lisp, GP2X, HCoop    | |_] | \| |_|
Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: [PATCH] desktop.el: do not save some minor modes
  2007-10-29  1:03       ` Michael Olson
@ 2007-10-29 15:48         ` CHENG Gao
  2007-10-30  0:51           ` Michael Olson
  0 siblings, 1 reply; 13+ messages in thread
From: CHENG Gao @ 2007-10-29 15:48 UTC (permalink / raw)
  To: emacs-devel


>>        (add-to-list 'desktop-minor-mode-table '(erc-track-minor-mode
>> nil))
>> solves my problem, so this patch is not needed.
>> Should we do that by default? Is it clear that users will prefer not
>> to record that minor mode?
>
> I've now checked in a change to this effect.

After this change this is one thing annoying - I have to (require
'desktop) to use erc even I dont use desktop.el otherwise an error is
triggered telling desktop-minor-mode-table not existed or something. I
think it's a bug.

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

* Re: [PATCH] desktop.el: do not save some minor modes
  2007-10-29 15:48         ` CHENG Gao
@ 2007-10-30  0:51           ` Michael Olson
  2007-10-30 11:22             ` CHENG Gao
  0 siblings, 1 reply; 13+ messages in thread
From: Michael Olson @ 2007-10-30  0:51 UTC (permalink / raw)
  To: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 999 bytes --]

CHENG Gao <chenggao@gmail.com> writes:

>>>        (add-to-list 'desktop-minor-mode-table '(erc-track-minor-mode
>>> nil))
>>> solves my problem, so this patch is not needed.
>>> Should we do that by default? Is it clear that users will prefer not
>>> to record that minor mode?
>>
>> I've now checked in a change to this effect.
>
> After this change this is one thing annoying - I have to (require
> 'desktop) to use erc even I dont use desktop.el otherwise an error is
> triggered telling desktop-minor-mode-table not existed or something. I
> think it's a bug.

OK, I've now moved the line into the definition of
desktop-minor-mode-table itself, which seems to be what other modes do.
This should fix the annoyance.

-- 
       Michael Olson -- FSF Associate Member #652     |
 http://mwolson.org/ -- Jabber: mwolson_at_hcoop.net  |  /` |\ | | |
            Sysadmin -- Hobbies: Lisp, GP2X, HCoop    | |_] | \| |_|
Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner |

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: [PATCH] desktop.el: do not save some minor modes
  2007-10-30  0:51           ` Michael Olson
@ 2007-10-30 11:22             ` CHENG Gao
  0 siblings, 0 replies; 13+ messages in thread
From: CHENG Gao @ 2007-10-30 11:22 UTC (permalink / raw)
  To: emacs-devel


> OK, I've now moved the line into the definition of
> desktop-minor-mode-table itself, which seems to be what other modes do.
> This should fix the annoyance.
Thanks. It works now.

^ 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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).