Questions tagged [desktop]

For questions related to saving and restoring Emacs session data with `desktop-save-mode` and related functions.

desktop.el is an Emacs library that provides tools for managing your Emacs session, so that the state it is in when you close Emacs is restored the next time you start it.

This includes:

  • some global variables
  • the list of buffers with associated files. For each buffer also
    • the major mode
    • the default directory
    • the point
    • the mark & mark-active
    • buffer-read-only
    • some local variables
    • frame and window configuration

This is documented in the Emacs manual, "Saving Emacs Sessions"

72 questions
43
votes
4 answers

Why can't I list the contents of Desktop on macos using dired?

When I do C-x C-f on ~/Desktop/ in macos Catalina, I get the following error. Listing directory failed but 'access-file' worked I can list the directory for just ~. I'm new to Emacs and know little else. I've tried installing Emacs through Homebrew…
user25536
16
votes
3 answers

Daemon mode: Defer interactive prompts on startup?

(Note that, title to the contrary, this question is not the same as How to start in daemon mode and suppress interactive dialogs?, as that question was "answered" by the submitter eliminating what was causing a particular prompt to appear.) I'd like…
Trey
  • 865
  • 5
  • 20
12
votes
1 answer

Remembering history between sessions in Inferior Emacs Lisp Mode

I can't make Emacs remember the history for *ielm* buffers between sessions. As far as I can tell, such history is recorded in the buffer-local variable comint-input-ring. Therefore I have added the following expression to my init file: (setq…
Eleno
  • 1,428
  • 11
  • 17
12
votes
2 answers

Using DeskTop for basic project management

I would like to use DeskTop for basic project management, i.e. opening a set of buffers and restore histories depending on the project I am working on. Is this possible, i.e. having one desktop file in a project directory and how can I achieve this?
Rainer
  • 897
  • 10
  • 16
11
votes
2 answers

Using desktop-mode with Emacs Daemon

I am using emacs 24.3 (ubuntu 14.10) and would like the daemon to participate in the graphical desktop session lifecycle while using desktop-mode. I went through http://www.emacswiki.org/emacs/EmacsAsDaemon but it still does not play nice for me.…
Andreas Steffan
  • 223
  • 1
  • 5
11
votes
1 answer

Emacs desktop-save-mode - only save desktop when previous desktop was fully restored

I have the following in my .emacs: (desktop-save-mode 1) (setq desktop-restore-eager 10) (setq desktop-save t) Often I have a lot of buffers open (100 or so), then this really helps - as emacs is loading buffers only when not beeing busy with…
Christian Herenz
  • 365
  • 2
  • 14
8
votes
4 answers

Speed up Emacs start-up time

I have seen this thread but my problem is an order of magnitude larger. Also, a newbie, I did not understand much of what was being discussed there. So, this new question. I am running Emacs 25.2.2 on Kubuntu 17.10 on a low-range laptop computer…
deshmukh
  • 1,852
  • 13
  • 29
8
votes
1 answer

desktop-save-mode fails to save window layout

I use Emacs 24.5.1 on OS X in terminal mode. I intend to use desktop-save-mode to save and restore window layout (i.e. positions of buffer windows) upon exiting and starting Emacs. From this answer and its comments, people suggest that recent…
skyork
  • 211
  • 2
  • 5
7
votes
3 answers

Handle stale desktop lock files after emacs/system crash

If Emacs or the system crashes when desktop-save-mode is active, Emacs leaves a stale desktop lock file. The next time the desktop is loaded (from another Emacs process ID), loading is interrupted with a question: Warning: desktop file appears to…
Håkon Hægland
  • 3,608
  • 1
  • 20
  • 51
6
votes
1 answer

How can one restore buffers on startup in correct order?

I use desktop-save-mode in order to restore buffers on startup. However, the buffer which is visible immediately after startup is *scratch*, *Messages*, .bbdb, etc. I am not interested in those. Is there a way to have Emacs after a restart in the…
Torsten Bronger
  • 329
  • 2
  • 6
5
votes
1 answer

How to restore windows registers from saved desktop

I save a few different windows registers using M-x r w and then save the entire desktop with M-x desktop-save. I then restart Emacs and load the desktop using M-x desktop-read. If I do M-x r j do jump to one of the previously saved windows registers…
Mikael Springer
  • 513
  • 3
  • 13
5
votes
1 answer

Why is the `buffer-undo-list` excluded from `(buffer-local-variables)`?

I am modifying desktop.el to support restoring the buffer-undo-list, and am push-ing that list at the tail end of the function desktop-buffer-info because the buffer-undo-list is not included in the output of the function buffer-local-variables. Q: …
lawlist
  • 18,826
  • 5
  • 37
  • 118
4
votes
2 answers

How to use a fixed desktop save directory name with desktop-save-mode?

I would like to use a standard desktop save file when using Emacs as a server (with Emacsclient) and use no desktop save file (or optionally, another desktop save file) when running a regular Emacs instance (no server-start command). Is it possible…
Håkon Hægland
  • 3,608
  • 1
  • 20
  • 51
4
votes
2 answers

How to start lsp-mode connections lazily after desktop is restored?

I have configured lsp-mode as follows: (use-package lsp-mode :straight t :init (setq lsp-keymap-prefix "C-c l") :hook ((python-mode . lsp)) :commands lsp) I am also using desktop-save-mode to restore my editing state upon restart. When I…
4
votes
0 answers

Restore desktop frames for Emacs server

The version of desktop.el that comes with Emacs 24.4 allows restoring frames as well as windows and buffers. This works fine for an Emacs server (i.e., daemon) with at least one open frame. However, a newly started started Emacs server that attempts…
holocronweaver
  • 1,319
  • 10
  • 22
1
2 3 4 5