all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emacs.desktop non-functional
@ 2016-03-17  1:38 ken
  2016-03-17  3:39 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: ken @ 2016-03-17  1:38 UTC (permalink / raw)
  To: help-gnu-emacs

How do I get emacs to save sessions?  In version 22.1.1 it worked fine, 
would save which buffers had been opened and would load them all back 
again, even if the system went out suddenly due to a power outage.  In 
version 24.3.1 this functionality is gone, even if I do a graceful 
shutdown.  So how to get it working?

tnx




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

* Re: emacs.desktop non-functional
  2016-03-17  1:38 emacs.desktop non-functional ken
@ 2016-03-17  3:39 ` Eli Zaretskii
  2016-03-17 21:05   ` ken
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2016-03-17  3:39 UTC (permalink / raw)
  To: help-gnu-emacs

> From: ken <gebser@mousecar.com>
> Date: Wed, 16 Mar 2016 21:38:41 -0400
> 
> How do I get emacs to save sessions?  In version 22.1.1 it worked fine, 
> would save which buffers had been opened and would load them all back 
> again, even if the system went out suddenly due to a power outage.  In 
> version 24.3.1 this functionality is gone, even if I do a graceful 
> shutdown.

No, it still works.

I'm guessing it's something in your .emacs.  Please show how do you
turn the feature on there.



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

* Re: emacs.desktop non-functional
  2016-03-17  3:39 ` Eli Zaretskii
@ 2016-03-17 21:05   ` ken
  2016-03-18  8:01     ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: ken @ 2016-03-17 21:05 UTC (permalink / raw)
  To: Eli Zaretskii, help-gnu-emacs

On 03/16/2016 11:39 PM, Eli Zaretskii wrote:
>> From: ken <gebser@mousecar.com>
>> Date: Wed, 16 Mar 2016 21:38:41 -0400
>>
>> How do I get emacs to save sessions?  In version 22.1.1 it worked fine,
>> would save which buffers had been opened and would load them all back
>> again, even if the system went out suddenly due to a power outage.  In
>> version 24.3.1 this functionality is gone, even if I do a graceful
>> shutdown.
>
> No, it still works.
>
> I'm guessing it's something in your .emacs.  Please show how do you
> turn the feature on there.
>

in ~/.emacs:

(desktop-save-mode 1)

I also checked its value once emacs is newly running and it says:

desktop-save-mode's value is t

In the *Customization Option...* it says:

Desktop Save Mode: Toggle  on (non-nil)
     State : SAVED and set.

$ uname -vrspio
Linux 3.10.0-327.10.1.el7.x86_64 #1 SMP Tue Feb 16 17:03:50 UTC 2016 
x86_64 x86_64 GNU/Linux





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

* Re: emacs.desktop non-functional
  2016-03-17 21:05   ` ken
@ 2016-03-18  8:01     ` Eli Zaretskii
  2016-03-18 19:21       ` ken
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2016-03-18  8:01 UTC (permalink / raw)
  To: help-gnu-emacs

> From: ken <gebser@mousecar.com>
> Date: Thu, 17 Mar 2016 17:05:59 -0400
> 
> in ~/.emacs:
> 
> (desktop-save-mode 1)

This looks OK.  I have the same here, and it does work for me.

Do you have a .emacs.desktop file created when you exit a session?  In
what directories on your system do you have a file by that name?  And
what happens if you invoke desktop-save manually from a running Emacs
session -- does that file get created/updated somewhere?

Also, what exactly does it mean the "functionality is gone" in your
case?  What did you try to do and what happened?



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

* Re: emacs.desktop non-functional
  2016-03-18  8:01     ` Eli Zaretskii
