commit 8e32fc18185b7ef0e1beb56388efe24258d36a01 parent 44b94de2df87caeca50e7a466c37f50462289d5c Author: Vincent Demeester <vincent@sbr.pm> Date: Tue, 24 Oct 2023 17:58:04 +0200 tools/emacs: add function and binding to saving and loading desktop session Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | tools/emacs/config/config-windows.el | | | 15 | +++++++++++++++ |
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/tools/emacs/config/config-windows.el b/tools/emacs/config/config-windows.el @@ -5,6 +5,21 @@ (setq switch-to-buffer-obey-display-actions t) +(defun vde/save-desktop-no-ask () + "Save the desktop without asking questions by modifying the modtime." + (interactive) + (require 'desktop) + (desktop--get-file-modtime) + (desktop-save (concat desktop-dirname))) +(defun vde/desktop-load () + "Load saved desktop" + (interactive) + (require 'desktop) + (desktop-read desktop-dirname)) + +(bind-key "C-c d s" #'vde/save-desktop-no-ask) +(bind-key "C-c d l" #'vde/desktop-load) + ;; Winner (use-package winner :unless noninteractive