all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* desktop-save problems
@ 2016-06-14 22:40 ken
  2016-06-15 15:08 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: ken @ 2016-06-14 22:40 UTC (permalink / raw
  To: GNU Emacs List

Hi, all,

Still there are problems with saving sessions.

First, I can save a listing (sort of*) by running "desktop-save" and 
then follow the prompt to select a directory.  I always select 
~/.emacs.d/ on the local machine.  Is there some way I can configure 
desktop-save to always save to this same directory-- and on the local 
machine-- and not prompt me each time?  If there is no configuration for 
this, is it relatively easy to edit the code to accomplish this?

Second, is there a way for "desktop-save" to be run programmatically 
whenever I open a new file/buffer or kill a buffer?  That is, opening a 
new buffer would automatically add that buffer to the session file (for 
me, that's .emacs.desktop), killing a buffer would remove it from the 
session file.

*Third, when I use tramp to open a buffer from a remote machine and then 
do "desktop-save" etc., that buffer name is written into the session 
file after "(setq file-name-history" but not under ";; Buffer section"; 
that is, it isn't given a "(desktop-create-buffer" section in the 
session file.  Consequently, when I next time start emacs, none of the 
buffers opened with tramp previous session are opened.


Many years ago emacs did all the above just fine.  Anyone know what 
happened?  Just curious.

Thanks for any help.





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

* Re: desktop-save problems
  2016-06-14 22:40 desktop-save problems ken
@ 2016-06-15 15:08 ` Eli Zaretskii
  2016-07-13 19:49   ` ken
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-06-15 15:08 UTC (permalink / raw
  To: help-gnu-emacs

> From: ken <gebser@mousecar.com>
> Date: Tue, 14 Jun 2016 18:40:58 -0400
> 
> First, I can save a listing (sort of*) by running "desktop-save" and 
> then follow the prompt to select a directory.  I always select 
> ~/.emacs.d/ on the local machine.  Is there some way I can configure 
> desktop-save to always save to this same directory-- and on the local 
> machine-- and not prompt me each time?  If there is no configuration for 
> this, is it relatively easy to edit the code to accomplish this?

The way I do it is turn on desktop-save-mode, then Emacs will save the
desktop when I exit automatically.

> Second, is there a way for "desktop-save" to be run programmatically 
> whenever I open a new file/buffer or kill a buffer?

In a new enough version of Emacs, the desktop is periodically saved
even when no buffer is killed.

> *Third, when I use tramp to open a buffer from a remote machine and then 
> do "desktop-save" etc., that buffer name is written into the session 
> file after "(setq file-name-history" but not under ";; Buffer section"; 
> that is, it isn't given a "(desktop-create-buffer" section in the 
> session file.  Consequently, when I next time start emacs, none of the 
> buffers opened with tramp previous session are opened.

Please report this as a bug with a recipe starting from "emacs -Q",
and all the relevant details.

Thanks.



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

* Re: desktop-save problems
  2016-06-15 15:08 ` Eli Zaretskii
@ 2016-07-13 19:49   ` ken
  2016-07-13 20:02     ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: ken @ 2016-07-13 19:49 UTC (permalink / raw
  To: Eli Zaretskii, GNU Emacs List

On 06/15/2016 11:08 AM, Eli Zaretskii wrote:
>> From: ken <gebser@mousecar.com>
>> Date: Tue, 14 Jun 2016 18:40:58 -0400
>>
>> First, I can save a listing (sort of*) by running "desktop-save" and
>> then follow the prompt to select a directory.  I always select
>> ~/.emacs.d/ on the local machine.  Is there some way I can configure
>> desktop-save to always save to this same directory-- and on the local
>> machine-- and not prompt me each time?  If there is no configuration for
>> this, is it relatively easy to edit the code to accomplish this?
> The way I do it is turn on desktop-save-mode, then Emacs will save the
> desktop when I exit automatically.

This means that the desktop isn't saved when the system crashes, e.g., 
the power suddenly goes out, yes?

Also, in my emacs (24.3.1) I'm always prompted for the directory to save 
the desktop in.  Is there a way to specify one directory where the 
desktop is saved so I don't have this prompt come up?


>> Second, is there a way for "desktop-save" to be run programmatically
>> whenever I open a new file/buffer or kill a buffer?
> In a new enough version of Emacs, the desktop is periodically saved
> even when no buffer is killed.

Which version is "new enough"?

Also, wouldn't it make more sense for desktop-save to work when file or 
buffer is opened or closed?

>> *Third, when I use tramp to open a buffer from a remote machine and then
>> do "desktop-save" etc., that buffer name is written into the session
>> file after "(setq file-name-history" but not under ";; Buffer section";
>> that is, it isn't given a "(desktop-create-buffer" section in the
>> session file.  Consequently, when I next time start emacs, none of the
>> buffers opened with tramp previous session are opened.
> Please report this as a bug with a recipe starting from "emacs -Q",
> and all the relevant details.

Did this.

  Thanks.





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

* Re: desktop-save problems
  2016-07-13 19:49   ` ken
@ 2016-07-13 20:02     ` Eli Zaretskii
  2016-07-13 22:24       ` ken
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-07-13 20:02 UTC (permalink / raw
  To: help-gnu-emacs

> From: ken <gebser@mousecar.com>
> Date: Wed, 13 Jul 2016 15:49:24 -0400
> 
> > The way I do it is turn on desktop-save-mode, then Emacs will save the
> > desktop when I exit automatically.
> 
> This means that the desktop isn't saved when the system crashes, e.g., 
> the power suddenly goes out, yes?

If this is frequent enough, you can save manually at strategic times.

> Also, in my emacs (24.3.1) I'm always prompted for the directory to save 
> the desktop in.  Is there a way to specify one directory where the 
> desktop is saved so I don't have this prompt come up?

It doesn't prompt me, it uses the ~/.emacs.d/ directory by default;
the directory from which the desktop was read overrides that.  I'm
never asked any such questions.  Something is wrong with your setup.

> >> Second, is there a way for "desktop-save" to be run programmatically
> >> whenever I open a new file/buffer or kill a buffer?
> > In a new enough version of Emacs, the desktop is periodically saved
> > even when no buffer is killed.
> 
> Which version is "new enough"?

24.4 and later.

> Also, wouldn't it make more sense for desktop-save to work when file or 
> buffer is opened or closed?

Since we now save periodically, we don't need to resolve this dilemma.

> >> *Third, when I use tramp to open a buffer from a remote machine and then
> >> do "desktop-save" etc., that buffer name is written into the session
> >> file after "(setq file-name-history" but not under ";; Buffer section";
> >> that is, it isn't given a "(desktop-create-buffer" section in the
> >> session file.  Consequently, when I next time start emacs, none of the
> >> buffers opened with tramp previous session are opened.
> > Please report this as a bug with a recipe starting from "emacs -Q",
> > and all the relevant details.
> 
> Did this.

Thanks.



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

* Re: desktop-save problems
  2016-07-13 20:02     ` Eli Zaretskii
@ 2016-07-13 22:24       ` ken
  2016-07-14  2:38         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: ken @ 2016-07-13 22:24 UTC (permalink / raw
  To: Eli Zaretskii, help-gnu-emacs

On 07/13/2016 04:02 PM, Eli Zaretskii wrote:
>> From: ken <gebser@mousecar.com>
>> Date: Wed, 13 Jul 2016 15:49:24 -0400
>>
>>> The way I do it is turn on desktop-save-mode, then Emacs will save the
>>> desktop when I exit automatically.
>> This means that the desktop isn't saved when the system crashes, e.g.,
>> the power suddenly goes out, yes?
> If this is frequent enough, you can save manually at strategic times.

Years ago desktop-save and desktop-read both worked properly out of the 
box... didn'tl even have to invoke anything.  It just kept track of what 
files/buffers were open and opened them again in the next session, 
whether the previous session was graceful or a crash... files opened via 
tramp too.  How/Why did things get messed up?


>> Also, in my emacs (24.3.1) I'm always prompted for the directory to save
>> the desktop in.  Is there a way to specify one directory where the
>> desktop is saved so I don't have this prompt come up?
> It doesn't prompt me, it uses the ~/.emacs.d/ directory by default;
> the directory from which the desktop was read overrides that.  I'm
> never asked any such questions.  Something is wrong with your setup.

This is how it works when I start emacs with "emacs -Q".


>>>> Second, is there a way for "desktop-save" to be run programmatically
>>>> whenever I open a new file/buffer or kill a buffer?
>>> In a new enough version of Emacs, the desktop is periodically saved
>>> even when no buffer is killed.
>> Which version is "new enough"?
> 24.4 and later.
>
>> Also, wouldn't it make more sense for desktop-save to work when file or
>> buffer is opened or closed?
> Since we now save periodically, we don't need to resolve this dilemma.

Just curious... how often is the desktop saved in your version?


> ....

Thanks for your help.




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

* Re: desktop-save problems
  2016-07-13 22:24       ` ken
@ 2016-07-14  2:38         ` Eli Zaretskii
  2016-07-14 11:30           ` ken
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2016-07-14  2:38 UTC (permalink / raw
  To: help-gnu-emacs

> From: ken <gebser@mousecar.com>
> Date: Wed, 13 Jul 2016 18:24:28 -0400
> 
> On 07/13/2016 04:02 PM, Eli Zaretskii wrote:
> >> From: ken <gebser@mousecar.com>
> >> Date: Wed, 13 Jul 2016 15:49:24 -0400
> >>
> >>> The way I do it is turn on desktop-save-mode, then Emacs will save the
> >>> desktop when I exit automatically.
> >> This means that the desktop isn't saved when the system crashes, e.g.,
> >> the power suddenly goes out, yes?
> > If this is frequent enough, you can save manually at strategic times.
> 
> Years ago desktop-save and desktop-read both worked properly out of the 
> box... didn'tl even have to invoke anything.  It just kept track of what 
> files/buffers were open and opened them again in the next session, 
> whether the previous session was graceful or a crash... files opened via 
> tramp too.  How/Why did things get messed up?

It didn't.  It still works the same for me, except now it also saves
and restores frame and window configuration.

> >> Also, in my emacs (24.3.1) I'm always prompted for the directory to save
> >> the desktop in.  Is there a way to specify one directory where the
> >> desktop is saved so I don't have this prompt come up?
> > It doesn't prompt me, it uses the ~/.emacs.d/ directory by default;
> > the directory from which the desktop was read overrides that.  I'm
> > never asked any such questions.  Something is wrong with your setup.
> 
> This is how it works when I start emacs with "emacs -Q".

Then I suggest to look into your customizations for something that
defeats that.

> > Since we now save periodically, we don't need to resolve this dilemma.
> 
> Just curious... how often is the desktop saved in your version?

Every 30 sec by default (I disabled this auto-saving for my own
reasons).



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

* Re: desktop-save problems
  2016-07-14  2:38         ` Eli Zaretskii
@ 2016-07-14 11:30           ` ken
  0 siblings, 0 replies; 7+ messages in thread
From: ken @ 2016-07-14 11:30 UTC (permalink / raw
  To: Eli Zaretskii, help-gnu-emacs

On 07/13/2016 10:38 PM, Eli Zaretskii wrote:
>> From: ken <gebser@mousecar.com>
>> Date: Wed, 13 Jul 2016 18:24:28 -0400
>>
>> On 07/13/2016 04:02 PM, Eli Zaretskii wrote:
>>>> From: ken <gebser@mousecar.com>
>>>> Date: Wed, 13 Jul 2016 15:49:24 -0400
>>>>
>>>>> The way I do it is turn on desktop-save-mode, then Emacs will save the
>>>>> desktop when I exit automatically.
>>>> This means that the desktop isn't saved when the system crashes, e.g.,
>>>> the power suddenly goes out, yes?
>>> If this is frequent enough, you can save manually at strategic times.
>> Years ago desktop-save and desktop-read both worked properly out of the
>> box... didn'tl even have to invoke anything.  It just kept track of what
>> files/buffers were open and opened them again in the next session,
>> whether the previous session was graceful or a crash... files opened via
>> tramp too.  How/Why did things get messed up?
> It didn't.  It still works the same for me, except now it also saves
> and restores frame and window configuration.

Actually it did, at least for me.  I used it all the time, both at home 
and at work.  I remember working with the tramp maintainer guy so emacs 
would work over a proxy server and even files edited via proxy were 
saved to the desktop.  Very cool stuff.  I almost got our entire 
department at work to switch the standard editor (what we were all 
forced to use) from vi to emacs.  But there was too much intransigence.

I've never gotten frame and window configuration to be saved between 
sessions though.  Word was, there wasn't enough support for it in the 
window manager.  So if that's working in a future version, that would be 
excellent.  Which emacs version does that happen, if you happen to know?


>>>> Also, in my emacs (24.3.1) I'm always prompted for the directory to save
>>>> the desktop in.  Is there a way to specify one directory where the
>>>> desktop is saved so I don't have this prompt come up?
>>> It doesn't prompt me, it uses the ~/.emacs.d/ directory by default;
>>> the directory from which the desktop was read overrides that.  I'm
>>> never asked any such questions.  Something is wrong with your setup.
>> This is how it works when I start emacs with "emacs -Q".
> Then I suggest to look into your customizations for something that
> defeats that.

All desktop customizations are set to Standard (unchanged) except these:

  Desktop Files Not To Save - None
  Desktop Save - Always save
  Desktop Save Mode - On

Is there something which needs to be changed from Standard to avoid that 
prompt?

> ....




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

end of thread, other threads:[~2016-07-14 11:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-14 22:40 desktop-save problems ken
2016-06-15 15:08 ` Eli Zaretskii
2016-07-13 19:49   ` ken
2016-07-13 20:02     ` Eli Zaretskii
2016-07-13 22:24       ` ken
2016-07-14  2:38         ` Eli Zaretskii
2016-07-14 11:30           ` ken

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.