bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#49869: Revert buffer? Yes/No/Maybe


From: Gregory Heytings
Subject: bug#49869: Revert buffer? Yes/No/Maybe
Date: Wed, 04 Aug 2021 12:37:43 +0000


(defun revert-buffer-short-answer (&optional args)
   (interactive (list (not current-prefix-arg)))
   (let ((use-short-answers t))
     (revert-buffer args)))

(global-set-key (kbd "C-x x g") 'revert-buffer-short-answer)

If you propose this as something people who want this could do in their init files, then I agree.


No, I propose this as a solution to Juri's problem, instead of his proposed solution to "revert the buffer immediately" with C-x x g, which is indeed too drastic. Something even better to take Lars' suggestion (do not ask confirmation when the buffer has not been modified) into account:

(defun revert-buffer-short-answer (&optional ignore-auto noconfirm 
preserve-modes)
  (interactive (list (not current-prefix-arg)))
  (let ((use-short-answers t)
        (noconfirm (not (buffer-modified-p))))
    (revert-buffer ignore-auto noconfirm preserve-modes)))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]