help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Looking for some recommended configurations for desktop-save-mode an


From: Emanuel Berg
Subject: Re: Looking for some recommended configurations for desktop-save-mode and savehist-mode.
Date: Sun, 17 Jan 2021 15:29:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Tak Kunihiro wrote:

>> Currently, I noticed the following configurations for
>> desktop-save-mode and savehist-mode on this website
>
> When don't you save desktop when quit emacs?
>
> (add-hook 'kill-emacs-hook #'sesame-desktop-save)
>
> (defun sesame-desktop-save ()
>   "Save desktop anyway."
>   (interactive)
>   (require 'desktop)
>   (setq desktop-dirname user-emacs-directory)
>   (let ((file (desktop-full-file-name)))
>     (when (file-exists-p file)
>       (delete-file file)))
>   (desktop-save (expand-file-name desktop-dirname) t))

But you don't have to delete it to update it, right?

I don't use this so I might be wrong but that seems strange
one has to do manually.

In the docstring to `desktop-save' it says:

  If ONLY-IF-CHANGED is non-nil, compare the current desktop
  information to that in the desktop file, and if the desktop
  information has not changed since it was last saved, then do
  not rewrite the file.

Sounds like it, it me...

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]