unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* desktop
@ 2003-08-15 23:31 Alex Schroeder
  2003-08-16  7:32 ` desktop Lars Hansen
  0 siblings, 1 reply; 27+ messages in thread
From: Alex Schroeder @ 2003-08-15 23:31 UTC (permalink / raw)
  Cc: larsh

I'm a bit confused by desktop.el as it is in Emacs CVS.  I'm using it
without using custom.  The documentation in the info manual says that
I can enable it by using the following in my .emacs file:

     (desktop-load-default)
     (desktop-read)

All I need to do then, according to the manual, is saving it manually
once using M-x desktop-save.  This has worked very well.  Recently,
however, I get the feeling that the info in my ~/.emacs.desktop file
is read upon startup, but never updated when I quit Emacs.  Unless I
save it manually.

Testing this in a subdirectory seems to confirm this.

The reason seems to be that desktop-kill tests the value of
desktop-enable, but that variable is nil on my system.

One solution might be to set it to t, and add it to
desktop-globals-to-save when desktop-save is called...  Calling
desktop-save would then write a desktop file which sets desktop-enable
to t, making the entire thing work again.

Perhaps simpler: We could fix the documentation and the commentary to
say that we need the following setup (if Customize is not used):

     (desktop-load-default)
     (desktop-read)
     (setq desktop-enable t)

I believe that the manual is wrong on another account as well:  It
says that one manual save is required, but it is not.  If the user
does not manually save the desktop, then Emacs will ask the user when
Emacs is killed whether the desktop should be saved.  Which is just
fine, I think.

If you agree with this, then I can change the documentation as
proposed.

Alex.
-- 
http://www.emacswiki.org/alex/
There is no substitute for experience.

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

* Re: desktop
  2003-08-15 23:31 desktop Alex Schroeder
@ 2003-08-16  7:32 ` Lars Hansen
  2003-08-16 13:55   ` desktop and misc.texi Alex Schroeder
  2003-08-18  4:52   ` desktop Richard Stallman
  0 siblings, 2 replies; 27+ messages in thread
From: Lars Hansen @ 2003-08-16  7:32 UTC (permalink / raw)
  Cc: emacs-devel

Alex Schroeder wrote:

>Perhaps simpler: We could fix the documentation and the commentary to
>say that we need the following setup (if Customize is not used):
>
>     (desktop-load-default)
>     (desktop-read)
>     (setq desktop-enable t)
>  
>
To me this sound as the best solution because it is simpler.

>I believe that the manual is wrong on another account as well:  It
>says that one manual save is required, but it is not.  If the user
>does not manually save the desktop, then Emacs will ask the user when
>Emacs is killed whether the desktop should be saved.  Which is just
>fine, I think.
>
>If you agree with this, then I can change the documentation as
>proposed.
>  
>
I agree, so pleese go ahead.

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

* Re: desktop and misc.texi
  2003-08-16  7:32 ` desktop Lars Hansen
@ 2003-08-16 13:55   ` Alex Schroeder
  2003-08-16 18:17     ` Lars Hansen
  2003-08-18  4:52   ` desktop Richard Stallman
  1 sibling, 1 reply; 27+ messages in thread
From: Alex Schroeder @ 2003-08-16 13:55 UTC (permalink / raw)
  Cc: emacs-devel

Lars Hansen <larsh@math.ku.dk> writes:

> I agree, so pleese go ahead.

I have appended two patches, one for misc.texi and one for desktop.el.
I don't think any ChangeLog entries are required, because these are
mostly doc changes.

