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,8 +79,8 @@
;; F5 == reload file if it has been modified by another process, shift ;; F5 == reload file if it has been modified by another process, shift
;; because Xmonad ;; because Xmonad
(global-set-key (kbd "S-<f5>") ; re-read a buffer from disk (revert)
(lambda (&optional force-reverting) (defun tvd-buffer-reload(&optional force-reverting)
"Interactive call to revert-buffer. Ignoring the auto-save "Interactive call to revert-buffer. Ignoring the auto-save
file and not requesting for confirmation. When the current buffer file and not requesting for confirmation. When the current buffer
is modified, the command refuses to revert it, unless you specify is modified, the command refuses to revert it, unless you specify
@@ -89,7 +89,21 @@
;;(message "force-reverting value is %s" force-reverting) ;;(message "force-reverting value is %s" force-reverting)
(if (or force-reverting (not (buffer-modified-p))) (if (or force-reverting (not (buffer-modified-p)))
(revert-buffer :ignore-auto :noconfirm) (revert-buffer :ignore-auto :noconfirm)
(error "The buffer has been modified")))) (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"))))