@ 2016-03-18 19:21       ` ken
  2016-03-18 20:20         ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: ken @ 2016-03-18 19:21 UTC (permalink / raw)
  To: Eli Zaretskii, help-gnu-emacs

On 03/18/2016 04:01 AM, Eli Zaretskii wrote:
>> From: ken <gebser@mousecar.com>
>> Date: Thu, 17 Mar 2016 17:05:59 -0400
>>
>> in ~/.emacs:
>>
>> (desktop-save-mode 1)
>
> This looks OK.  I have the same here, and it does work for me.
>
> Do you have a .emacs.desktop file created when you exit a session?  In
> what directories on your system do you have a file by that name?  And
> what happens if you invoke desktop-save manually from a running Emacs
> session -- does that file get created/updated somewhere?
>
> Also, what exactly does it mean the "functionality is gone" in your
> case?  What did you try to do and what happened?


https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html

"Use the desktop library to save the state of Emacs from one session to 
another. Once you save the Emacs desktop—the buffers, their file names, 
major modes, buffer positions, and so on—then subsequent Emacs sessions 
reload the saved desktop. By default, the desktop also tries to save the 
frame and window configuration...."

It doesn't do any of that.  Whenever I start emacs (not emacs-client) I 
get at most one file (buffer) from a previous session loaded.  So of 
course too the frame and window config is not reloaded either-- because 
there's just one buffer loaded.  Saving the multiple frames and window 
configuration has never worked for me in the entire history of 
session-saving... going back five (?) ten (?) years... since I've been 
using it.

Yes, I do have multiple .emacs.desktop files, this because I'm prompted 
for a directory when I do manually "M-x desktop-save".  I don't 
understand the merit in having multiple such files (and by extension the 
purpose of the prompting) if I have no way, AFAIK, to pick one other 
than whichever is the default when I load emacs.

Eli (or anyone), is there a way to get desktop-save to work 
automatically...? that is, to add to the listing in.emacs.desktop the 
name of a file when it's opened and, conversely, taken out when the file 
is closed (~= buffer is killed)?  That's the behavior I was expecting.

tnx for the f1





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

* Re: emacs.desktop non-functional
  2016-03-18 19:21       ` ken
@ 2016-03-18 20:20         ` Eli Zaretskii
  2016-03-19  1:35           ` ken
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2016-03-18 20:20 UTC (permalink / raw)
  To: help-gnu-emacs

> From: ken <gebser@mousecar.com>
> Date: Fri, 18 Mar 2016 15:21:52 -0400
> 
> > Do you have a .emacs.desktop file created when you exit a session?  In
> > what directories on your system do you have a file by that name?  And
> > what happens if you invoke desktop-save manually from a running Emacs
> > session -- does that file get created/updated somewhere?
> >
> > Also, what exactly does it mean the "functionality is gone" in your
> > case?  What did you try to do and what happened?
> 
> https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html

I don't think we will make any progress in investigating the reason(s)
that prevent desktop from working by quoting from the manual.

I asked the questions and hoped that I will get detailed answers.
Like how do you invoke Emacs, in which directory, etc.  This is
important information that is supposed to lead to the problem.

> "Use the desktop library to save the state of Emacs from one session to 
> another. Once you save the Emacs desktop—the buffers, their file names, 
> major modes, buffer positions, and so on—then subsequent Emacs sessions 
> reload the saved desktop. By default, the desktop also tries to save the 
> frame and window configuration...."
> 
> It doesn't do any of that.

Please note that the manual on-line is for version 24.5, whereas you
have 24.3.  So not all of what is described is supposed to be working
in your version.  Perhaps consider upgrading to 24.5.

> Whenever I start emacs (not emacs-client) I 
> get at most one file (buffer) from a previous session loaded.

What if you invoke desktop-read by hand -- does that restore the
previous session's buffers?

> Yes, I do have multiple .emacs.desktop files, this because I'm prompted 
> for a directory when I do manually "M-x desktop-save".

Which one of those multiple files gets updated when you exit Emacs?

> I don't understand the merit in having multiple such files (and by
> extension the purpose of the prompting) if I have no way, AFAIK, to
> pick one other than whichever is the default when I load emacs.

You can save a different desktop in several directories, and then load
one of them if you start Emacs in the directory where you saved
desktop.

> Eli (or anyone), is there a way to get desktop-save to work 
> automatically...?

It works for me.  Something in your case interferes, and the question
is why.  I don't yet have the answer.



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

* Re: emacs.desktop non-functional
  2016-03-18 20:20         ` Eli Zaretskii
@ 2016-03-19  1:35           ` ken
  2016-03-19  8:14             ` Eli Zaretskii
  2016-03-20 22:35             ` Robert Thorpe
  0 siblings, 2 replies; 9+ messages in thread
From: ken @ 2016-03-19  1:35 UTC (permalink / raw)
  To: Eli Zaretskii, GNU Emacs List

On 03/18/2016 04:20 PM, Eli Zaretskii wrote:
>> From: ken <gebser@mousecar.com>
>> Date: Fri, 18 Mar 2016 15:21:52 -0400
>>
>>> Do you have a .emacs.desktop file created when you exit a session?  In
>>> what directories on your system do you have a file by that name?  And
>>> what happens if you invoke desktop-save manually from a running Emacs
>>> session -- does that file get created/updated somewhere?
>>>
>>> Also, what exactly does it mean the "functionality is gone" in your
>>> case?  What did you try to do and what happened?
>>
>> https://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Emacs-Sessions.html
>
> I don't think we will make any progress in investigating the reason(s)
> that prevent desktop from working by quoting from the manual.

I just wanted to explain what I was expecting and what wasn't happening 
without having to type so much.  I thought too some other people on the 
list jwould be interested in what we're talking about.