I also changed one (eq desktop-save 't) to (eq desktop-save t); I
think that should be harmless.

If you agree with these changes, I can commit them.

Alex.



*** misc.texi.~1.43.~	2003-06-09 23:41:30.000000000 +0200
--- misc.texi	2003-08-16 15:50:33.000000000 +0200
***************
*** 1888,1903 ****
  @example
  (desktop-load-default)
  (desktop-read)
  @end example
  
  @noindent
  @findex desktop-save
! The first time you save the state of the Emacs session, you must do it
! manually, with the command @kbd{M-x desktop-save}.  Once you have done
! that, exiting Emacs will save the state again---not only the present
! Emacs session, but also subsequent sessions.  You can also save the
! state at any time, without exiting Emacs, by typing @kbd{M-x
! desktop-save} again.
  
    In order for Emacs to recover the state from a previous session, you
  must start it with the same current directory as you used when you
--- 1888,1902 ----
  @example
  (desktop-load-default)
  (desktop-read)
+ (setq desktop-enable t)
  @end example
  
  @noindent
  @findex desktop-save
! The first time you exit Emacs, you will be asked whether you want to
! save your session.  Once you have done that, exiting Emacs will save
! the state again in subsequent sessions.  You can also save the state
! at any time, without exiting Emacs, by typing @kbd{M-x desktop-save}.
  
    In order for Emacs to recover the state from a previous session, you
  must start it with the same current directory as you used when you




*** desktop.el.~1.58.~	2003-06-09 23:40:37.000000000 +0200
--- desktop.el	2003-08-16 15:52:47.000000000 +0200
***************
*** 37,54 ****
  ;;		- buffer-read-only
  ;;		- some local variables
  
! ;; To use this, first put these two lines in the bottom of your .emacs
! ;; file (the later the better):
  ;;
  ;;	(desktop-load-default)
  ;;	(desktop-read)
  ;;
! ;; Between these two lines you may wish to add something that updates the
  ;; variables `desktop-globals-to-save' and/or `desktop-locals-to-save'.  If
  ;; for instance you want to save the local variable `foobar' for every buffer
  ;; in which it is local, you could add the line
  ;;
! ;;	(setq desktop-locals-to-save (cons 'foobar desktop-locals-to-save))
  ;;
  ;; To avoid saving excessive amounts of data you may also wish to add
  ;; something like the following
--- 37,54 ----
  ;;		- buffer-read-only
  ;;		- some local variables
  
! ;; To use this, add these lines in the bottom of your .emacs file:
  ;;
  ;;	(desktop-load-default)
  ;;	(desktop-read)
+ ;;      (setq desktop-enable t)
  ;;
! ;; Between the first two lines you may wish to add something that updates the
  ;; variables `desktop-globals-to-save' and/or `desktop-locals-to-save'.  If
  ;; for instance you want to save the local variable `foobar' for every buffer
  ;; in which it is local, you could add the line
  ;;
! ;;	(add-to-list 'desktop-locals-to-save 'foobar)
  ;;
  ;; To avoid saving excessive amounts of data you may also wish to add
  ;; something like the following
***************
*** 397,403 ****
        desktop-enable
        (let ((exists (file-exists-p (expand-file-name desktop-base-file-name desktop-dirname))))
          (or
!           (eq desktop-save 't)
            (and exists (memq desktop-save '(ask-if-new if-exists)))
            (and
              (or
--- 397,403 ----
        desktop-enable
        (let ((exists (file-exists-p (expand-file-name desktop-base-file-name desktop-dirname))))
          (or
!           (eq desktop-save t)
            (and exists (memq desktop-save '(ask-if-new if-exists)))
            (and
              (or

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

* Re: desktop and misc.texi
  2003-08-16 13:55   ` desktop and misc.texi Alex Schroeder
@ 2003-08-16 18:17     ` Lars Hansen
  0 siblings, 0 replies; 27+ messages in thread
From: Lars Hansen @ 2003-08-16 18:17 UTC (permalink / raw)
  Cc: emacs-devel

Alex Schroeder wrote:

>I have appended two patches, one for misc.texi and one for desktop.el.
>I don't think any ChangeLog entries are required, because these are
>mostly doc changes.
>
>I also changed one (eq desktop-save 't) to (eq desktop-save t); I
>think that should be harmless.
>
>If you agree with these changes, I can commit them.
>
>Alex.
>  
>
I do agree. Thanks.

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

* Re: desktop
  2003-08-16  7:32 ` desktop Lars Hansen
  2003-08-16 13:55   ` desktop and misc.texi Alex Schroeder
@ 2003-08-18  4:52   ` Richard Stallman
  2003-08-18  9:33     ` desktop Lars Hansen
                       ` (2 more replies)
  1 sibling, 3 replies; 27+ messages in thread
From: Richard Stallman @ 2003-08-18  4:52 UTC (permalink / raw)
  Cc: emacs-devel, alex

    >     (desktop-load-default)
    >     (desktop-read)
    >     (setq desktop-enable t)
    >  
    >
    To me this sound as the best solution because it is simpler.

It is simple, but inconvenient for the user.

Is there any situation in which the user benefits from
having desktop-enable be nil?  Do users want that mode of
operation?  If not, we could just make desktop-enable t by default.
Why not?

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

* Re: desktop
  2003-08-18  4:52   ` desktop Richard Stallman
@ 2003-08-18  9:33     ` Lars Hansen
  2003-08-18 10:05     ` desktop Miles Bader
  2003-08-18 11:34     ` desktop Alex Schroeder
  2 siblings, 0 replies; 27+ messages in thread
From: Lars Hansen @ 2003-08-18  9:33 UTC (permalink / raw)
  Cc: emacs-devel, alex

Richard Stallman wrote:

>It is simple, but inconvenient for the user.
>
>Is there any situation in which the user benefits from
>having desktop-enable be nil?  Do users want that mode of
>operation?  If not, we could just make desktop-enable t by default.
>Why not?
>
Richard and Alex, please give me a few days to think these matters over.
I'll be back :-)

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

* Re: desktop
  2003-08-18  4:52   ` desktop Richard Stallman
  2003-08-18  9:33     ` desktop Lars Hansen
@ 2003-08-18 10:05     ` Miles Bader
  2003-08-18 15:53       ` desktop Alex Schroeder
  2003-08-18 11:34     ` desktop Alex Schroeder
  2 siblings, 1 reply; 27+ messages in thread
From: Miles Bader @ 2003-08-18 10:05 UTC (permalink / raw)
  Cc: Lars Hansen, alex, emacs-devel

Richard Stallman <rms@gnu.org> writes:
> Is there any situation in which the user benefits from
> having desktop-enable be nil?  Do users want that mode of
> operation?  If not, we could just make desktop-enable t by default.
> Why not?

Because then desktop keeps asking annoying questions?

I really don't know anything about desktop, but for some reason I set
`desktop-enable' to t at some point.

Then emacs started asking questions when I exited -- `Save desktop?' `Where?'
etc.

I don't want to answer questions when I exit, I just want to exit, and I
presume most users are the same -- _especially_ if it's for a feature
that they didn't enable explicitly.

Maybe there's something screwed up with my system, I don't know.

If desktop did something useful without being annoying I suppose it
could be turned on by default.

-Miles
-- 
Quidquid latine dictum sit, altum viditur.

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

* Re: desktop
  2003-08-18  4:52   ` desktop Richard Stallman
  2003-08-18  9:33     ` desktop Lars Hansen
  2003-08-18 10:05     ` desktop Miles Bader
@ 2003-08-18 11:34     ` Alex Schroeder
  2003-08-19  5:58       ` desktop Richard Stallman
  2 siblings, 1 reply; 27+ messages in thread
From: Alex Schroeder @ 2003-08-18 11:34 UTC (permalink / raw)
  Cc: Lars Hansen, emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     >     (desktop-load-default)
>     >     (desktop-read)
>     >     (setq desktop-enable t)

> Is there any situation in which the user benefits from
> having desktop-enable be nil?  Do users want that mode of
> operation?  If not, we could just make desktop-enable t by default.
> Why not?

As it is, if desktop-enable is non-nil, then loading desktop.el will
also enable it.  I think that is surprising for users.

The correct solution would be to set desktop-enable to t in one of the
two other functions.

Alex.
-- 
http://www.emacswiki.org/alex/
There is no substitute for experience.

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

* Re: desktop
  2003-08-18 10:05     ` desktop Miles Bader
@ 2003-08-18 15:53       ` Alex Schroeder
  2003-08-19  6:23         ` desktop Miles Bader
  0 siblings, 1 reply; 27+ messages in thread
From: Alex Schroeder @ 2003-08-18 15:53 UTC (permalink / raw)
  Cc: Lars Hansen, rms, emacs-devel

Miles Bader <miles@lsi.nec.co.jp> writes:

> Because then desktop keeps asking annoying questions?
>
> I really don't know anything about desktop, but for some reason I set
> `desktop-enable' to t at some point.
>
> Then emacs started asking questions when I exited -- `Save desktop?' `Where?'
> etc.

I think you must be confusing something.  Or perhaps desktop.el
changed in the meantime.

These days, if you load desktop.el and call the two defuns you are
supposed to call, then you will resume the session from your .emacs.desktop
file.

When you quit Emacs, and desktop-enable is nil, your session will not
be saved to the .emacs.desktop file.  This is the problem I was
reporting.

What you are reporting, however, seems to occur only once:  When you
don't have a .emacs.desktop file, it will ask you for one on quitting.
Next time, however, upon finding the existing file, you should not see
any questions.  That is the behaviour dictated by the default value of
desktop-save -- 'ask-if-new.  Perhaps you have set desktop-save to
something different?

> If desktop did something useful without being annoying I suppose it
> could be turned on by default.

Hm, I didn't read Richard's comment that way.  I don't think we
should turn desktop on by default.

Alex.
-- 
http://www.emacswiki.org/alex/
There is no substitute for experience.

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

* Re: desktop
  2003-08-18 11:34     ` desktop Alex Schroeder
@ 2003-08-19  5:58       ` Richard Stallman
  0 siblings, 0 replies; 27+ messages in thread
From: Richard Stallman @ 2003-08-19  5:58 UTC (permalink / raw)
  Cc: larsh, emacs-devel

    As it is, if desktop-enable is non-nil, then loading desktop.el will
    also enable it.  I think that is surprising for users.

I see.  That is a good reason.

    The correct solution would be to set desktop-enable to t in one of the
    two other functions.

That seems plausible.

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

* Re: desktop
  2003-08-18 15:53       ` desktop Alex Schroeder
@ 2003-08-19  6:23         ` Miles Bader
  2003-08-19  8:45           ` desktop Lars Hansen
  0 siblings, 1 reply; 27+ messages in thread
From: Miles Bader @ 2003-08-19  6:23 UTC (permalink / raw)
  Cc: Lars Hansen, rms, emacs-devel

Alex Schroeder <alex@emacswiki.org> writes:
> > Then emacs started asking questions when I exited -- `Save desktop?' `Where?'
>
> I think you must be confusing something.

Almost certainly.... :-)

