From 6586ca65a26bc5e4bb446eff0a2fb314724f4e64 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Thu, 24 Nov 2022 16:47:27 +0800 Subject: desktop: silently save bookmarks * desktop-conf.el (desktop-save-hook, durand-bookmark-save): Do not display messages emitted by `bookmark-save' automatically, but log them to the *Messages* buffer. --- desktop-conf.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/desktop-conf.el b/desktop-conf.el index 7478742..6fa2ab0 100644 --- a/desktop-conf.el +++ b/desktop-conf.el @@ -40,12 +40,18 @@ ;;; Also save bookmarks before -(add-hook 'desktop-save-hook #'bookmark-save) +(defun durand-bookmark-save () + "Silently save bookmarks." + (let ((inhibit-message t)) + (cond ((featurep 'bookmark) (bookmark-save nil nil nil))))) + +(add-hook 'desktop-save-hook #'durand-bookmark-save) ;;; Overwrite the saving function ;; Modify to hard-code the directory to save the desktop file. -(defun durand-desktop-save-a (dirname &optional release only-if-changed version) +(defun durand-desktop-save-a + (dirname &optional release only-if-changed version) "Save the state of Emacs in a desktop file in directory DIRNAME. Optional argument RELEASE non-nil says we're done with this desktop, in which case this function releases the lock of the -- cgit v1.2.3-18-g5258