From 3b0e07a3cde5f2da35b01ed3ed4be89a37042efd Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Tue, 28 Jul 2026 23:46:19 +0200 Subject: [PATCH] turn revert lambda into defun --- lisp/init-system.el | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/lisp/init-system.el b/lisp/init-system.el index bdc640c..e7d0bc9 100644 --- a/lisp/init-system.el +++ b/lisp/init-system.el @@ -79,17 +79,31 @@ ;; F5 == reload file if it has been modified by another process, shift ;; because Xmonad -(global-set-key (kbd "S-") ; re-read a buffer from disk (revert) - (lambda (&optional force-reverting) - "Interactive call to revert-buffer. Ignoring the auto-save + +(defun tvd-buffer-reload(&optional force-reverting) + "Interactive call to revert-buffer. Ignoring the auto-save file and not requesting for confirmation. When the current buffer is modified, the command refuses to revert it, unless you specify the optional argument: force-reverting to true." - (interactive "P") - ;;(message "force-reverting value is %s" force-reverting) - (if (or force-reverting (not (buffer-modified-p))) - (revert-buffer :ignore-auto :noconfirm) - (error "The buffer has been modified")))) + (interactive "P") + ;;(message "force-reverting value is %s" force-reverting) + (if (or force-reverting (not (buffer-modified-p))) + (revert-buffer :ignore-auto :noconfirm) + (error "The buffer has been modified"))) + +;; re-read a buffer from disk (revert) +(global-set-key (kbd "S-") 'tvd-buffer-reload) + +;; (lambda (&optional force-reverting) +;; "Interactive call to revert-buffer. Ignoring the auto-save +;; file and not requesting for confirmation. When the current buffer +;; is modified, the command refuses to revert it, unless you specify +;; the optional argument: force-reverting to true." +;; (interactive "P") +;; ;;(message "force-reverting value is %s" force-reverting) +;; (if (or force-reverting (not (buffer-modified-p))) +;; (revert-buffer :ignore-auto :noconfirm) +;; (error "The buffer has been modified"))))