Anyway, _somehow_ `desktop-enable' got set to t in my customization
variables (I don't even remember doing this), and desktop proceeded to
ask the above questions whenever I exited; I didn't know how to answer
them properly (even if I answered `y' to the save-desktop question, it
then asked me _where_ which I didn't know how to answer), so it never
stopped asking.

I eventually realized where these questions where coming from and used
customize to turn it off, and the questions stopped, but I presume if
this is any indication, turning it on by default would confuse people
like me...

-miles
-- 
We live, as we dream -- alone....

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

* Re: desktop
  2003-08-19  6:23         ` desktop Miles Bader
@ 2003-08-19  8:45           ` Lars Hansen
  2003-08-20  2:43             ` desktop Richard Stallman
  0 siblings, 1 reply; 27+ messages in thread
From: Lars Hansen @ 2003-08-19  8:45 UTC (permalink / raw)
  Cc: emacs-devel

About the desktop module enabling thing:

When `desktop-enable' is nil the desktop module should do absolutely 
nothing. Otherwise the variable name would be misleading.
When `desktop-enable' is non-nil, the module should try to load a 
desktop when Emacs is started, and it should try to save it when Emacs 
is killed. There are several variable that let you customize how.

Alex pointed out that you have to set `desktop-enable' to non-nil if you 
want the desktop saved at Emacs kill, this was not so previously (in the 
released versions of Emacs). That is true. IMHO it was a bug that the 
desktop was saved even if `desktop-enable' was nil. That bug is 
corrected now.
Alex also pointed out that the documentation in the desktop module and 
in the manual is wrong. That is also true. It should be something like:

   To enable desktop saving, use customize to set `desktop-enable' to 