>
> I asked the questions and hoped that I will get detailed answers.
> Like how do you invoke Emacs, in which directory, etc.  This is
> important information that is supposed to lead to the problem.

There's an icon in the Applications menu that I click on when I have to. 
  But "emacs" is also in that group of applications which gnome starts 
automatically.


>
>> "Use the desktop library to save the state of Emacs from one session to
>> another. Once you save the Emacs desktop—the buffers, their file names,
>> major modes, buffer positions, and so on—then subsequent Emacs sessions
>> reload the saved desktop. By default, the desktop also tries to save the
>> frame and window configuration...."
>>
>> It doesn't do any of that.

Does your emacs do all of that?


>
> Please note that the manual on-line is for version 24.5, whereas you
> have 24.3.  So not all of what is described is supposed to be working
> in your version.  Perhaps consider upgrading to 24.5.

The functionality is the same, so it's not necessary for that sreason.

I'd rather not upgrade.  There are often dependency problems.  I figure 
if Redhat doesn't see a reason to upgrade, that's good enough for me. 
Also the functionality I'm after is already in the version I have...  or 
should be.


>
>> Whenever I start emacs (not emacs-client) I
>> get at most one file (buffer) from a previous session loaded.
>
> What if you invoke desktop-read by hand -- does that restore the
> previous session's buffers?

No.  No new buffers, just all the same ones which were already opened.

The minibuffer says "Warning: desktop file appears to be in use by PID 
4074.  Using it may cause conflicts.  Use it anyway?"  PID 4074 doesn't 
exist... probably from a crashed session.



Did some testing.  When I open a new buffer and type somethign in it but 
before saving the buffer to a file, the buffer name is not to be found 
in any of the emacs.desktop files.

If I then save taht buffer to a file, still nothing-- neither the buffer 
name nor its filename-- is saved to any emacs.desktop file.

