all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Saving Emacs Sessions
@ 2005-11-27 12:20 sednivo (sent by Nabble.com)
  2005-11-27 19:16 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: sednivo (sent by Nabble.com) @ 2005-11-27 12:20 UTC (permalink / raw)



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


How I can save emacs session by name and load it by name when I need?
--
Sent from the Emacs - Help forum at Nabble.com:
http://www.nabble.com/Saving-Emacs-Sessions-t625829.html#a1667692

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

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

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

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

* Re: Saving Emacs Sessions
       [not found] <mailman.16916.1133094047.20277.help-gnu-emacs@gnu.org>
@ 2005-11-27 18:54 ` Stefan Reichör
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Reichör @ 2005-11-27 18:54 UTC (permalink / raw)


Hi sednivo!

> How I can save emacs session by name and load it by name when I need?

Look at the desktop package.
I use emacs from CVS and there are the functions
M-x desktop-save
M-x desktop-read

That functions allow to save the list of open files in a directory.

Stefan.

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

* Re: Saving Emacs Sessions
  2005-11-27 12:20 sednivo (sent by Nabble.com)
@ 2005-11-27 19:16 ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2005-11-27 19:16 UTC (permalink / raw)


> Date: Sun, 27 Nov 2005 04:20:34 -0800 (PST)
> From: "sednivo (sent by Nabble.com)" <lists@nabble.com>
> Cc: 
> 
> How I can save emacs session by name and load it by name when I need?

You can't, AFAIK.  A close approximation would be to save different
sessions in different directories.  Then, whenever you start Emacs
from a directory with a saved session, Emacs will restore the session
recorded in that directory.

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

* Saving Emacs sessions
@ 2023-02-26 23:48 Petteri Hintsanen
  2023-02-27 11:33 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Petteri Hintsanen @ 2023-02-26 23:48 UTC (permalink / raw)
  To: emacs-devel

Hello Emacs devs,

I try to set up per-directory sessions, that is, save separate
.emacs.desktop files to certain directories.

Last time I used these was many years ago, around Emacs 21 or so.  Back
then, if I recall correctly, it was enough to do M-x desktop-save RET
and Emacs would ask for the directory where to save the desktop.  And by
setting (desktop-save-mode 1) in the init file, Emacs would restore the
desktop in the startup directory, should one exist.

With Emacs 28 I assumed the behavior would be the same.  Also the manual
suggests this (chapter 44):

  "If you turn on ‘desktop-save-mode’ in your init file, then when Emacs
   starts, it looks for a saved desktop in the current directory.  (More
   precisely, it looks in the directories specified by ‘desktop-path’,
   and uses the first desktop it finds.)  Thus, you can have separate
   saved desktops in different directories, and the starting directory
   determines which one Emacs reloads."

But with the default configuration, .emacs.desktop is saved into
~/.emacs.d/, and Emacs does not look for a saved desktop in the current
directory at startup.

The reason seems to be that the default value for desktop-path is
("~/.emacs.d/" "~").  It used to have ".", but that was removed in
commit e76f0800d2.

Was there a specific reason for omitting "."?  If yes, I would suggest
to clarify the manual so that it does talk about "current" or "starting
directory" at all.



[After writing this I found out that the manual has been changed in the
current git master.  But I think the issue still persists, see e.g.
misc.texi:2746.]



Thanks,
Petteri




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

* Re: Saving Emacs sessions
  2023-02-26 23:48 Saving Emacs sessions Petteri Hintsanen
@ 2023-02-27 11:33 ` Eli Zaretskii
  2023-02-27 19:47   ` Petteri Hintsanen
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2023-02-27 11:33 UTC (permalink / raw)
  To: Petteri Hintsanen; +Cc: emacs-devel

> From: Petteri Hintsanen <petterih@iki.fi>
> Date: Mon, 27 Feb 2023 01:48:55 +0200
> 
> Last time I used these was many years ago, around Emacs 21 or so.  Back
> then, if I recall correctly, it was enough to do M-x desktop-save RET
> and Emacs would ask for the directory where to save the desktop.  And by
> setting (desktop-save-mode 1) in the init file, Emacs would restore the
> desktop in the startup directory, should one exist.
> 
> With Emacs 28 I assumed the behavior would be the same.  Also the manual
> suggests this (chapter 44):
> 
>   "If you turn on ‘desktop-save-mode’ in your init file, then when Emacs
>    starts, it looks for a saved desktop in the current directory.  (More
>    precisely, it looks in the directories specified by ‘desktop-path’,
>    and uses the first desktop it finds.)  Thus, you can have separate
>    saved desktops in different directories, and the starting directory
>    determines which one Emacs reloads."
> 
> But with the default configuration, .emacs.desktop is saved into
> ~/.emacs.d/, and Emacs does not look for a saved desktop in the current
> directory at startup.

"M-x desktop-save" still asks in which directory to save the desktop,
so you can still have that feature.

> The reason seems to be that the default value for desktop-path is
> ("~/.emacs.d/" "~").  It used to have ".", but that was removed in
> commit e76f0800d2.
> 
> Was there a specific reason for omitting "."?

Yes, see bug#10977.

I have desktop-path customized since long ago to start with ".", as I
use this feature a lot.  Suggest that you do the same.

> [After writing this I found out that the manual has been changed in the
> current git master.  But I think the issue still persists, see e.g.
> misc.texi:2746.]

Fixed, thanks.



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

* Re: Saving Emacs sessions
  2023-02-27 11:33 ` Eli Zaretskii
@ 2023-02-27 19:47   ` Petteri Hintsanen
  0 siblings, 0 replies; 6+ messages in thread
From: Petteri Hintsanen @ 2023-02-27 19:47 UTC (permalink / raw)
  To: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> Was there a specific reason for omitting "."?
>
> Yes, see bug#10977.

Ok, I see.  I was wondering if it had more serious implications like
security (cf. having "." in $PATH).

> I have desktop-path customized since long ago to start with ".", as I
> use this feature a lot.  Suggest that you do the same.

Yes I did this already.  Now it works as before.

Thanks for clarification,
Petteri




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

end of thread, other threads:[~2023-02-27 19:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-26 23:48 Saving Emacs sessions Petteri Hintsanen
2023-02-27 11:33 ` Eli Zaretskii
2023-02-27 19:47   ` Petteri Hintsanen
     [not found] <mailman.16916.1133094047.20277.help-gnu-emacs@gnu.org>
2005-11-27 18:54 ` Saving Emacs Sessions Stefan Reichör
  -- strict thread matches above, loose matches on Subject: below --
2005-11-27 12:20 sednivo (sent by Nabble.com)
2005-11-27 19:16 ` Eli Zaretskii

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.