non-nil.
   Alternatively, place the following two lines somewhere in your .emacs 
file:

      (desktop-load-default)
      (setq desktop-enable t)

You should not call `desktop-read' in your .emacs file, that is done in 
the `after-init-hook'.
It is also wrong, as stated it the manual, that you need to save the 
desktop manually the first time. Previously that was needed in order the 
set the value of `desktop-dirname'. Now Emacs will ask when killed if 
the value is needed and unknown.

I agree with Miles and Alex that it would be confusing to users if 
simply loading the desktop module would enable it. So I think 
`desktop-enable' should continue to have the default value nil.

I think more updates to the documentation of the desktop module is 
needed. I will work on it and post some proposals later.

Lars

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

* Re: desktop
  2003-08-19  8:45           ` desktop Lars Hansen
@ 2003-08-20  2:43             ` Richard Stallman
  2003-08-20  7:46               ` desktop Lars Hansen
  0 siblings, 1 reply; 27+ messages in thread
From: Richard Stallman @ 2003-08-20  2:43 UTC (permalink / raw)
  Cc: alex, emacs-devel, miles

What do you think of the suggestion that loading a desktop should set
desktop-enable to t?

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

* Re: desktop
  2003-08-20  2:43             ` desktop Richard Stallman
@ 2003-08-20  7:46               ` Lars Hansen
  2003-08-20 10:24                 ` desktop Alex Schroeder
  2003-08-21 14:11                 ` desktop Richard Stallman
  0 siblings, 2 replies; 27+ messages in thread
From: Lars Hansen @ 2003-08-20  7:46 UTC (permalink / raw)
  Cc: alex, emacs-devel, miles

Richard Stallman wrote:

>What do you think of the suggestion that loading a desktop should set
>desktop-enable to t?
>  
>
I guess you refer to the function desktop-read?
As a wrote in my previous mail you should not call desktop-read in your 
.emacs file, so I don't think desktop-read should change desktop-enable.

I suggest we make desktop enabling into a minor mode:
   - Rename variable desktop-enable to desktop-save-mode
   - Introduce an autoloaded toggling function desktop-save-mode
   - Get rid of desktop-remove
If we let desktop-save-mode default to nil, users that don't want 
desktop saving wont be bothered. Users that want desktop enabling should 
turn it on desktop-save-mode using customize, or put
   (desktop-save-mode 1)
in their .emacs file.

WDYT

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

* Re: desktop
  2003-08-20  7:46               ` desktop Lars Hansen