So I'm guessing then that if the system suddenly goes down at this 
point, there will be no record in .emacs.desktop of that newly opened 
file.  (This is actually the initial case I'm wondering about.)  Is that 
how it works for you as well?


This might be strange too:

$ ps -ef|grep emacs
xx        2887  2453  0 Mar17 ?        00:00:00 /usr/bin/emacs 
--smid=1019c4f12271782266145082947974782600000023660023 --no-splash 
--chdir=/home/zl --daemon
xx        2944  2453  0 Mar17 ?        00:00:00 emacsclient -c 
--alternate-editor=
xx        2951  2944  0 Mar17 ?        00:00:00 emacs --daemon
xx        3100  2951  0 Mar17 ?        00:00:00 emacs --daemon
xx        3101  2887  0 Mar17 ?        00:00:00 /usr/bin/emacs 
--smid=1019c4f12271782266145082947974782600000023660023 --no-splash 
--chdir=/home/zl --daemon
xx        4074  2687  0 09:26 ?        00:00:25 emacs

Isn't that a lot of processes for having just four files open?




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

* Re: emacs.desktop non-functional
  2016-03-19  1:35           ` ken
@ 2016-03-19  8:14             ` Eli Zaretskii
  2016-03-20 22:35             ` Robert Thorpe
  1 sibling, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2016-03-19  8:14 UTC (permalink / raw)
  To: help-gnu-emacs

> From: ken <gebser@mousecar.com>
> Date: Fri, 18 Mar 2016 21:35:29 -0400
> 
> > I asked the questions and hoped that I will get detailed answers.
> > Like how do you invoke Emacs, in which directory, etc.  This is
> > important information that is supposed to lead to the problem.
> 
> There's an icon in the Applications menu that I click on when I have to. 
>   But "emacs" is also in that group of applications which gnome starts 
> automatically.

In what directory does Emacs start when you do any of these?

Also, if you start it by typing "emacs &" from a shell prompt, when
your current directory is the one of the .emacs.desktop file, does
Emacs restore all the buffers in that .emacs.desktop file?

> >> "Use the desktop library to save the state of Emacs from one session to
> >> another. Once you save the Emacs desktop—the buffers, their file names,
> >> major modes, buffer positions, and so on—then subsequent Emacs sessions
> >> reload the saved desktop. By default, the desktop also tries to save the
> >> frame and window configuration...."
> >>
> >> It doesn't do any of that.
> 
> Does your emacs do all of that?

Yes.

> > Please note that the manual on-line is for version 24.5, whereas you
> > have 24.3.  So not all of what is described is supposed to be working
> > in your version.  Perhaps consider upgrading to 24.5.
> 
> The functionality is the same, so it's not necessary for that sreason.

I don't understand what you are saying here.  In Emacs 24.5, frame and
window configuration is also saved and restored, which doesn't happen
in 24.3.  So the text you quote above is only accurate for the version
later than what you have.  Emacs 24.3 is not supposed to restore the
frames and windows from the last session, only the buffers.  (AFAIU,
it doesn't do even that in your case.)

> > What if you invoke desktop-read by hand -- does that restore the
> > previous session's buffers?
> 
> No.  No new buffers, just all the same ones which were already opened.
> 
> The minibuffer says "Warning: desktop file appears to be in use by PID 
> 4074.  Using it may cause conflicts.  Use it anyway?"  PID 4074 doesn't 
> exist... probably from a crashed session.

I do see PID 4074 in the list of processes you show, see the last
line:

  $ ps -ef|grep emacs
  xx        2887  2453  0 Mar17 ?        00:00:00 /usr/bin/emacs --smid=1019c4f12271782266145082947974782600000023660023 --no-splash 
  --chdir=/home/zl --daemon
  xx        2944  2453  0 Mar17 ?        00:00:00 emacsclient -c --alternate-editor=
  xx        2951  2944  0 Mar17 ?        00:00:00 emacs --daemon
  xx        3100  2951  0 Mar17 ?        00:00:00 emacs --daemon
  xx        3101  2887  0 Mar17 ?        00:00:00 /usr/bin/emacs --smid=1019c4f12271782266145082947974782600000023660023 --no-splash --chdir=/home/zl --daemon
  xx        4074  2687  0 09:26 ?        00:00:25 emacs
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

> Did some testing.  When I open a new buffer and type somethign in it but 
> before saving the buffer to a file, the buffer name is not to be found 
> in any of the emacs.desktop files.
> 
> If I then save taht buffer to a file, still nothing-- neither the buffer 
> name nor its filename-- is saved to any emacs.desktop file.
> 
> So I'm guessing then that if the system suddenly goes down at this 
> point, there will be no record in .emacs.desktop of that newly opened 
> file.  (This is actually the initial case I'm wondering about.)  Is that 
> how it works for you as well?

It does, but it isn't supposed to in Emacs 24.3.  In Emacs 24.4, a
feature was added whereby the desktop file is auto-saved every now and
then, so it will be restored after a crash.  Before that, Emacs would
only save the data when it exited, and when you manually invoked
desktop-save.

> This might be strange too:
> 
> $ ps -ef|grep emacs
> xx        2887  2453  0 Mar17 ?        00:00:00 /usr/bin/emacs 
> --smid=1019c4f12271782266145082947974782600000023660023 --no-splash 
> --chdir=/home/zl --daemon
> xx        2944  2453  0 Mar17 ?        00:00:00 emacsclient -c 
> --alternate-editor=
> xx        2951  2944  0 Mar17 ?        00:00:00 emacs --daemon
> xx        3100  2951  0 Mar17 ?        00:00:00 emacs --daemon
> xx        3101  2887  0 Mar17 ?        00:00:00 /usr/bin/emacs 
> --smid=1019c4f12271782266145082947974782600000023660023 --no-splash 
> --chdir=/home/zl --daemon
> xx        4074  2687  0 09:26 ?        00:00:25 emacs
> 
> Isn't that a lot of processes for having just four files open?

Could be part of your problem.  Are all of these run by your user?
Which one of those is "the Emacs" which you know you are running?  You
could find this out by typing

  M-: (emacs-pid) RET



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

* Re: emacs.desktop non-functional
  2016-03-19  1:35           ` ken
  2016-03-19  8:14             ` Eli Zaretskii
@ 2016-03-20 22:35             ` Robert Thorpe
  1 sibling, 0 replies; 9+ messages in thread
From: Robert Thorpe @ 2016-03-20 22:35 UTC (permalink / raw)
  To: gebser; +Cc: help-gnu-emacs

ken <gebser@mousecar.com> writes:
> The minibuffer says "Warning: desktop file appears to be in use by PID 
> 4074.  Using it may cause conflicts.  Use it anyway?"  PID 4074 doesn't 
> exist... probably from a crashed session.

Have you tried disabling Emacs --daemon and started Emacs the normal
way?  Does that help?

Have you tried renaming the old emacs.desktop files so the current Emacs
can't see them?  That could help.

BR,
Robert Thorpe



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

end of thread, other threads:[~2016-03-20 22:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-17  1:38 emacs.desktop non-functional ken
2016-03-17  3:39 ` Eli Zaretskii
2016-03-17 21:05   ` ken
2016-03-18  8:01     ` Eli Zaretskii
2016-03-18 19:21       ` ken
2016-03-18 20:20         ` Eli Zaretskii
2016-03-19  1:35           ` ken
2016-03-19  8:14             ` Eli Zaretskii
2016-03-20 22:35             ` Robert Thorpe

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.