From e39e51d8a63e44249c342992a4badfe261265fcb Mon Sep 17 00:00:00 2001 From: Protesilaos Stavrou Date: Wed, 11 Dec 2024 13:10:35 +0200 Subject: [PATCH] emacs: make save-some-buffers show diff on demand --- emacs/.emacs.d/prot-emacs.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/emacs/.emacs.d/prot-emacs.org b/emacs/.emacs.d/prot-emacs.org index 381e5ea2..cc9bdb67 100644 --- a/emacs/.emacs.d/prot-emacs.org +++ b/emacs/.emacs.d/prot-emacs.org @@ -2356,6 +2356,11 @@ key bindings. (setq echo-keystrokes-help nil) ; Emacs 30 (setq epa-keys-select-method 'minibuffer) ; Emacs 30 + (add-to-list 'save-some-buffers-action-alist + (list "d" + (lambda (buffer) (diff-buffer-with-file (buffer-file-name buffer))) + "show diff between the buffer and its file")) + ;; Keys I unbind here are either to avoid accidents or to bind them ;; elsewhere later in the configuration. :bind