@ 2003-08-20 10:24                 ` Alex Schroeder
  2003-08-21 14:11                 ` desktop Richard Stallman
  1 sibling, 0 replies; 27+ messages in thread
From: Alex Schroeder @ 2003-08-20 10:24 UTC (permalink / raw)
  Cc: emacs-devel

Lars Hansen <larsh@math.ku.dk> writes:

> I suggest we make desktop enabling into a minor mode:
>    - Rename variable desktop-enable to desktop-save-mode
>    - Introduce an autoloaded toggling function desktop-save-mode
>    - Get rid of desktop-remove
> If we let desktop-save-mode default to nil, users that don't want
> desktop saving wont be bothered. Users that want desktop enabling
> should turn it on desktop-save-mode using customize, or put
>    (desktop-save-mode 1)
> in their .emacs file.

Yes, I like that.

Alex.
-- 
http://www.emacswiki.org/alex/
There is no substitute for experience.

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

* Re: desktop
  2003-08-20  7:46               ` desktop Lars Hansen
  2003-08-20 10:24                 ` desktop Alex Schroeder
@ 2003-08-21 14:11                 ` Richard Stallman
  2003-08-21 17:55                   ` desktop Lars Hansen
  1 sibling, 1 reply; 27+ messages in thread
From: Richard Stallman @ 2003-08-21 14:11 UTC (permalink / raw)
  Cc: alex, emacs-devel, miles

    As a wrote in my previous mail you should not call desktop-read in your 
    .emacs file,

I don't remember seeing that.  Here's what the manual says now:

      To use Desktop, you should use the Customization buffer (@pxref{Easy
    Customization}) to set @code{desktop-enable} to a non-@code{nil} value,
    or add these lines at the end of your @file{.emacs} file:

    @example
    (desktop-load-default)
    (desktop-read)
    (setq desktop-enable t)
    @end example

Are you saying that the second option is a mistake?

Otherwise, it looks like desktop-read should set desktop-enable.
Is there a case where people want to use desktop-read without
setting desktop-enable?

    I suggest we make desktop enabling into a minor mode:
       - Rename variable desktop-enable to desktop-save-mode

