summaryrefslogtreecommitdiff
path: root/desktop-conf.el
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2023-06-18 00:16:18 +0800
committerJSDurand <mmemmew@gmail.com>2023-06-18 00:16:18 +0800
commitb8e849ed238573fc0943efdf394cb8fb55164ce8 (patch)
treeb77737f642b7ec43267d00d8bcebc65f244cad1b /desktop-conf.el
parentc0af15279da1bc2e3e7b379027fb82d89e90842c (diff)
desktop + bookmark: bind C-x r s to save desktop.
* bookmark-conf.el (ctl-x-r-map): Remove the original binding. * desktop-conf.el (durand-desktop-save-a): Do not ask questions when saving. (ctl-x-r-map): Bind 'C-x r s' to save the desktop file, as well as the bookmarks. Saving bookmarks does not run a hook, whereas saving the desktop file runs a hook, so it is easier to call `desktop-save` which also saves bookmarks than the other way around.
Diffstat (limited to 'desktop-conf.el')
-rw-r--r--desktop-conf.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/desktop-conf.el b/desktop-conf.el
index 6fa2ab0..3485b38 100644
--- a/desktop-conf.el
+++ b/desktop-conf.el
@@ -86,10 +86,7 @@ In a non-interactive call, VERSION can be given as an integer, either
206 or 208, to specify the format version in which to save the file,
no questions asked."
(interactive (list
- ;; Or should we just use (car desktop-path)?
- (let ((default (car desktop-path)))
- (read-directory-name "Directory to save desktop file in: "
- default default t))
+ (car desktop-path)
nil
nil
current-prefix-arg))
@@ -210,6 +207,15 @@ no questions asked."
(desktop-save-mode 1)
+;;; Add a binding for saving desktop files
+
+;; This was used for `copy-to-register', but we can also use `C-x r
+;; x'.
+
+;; This was used to save bookmarks, but I also save bookmarks after
+;; saving the desktop file, so I just bind it to save desktop instead.
+
+(define-key ctl-x-r-map (vector ?s) #'desktop-save)
(provide 'desktop-conf)
;;; desktop-conf.el ends here