mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2026-08-23 21:24:18 +02:00
turn revert lambda into defun
This commit is contained in:
@@ -79,17 +79,31 @@
|
|||||||
|
|
||||||
;; 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
|
||||||
the optional argument: force-reverting to true."
|
the optional argument: force-reverting to true."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
;;(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"))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user