That's ok, if we preserve compatibility with a variable alias.

       - Introduce an autoloaded toggling function desktop-save-mode

That seems ok too.

       - Get rid of desktop-remove

Why do that?

    If we let desktop-save-mode default to nil, users that don't want 
    desktop saving wont be bothered. Users that want desktop enabling should 
    turn it on desktop-save-mode using customize, or put
       (desktop-save-mode 1)
    in their .emacs file.

Ok.

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

* Re: desktop
  2003-08-21 14:11                 ` desktop Richard Stallman
@ 2003-08-21 17:55                   ` Lars Hansen
  2003-08-21 21:59                     ` desktop Alex Schroeder
                                       ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Lars Hansen @ 2003-08-21 17:55 UTC (permalink / raw)
  Cc: alex, emacs-devel, miles

>
>
>Here's what the manual says now:
>
>      To use Desktop, you should use the Customization buffer (@pxref{Easy
>    Customization}) to set @code{desktop-enable} to a non-@code{nil} value,
>    or add these lines at the end of your @file{.emacs} file:
>
>    @example
>    (desktop-load-default)
>    (desktop-read)
>    (setq desktop-enable t)
>    @end example
>
>Are you saying that the second option is a mistake?
>  
>
Yes. The desktop module adds an anonymous function to the 
after-init-hook, this function calls desktop-read.

>Otherwise, it looks like desktop-read should set desktop-enable.
>Is there a case where people want to use desktop-read without
>setting desktop-enable?
>
Yes. desktop-enable is supposed to enable _automatic_ desktop save and 
restore. You might want to call desktop-read without the side effect of 
enabling automatic saving.

>       - Get rid of desktop-remove
>
>Why do that?
>  
>
desktop-remove is, according to the docstring, supposed to "Delete the 
Desktop file and inactivate the desktop system". If we introduce 
desktop-save as a minor mode, disabling is should be done by the mode 
function. Furthermore desktop-remove only removes the desktop file in 
desktop-dirname, not desktop files in other directories. I think it 
would be better not to delete any desktop file at all.

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

* Re: desktop
  2003-08-21 17:55                   ` desktop Lars Hansen
@ 2003-08-21 21:59                     ` Alex Schroeder
  2003-08-23  3:59                     ` desktop Richard Stallman
  2003-08-24  0:09                     ` desktop Richard Stallman
  2 siblings, 0 replies; 27+ messages in thread
From: Alex Schroeder @ 2003-08-21 21:59 UTC (permalink / raw)
  Cc: emacs-devel

Lars Hansen <larsh@math.ku.dk> writes:

> Furthermore desktop-remove only removes the desktop file in
> desktop-dirname, not desktop files in other directories. I think it
> would be better not to delete any desktop file at all.

I agree with that.

Alex.
-- 
http://www.emacswiki.org/alex/
There is no substitute for experience.

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

* Re: desktop
  2003-08-21 17:55                   ` desktop Lars Hansen
  2003-08-21 21:59                     ` desktop Alex Schroeder
@ 2003-08-23  3:59                     ` Richard Stallman
  2003-08-24 13:43                       ` desktop Lars Hansen
  2003-08-24  0:09                     ` desktop Richard Stallman
  2 siblings, 1 reply; 27+ messages in thread
From: Richard Stallman @ 2003-08-23  3:59 UTC (permalink / raw)
  Cc: alex, emacs-devel, miles

    >    @example
    >    (desktop-load-default)
    >    (desktop-read)
    >    (setq desktop-enable t)
    >    @end example
    >
    >Are you saying that the second option is a mistake?
    >  
    >
    Yes. The desktop module adds an anonymous function to the 
    after-init-hook, this function calls desktop-read.

What should that text say?

    desktop-remove is, according to the docstring, supposed to "Delete the 
    Desktop file and inactivate the desktop system". If we introduce 
    desktop-save as a minor mode, disabling is should be done by the mode 
    function. Furthermore desktop-remove only removes the desktop file in 
    desktop-dirname, not desktop files in other directories. I think it 
    would be better not to delete any desktop file at all.

Let's keep desktop-remove for compatibility.

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

