Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [desktop]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
16 views

desktop-save-mode does not restore org-agenda buffers when running Emacs as daemon

I run Emacs as daemon and have the following to save/restore my buffers/frames. It works fine (need to save-buffers-kill-emacs instead of C-x C-c to get the buffers to be saved then buffers are ...
David Shields's user avatar
2 votes
1 answer
92 views

Is desktop restore expected to override --no-window-system?

When I run emacs -nw (--no-window-system) emacs (v29.1 on macOS v13.6.1) initially begins running in the terminal window, with the terminal clearing and the modeline appearing at the bottom. Quite ...
cpcallen's user avatar
  • 213
0 votes
0 answers
38 views

desktop-save mode prevents Emacs from refreshing

I'm using Emacs 29.1 on Windows. I've found desktop-save is problematic. My configuration is: (use-package desktop :init (setq desktop-dirname "~/.emacs.d/desktop/" ...
Lai Yu-Hsuan's user avatar
0 votes
0 answers
47 views

using desktop.el in --daemon mode

I eventually figured out that the answer to this question https://groups.google.com/g/gnu.emacs.help/c/WZoW0LlqX6c/m/08Sa6alHp1oJ was to choose --bg-daemon rather than --fg-daemon when starting the ...
StackExchanger's user avatar
0 votes
1 answer
98 views

Setting (desktop-save-mode t) in init file calls (desktop-read) immediately when starting Emacs in daemon mode. How to avoid?

Previously, I used GUI Emacs, everything worked perfectly - the desktop was saved and restored as it should be. I decided to try Emacs in daemon mode. First I made changes to the init.el file: (custom-...
Herman's user avatar
  • 57
0 votes
0 answers
97 views

desktop+ not saving term/shell buffer

For session management, I was happy with inbuilt desktop.el except that it could not retain the term/shell buffers. Everytime I quit emacs, it asked to kill the term/shells. Then I read the ability of ...
user_0525's user avatar
0 votes
2 answers
57 views

The (desktop-save-mode 1) thingy interferes with the (tool-bar-mode -1) thingy

Here is a simple Emacs config file: (menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) (desktop-save-mode 1) The toolbar should not appear, right? From some reason, it does. But if I ...
Refael Sheinker's user avatar
0 votes
1 answer
37 views

What is the purpose of storing timestamps in the .emacs.desktop file?

With activated option Save State between Sessions from Emacs Menu -> Options Emacs saves its configuration in an .emacs.desktop file. Below comparison of the differences of the original file ...
Claudio's user avatar
  • 475
1 vote
1 answer
151 views

Bug in Emacs 29.0.60 or is there a way to prevent moving the Emacs position on restart?

Emacs allows to store the state of its GUI in a .desktop file which on next start of Emacs restores its last state. It should preserve its size, position and arrangement of the tabs and windows (it ...
Claudio's user avatar
  • 475
0 votes
1 answer
79 views

When desktop save mode set, emacs reverts to old custom themes

I was playing around a bit with custom themes. I found that using them would mess with my other settings and decided I wanted to revert to the standard emacs theme. I disabled the themes in question ...
tony's user avatar
  • 3
0 votes
1 answer
84 views

Why does eval-buffer on init.el kill a buffer?

I tried running M-x eval-buffer to reload my init.el, which looks like this (point was at top, most irrelevant commented-out sections trimmed): (global-set-key (kbd "C-c l") #'org-store-link)...
Nathan Tuggy's user avatar
0 votes
0 answers
210 views

How to prevent `desktop-save-mode` from opening multiple windows?

I want to restart Emacs at the same cursor position in the file (or buffer) I was just working on. In my Emacs config I have the following code to try and do this: (use-package desktop :straight ...
user4687531's user avatar
0 votes
1 answer
47 views

Why org-mode related settings aren't applied on desktop.el restored .org files?

When my emacs start, previously visited buffers/files are restored with desktop.el. So far so good. But my settings related to org-mode files are somehow not applied. If I open a new org file or if I ...
learner's user avatar
  • 121
0 votes
0 answers
72 views

Using `desktop-read` to reload frames -- closing one frame closes all frames

A very annoying issue with desktop-save and desktop-read that I'm encountering at the moment: I'm starting Emacs in daemon-mode, and then open a client frame. I do desktop-read and my saved desktop ...
nonreligious's user avatar
0 votes
1 answer
90 views

Does "desktop-save-mode" work for multiple monitors?

Linux Mint 20.2 Emacs 27.1 On my desktop computer pluggin 3 monitors. So I want to open 3 frames on every monitor. So my steps: - (desktop-save-mode 1) - restart Emacs - Open frame on DP-2 - make-...
a_subscriber's user avatar
  • 4,124
6 votes
2 answers
802 views

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-...
Jouni K. Seppänen's user avatar
1 vote
1 answer
440 views

Closing emacs results in "Current desktop was not loaded from a file" even though desktop-save-mode was set before start

I have set the following things in my .el file (not init.el): (setq desktop-dirname "~/.emacs.d/desktop/" desktop-base-file-name "emacs.desktop" desktop-base-lock-...
topkek's user avatar
  • 89
0 votes
1 answer
103 views

save emacs desktop regarding tmux session

I use emacs in different tmux sessions. Each time I run new emacs instance it says: Warning: desktop file appears to be in use by PID <pid>. ...
denys's user avatar
  • 315
3 votes
0 answers
182 views

Can desktop sessions be used to save and restore shell buffers?

Is it possible to use desktop-save-mode to save and partially restore my shell buffers? I realize shell buffers have quite a bit of state that isn't under the direct control of emacs, so specifically ...
Nicholas Bishop's user avatar
1 vote
0 answers
62 views

saving cloned buffers in workspaces/desktops/perspectives etc

i would like to be able to save a window (in emacs terms) layout with cloned buffers. i don't need it to save a series of buffers, i just need to be able to load a complex window layout when i work on ...
martian's user avatar
  • 548
1 vote
1 answer
37 views

How can I display desktop-dirname in the modeline (or elsewhere)?

I often get confused about the current desktop I'm using. Currently, I have to call (display-variable desktop-dirname) to see in which desktop I'm working. It would be much nicer, if the current ...
Markus Grunwald's user avatar
3 votes
1 answer
568 views

How to save and restore the association of a window to buffer across Emacs sessions?

I have a window layout with three windows and I would like Emacs to remember the buffers even if the buffers don't exist after restart. Context: I am using Spacemacs for Clojure development. In ...
Witek's user avatar
  • 355
1 vote
1 answer
328 views

Make Emacs systemd service kill when logging out/shutting down

I am trying to use desktop-save-mode together with emacs daemon. ;; save desktop before quitting (add-hook 'kill-emacs-hook (lambda () (desktop-save "~/.emacs.d/"))) But when I log out of the ...
Daanturo's user avatar
  • 180
1 vote
0 answers
53 views

X Session Desktop integration

When I run Emacs under an X11 session manager, it provides a RestartCommand="emacs25 --smid=ef85455de14b4e6a8a8c39dae106b554 --chdir=/some/dir". I would like it to open the same files as last time, ...
Egil Möller's user avatar
0 votes
2 answers
202 views

Segmentation Fault with Desktop Save Mode (emacs 26.3.50)

When I try to run emacs 26.3.50 (built from source), it gives me the following warning: "Warning: desktop file appears to be in use by PID .... Using it may cause conflicts. Use it anyway? (y or n)". ...
dwarvenharem's user avatar
5 votes
1 answer
374 views

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 ...
Mikael Springer's user avatar
1 vote
0 answers
162 views

Save my Emacs registry entries without having to use desktop-save

I frequently create registry entries which I wish to keep across Sessions. Emacs does not save registry entries across sessions. This can be done by using desktop-save, but the downside is that ...
Edman's user avatar
  • 1,229
43 votes
4 answers
10k views

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 ...
user avatar
1 vote
1 answer
354 views

Help? - Freeze up to 10 seconds happening on windows when exiting (kill-emacs) when desktop-save-mode and back-button-mode are enabled

I've spent a full working day trying to somehow resolve this, no luck, so I'm turning to this place hoping for help. Recently I started experiencing freeze of something like up to 10 seconds when ...
Lauris's user avatar
  • 111
1 vote
1 answer
159 views

window-configuration-change-hook false positives from desktop-mode

I'm trying to use window-configuration-change-hook in a package to perform some action when a buffer becomes visible for the first time. It works, however when starting Emacs, desktop-mode calls ...
Muir's user avatar
  • 321
1 vote
0 answers
151 views

Reading frame configuration from file

I'm just trying my hands on emacs lisp. So far I've had some luck, but I'm stuck trying to load my frames configuration into a list. Here's what I'm trying to do... I am saving frames configuration (...
Wilson Almeida's user avatar
1 vote
1 answer
63 views

Why does a certain file always gets opened on startup?

I'm using desktop-save-mode to automatically open the files that I had opened in the last session. This mode should also remember the files that I closed so that it no longer opens them in the next ...
Ricardo's user avatar
  • 131
2 votes
1 answer
263 views

desktop-save-mode: prevent emacs from showing each buffer on start-up

If you use desktop-save-mode, and have several hundred buffers saved, when you start emacs, emacs cycles through these buffers and shows each of them for a split second. Can this be prevented?
Marius Hofert's user avatar
1 vote
1 answer
87 views

How can I save the text-scale info when `desktop-save-in-desktop-dir`?

By default, even if I text-scale-decrease in some frames before I desktop-save-in-desktop-dir, when I restart Emacs and desktop-read, all frames show in the default text-scale. How can I save the ...
stacko's user avatar
  • 1,597
2 votes
0 answers
53 views

Restoring windows with Desktop when running Emacs inside a terminal? [duplicate]

Maybe a silly question: I'm using desktop for saving Emacs' sessions. I've set (setq desktop-restore-frames t) (desktop-save-mode 0) So windows and frames state is supposed to be saved, and I'm ...
amitr's user avatar
  • 121
1 vote
3 answers
1k views

How to prompt to ask for confirmation when C-x C-c in emacsclient?

I use (setq desktop-save 'ask) in my init.el, so every time I C-x C-c to exit Emacs, it will prompt to ask if saving desktop or not; I use this trick to avoid accidentally exiting Emacs. But after ...
CodyChan's user avatar
  • 2,649
1 vote
1 answer
191 views

Limit number of files saved by emacs in desktop-save

I tend not to delete buffers in emacs, so over time, the number of buffers tends to grow to a hundred or more. (At the moment, *Buffer List* has 144 lines.) Many of these files are java files, and ...
Troy Daniels's user avatar
1 vote
0 answers
36 views

Possible to save winner history winner-ring-alist in savehist or desktop-save to save across sessions

I added in the following command to my .emacs but it doesn't seem to work: (add-to-list 'savehist-additional-variables 'winner-ring-alist) Is there a way to get the winner-undo history to save ...
J Spen's user avatar
  • 171
1 vote
1 answer
207 views

Open another emacs and cause conflicts

I have a GUI emacs running as the major working area, When I reading articles from web, need to open a emacs as a tool to keep note; Web on the left and new emacs on the right, Usually, get ...
Alice's user avatar
  • 219
2 votes
0 answers
40 views

How to get desktop-read to ignore/modify frame size?

I'm using (desktop-save-mode 1) to save a session which I then reload, but logging in remotely from a different machine with a different resolution display. Something stored in the desktop winds up ...
Norman Ramsey's user avatar
0 votes
3 answers
1k views

Project management in projectile or other, like Sublime Text's projects

Ever since I first started using Emacs (Spacemacs) a few months ago I've been trying to set up a sane multi-project workflow. I got the single project workflow going by having Emacs start up into what ...
Voodoopants's user avatar
8 votes
4 answers
8k views

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 ...
deshmukh's user avatar
  • 1,912
2 votes
3 answers
89 views

Why do desktops depend on folders?

I think, it'd make a lot more sense to have desktops be identified by names (like bookmarks). If it's deemed desirable that they can be stored in different locations, it'd make sense to select what ...
UTF-8's user avatar
  • 915
1 vote
0 answers
60 views

desktop-save doesn't save file names with emoji properly

desktop-save-in-desktop-dir doesn't save file names that include glyphs from upper unicode range like emoji characters properly. By "upper", I mean "greater" like one with a code point 1F604 instead ...
stacko's user avatar
  • 1,597
4 votes
1 answer
607 views

Restoring Emacs desktops with daemon + clients

How to use Emacs desktop functionality with emacs daemon + emacsclient instances? I've enabled (desktop-save-mode 1) in my init file, and when I start the daemon I see messages like this: Desktop: 1 ...
Galder Zamarreño's user avatar
2 votes
0 answers
177 views

reopening emacsclient -t with desktop-save-mode doesn't save buffers/frames in place [duplicate]

I added (desktop-save-mode 1) to my custom.el towards the end to save buffers and frames. But I primarily use emacs --daemon and start an emacsclient -t. For some reason, if I use just Emacs the ...
jkhdf's user avatar
  • 21
1 vote
1 answer
85 views

What is missing to show the desktop-dirname in the frame title? [duplicate]

I tried to get the value of desktop-dirname into the title of a frame: (setq frame-title-format '("%b Desktop: " (car (last (split-string desktop-dirname "/" t))))) The (...
Markus's user avatar
  • 481
16 votes
3 answers
833 views

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 ...
Trey's user avatar
  • 905
0 votes
2 answers
606 views

change the default directory that's suggested in desktop-save command

When you run M-x desktop-save, you're prompted with the message and the default option: Directory to save desktop file in: "~/.emacs.d" How can I change this default path to something else like "~/....
stacko's user avatar
  • 1,597
7 votes
3 answers
3k views

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 ...
Håkon Hægland's user avatar