turn revert lambda into defun

This commit is contained in:
2026-07-28 23:46:19 +02:00
parent 1b246af469
commit 3b0e07a3cd

View File

@@ -79,17 +79,31 @@
;; F5 == reload file if it has been modified by another process, shift
;; because Xmonad
(global-set-key (kbd "S-<f5>") ; 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-<f5>") '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"))))