* Re: desktop
  2003-08-21 17:55                   ` desktop Lars Hansen
  2003-08-21 21:59                     ` desktop Alex Schroeder
  2003-08-23  3:59                     ` desktop Richard Stallman
@ 2003-08-24  0:09                     ` Richard Stallman
  2003-08-24  6:01                       ` desktop Lars Hansen
  2 siblings, 1 reply; 27+ messages in thread
From: Richard Stallman @ 2003-08-24  0:09 UTC (permalink / raw)
  Cc: miles, emacs-devel, alex

    >Are you saying that the second option is a mistake?
    >  
    >
    Yes. The desktop module adds an anonymous function to the 
    after-init-hook, this function calls desktop-read.

So is this correct?

    (desktop-load-default)
    (setq desktop-enable t)

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

* Re: desktop
  2003-08-24  0:09                     ` desktop Richard Stallman
@ 2003-08-24  6:01                       ` Lars Hansen
  2003-08-24 19:59                         ` desktop Alex Schroeder
  2003-08-25  3:29                         ` desktop Richard Stallman
  0 siblings, 2 replies; 27+ messages in thread
From: Lars Hansen @ 2003-08-24  6:01 UTC (permalink / raw)
  Cc: miles, emacs-devel, alex

Richard Stallman wrote:

>    >Are you saying that the second option is a mistake?
>    >  
>    >
>    Yes. The desktop module adds an anonymous function to the 
>    after-init-hook, this function calls desktop-read.
>
>So is this correct?
>
>    (desktop-load-default)
>    (setq desktop-enable t)
>
>  
>
Actually only the second line is needed. During startup default.el is 
loaded before after-init-hook is called, so there is no point in loading 
default.el manually.
So this is correct:

    (setq desktop-enable t)

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

* Re: desktop
  2003-08-23  3:59                     ` desktop Richard Stallman
@ 2003-08-24 13:43                       ` Lars Hansen
  0 siblings, 0 replies; 27+ messages in thread
From: Lars Hansen @ 2003-08-24 13:43 UTC (permalink / raw)
  Cc: alex, emacs-devel, miles

>
>
>What should that text say?
>
It should just say

@example
(setq desktop-enable t)
@end example

>Let's keep desktop-remove for compatibility.
>
Ok.

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

* Re: desktop
  2003-08-24  6:01                       ` desktop Lars Hansen
@ 2003-08-24 19:59                         ` Alex Schroeder
  2003-08-25  6:03                           ` desktop Lars Hansen
  2003-08-25 15:21                           ` desktop Richard Stallman
  2003-08-25  3:29                         ` desktop Richard Stallman
  1 sibling, 2 replies; 27+ messages in thread
From: Alex Schroeder @ 2003-08-24 19:59 UTC (permalink / raw)
  Cc: emacs-devel, rms, miles

Lars Hansen <larsh@math.ku.dk> writes:

> Actually only the second line is needed. During startup default.el is
> loaded before after-init-hook is called, so there is no point in
> loading default.el manually.
> So this is correct:
>
>     (setq desktop-enable t)

This is probably not correct, since setting a variable will not load
a file.  *Customizing* this variable will store extra information in
the .emacs file which will then load desktop.el.  But for the
non-custom solution, I think the best thing would be

(desktop-mode 1)

And desktop-mode is an autoloaded global minor mode from desktop.el
which also sets desktop-enable to t when active.

Alex.
-- 
http://www.emacswiki.org/alex/
There is no substitute for experience.

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

* Re: desktop
  2003-08-24  6:01                       ` desktop Lars Hansen
  2003-08-24 19:59                         ` desktop Alex Schroeder
@ 2003-08-25  3:29                         ` Richard Stallman
  2003-08-25  6:05                           ` desktop Lars Hansen
  1 sibling, 1 reply; 27+ messages in thread
From: Richard Stallman @ 2003-08-25  3:29 UTC (permalink / raw)
  Cc: miles, emacs-devel, alex

    Actually only the second line is needed. During startup default.el is 
    loaded before after-init-hook is called, so there is no point in loading 
    default.el manually.
    So this is correct:

	(setq desktop-enable t)

Thanks.  I will change desktop.el and misc.texi.

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

* Re: desktop
  2003-08-24 19:59                         ` desktop Alex Schroeder
@ 2003-08-25  6:03                           ` Lars Hansen
  2003-08-25 15:21                           ` desktop Richard Stallman
  1 sibling, 0 replies; 27+ messages in thread
From: Lars Hansen @ 2003-08-25  6:03 UTC (permalink / raw)
  Cc: emacs-devel, rms, miles


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

>
>
>>So this is correct:
>>
>>    (setq desktop-enable t)
>>    
>>
>
>This is probably not correct, since setting a variable will not load
>a file.  *Customizing* this variable will store extra information in
>the .emacs file which will then load desktop.el.  But for the
>non-custom solution, I think the best thing would be
>
>(desktop-mode 1)
>
>And desktop-mode is an autoloaded global minor mode from desktop.el
>which also sets desktop-enable to t when active.
>
>Alex.
>  
>
Yes, you are right.
So until I have finished implementing desktop-save-mode, it should be

   (require 'desktop)
   (setq desktop-enable t)


[-- Attachment #1.2: Type: text/html, Size: 938 bytes --]

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

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

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

* Re: desktop
  2003-08-25  3:29                         ` desktop Richard Stallman
@ 2003-08-25  6:05                           ` Lars Hansen
  0 siblings, 0 replies; 27+ messages in thread
From: Lars Hansen @ 2003-08-25  6:05 UTC (permalink / raw)
  Cc: miles, emacs-devel, alex

>
>
>    So this is correct:
>
>	(setq desktop-enable t)
>
>Thanks.  I will change desktop.el and misc.texi.
>  
>
Woops, it should be:

   (require 'desktop)
   (setq desktop-enable t)

Sorry!

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

* Re: desktop
  2003-08-24 19:59                         ` desktop Alex Schroeder
  2003-08-25  6:03                           ` desktop Lars Hansen
@ 2003-08-25 15:21                           ` Richard Stallman
  1 sibling, 0 replies; 27+ messages in thread
From: Richard Stallman @ 2003-08-25 15:21 UTC (permalink / raw)
  Cc: larsh, emacs-devel, miles

      But for the
    non-custom solution, I think the best thing would be

    (desktop-mode 1)

There is no function desktop-mode now, so that won't work now.
There's a proposal to make it a minor mode, which could be a good
idea.  However, for now I will change it to:

;; To use this, add these lines to the bottom of your .emacs file:
;;
;;      (require 'desktop)
;;      (setq desktop-enable t)

It sounds like that is right.  If it isn't, please tell me.

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

end of thread, other threads:[~2003-08-25 15:21 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-15 23:31 desktop Alex Schroeder
2003-08-16  7:32 ` desktop Lars Hansen
2003-08-16 13:55   ` desktop and misc.texi Alex Schroeder
2003-08-16 18:17     ` Lars Hansen
2003-08-18  4:52   ` desktop Richard Stallman
2003-08-18  9:33     ` desktop Lars Hansen
2003-08-18 10:05     ` desktop Miles Bader
2003-08-18 15:53       ` desktop Alex Schroeder
2003-08-19  6:23         ` desktop Miles Bader
2003-08-19  8:45           ` desktop Lars Hansen
2003-08-20  2:43             ` desktop Richard Stallman
2003-08-20  7:46               ` desktop Lars Hansen
2003-08-20 10:24                 ` desktop Alex Schroeder
2003-08-21 14:11                 ` desktop Richard Stallman
2003-08-21 17:55                   ` desktop Lars Hansen
2003-08-21 21:59                     ` desktop Alex Schroeder
2003-08-23  3:59                     ` desktop Richard Stallman
2003-08-24 13:43                       ` desktop Lars Hansen
2003-08-24  0:09                     ` desktop Richard Stallman
2003-08-24  6:01                       ` desktop Lars Hansen
2003-08-24 19:59                         ` desktop Alex Schroeder
2003-08-25  6:03                           ` desktop Lars Hansen
2003-08-25 15:21                           ` desktop Richard Stallman
2003-08-25  3:29                         ` desktop Richard Stallman
2003-08-25  6:05                           ` desktop Lars Hansen
2003-08-18 11:34     ` desktop Alex Schroeder
2003-08-19  5:58       ` desktop Richard Stallman

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