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 10:06:12 +0000


There is a new short keybinding to revert the current buffer - just 3 keys: 'C-x x g'. But then it asks for a confirmation with 4 keys: 'y e s RET' that is even longer than the command keys. This defeats the purpose of having the short key sequence. Does 'C-x x g' really need a confirmation?

I propose to revert the buffer immediately after typing 'C-x x g'.

I think I agree... if the buffer hasn't been changed. So we could bind it to a new command, like revert-buffer-command, that would call revert-buffer with NOCONFIRM if the buffer hasn't been edited?


What about:

(defun revert-buffer-short-confirm (&optional args)
  (interactive (list (not current-prefix-arg)))
  (cl-letf (((symbol-function 'yes-or-no-p) 'y-or-n-p))
    (revert-buffer args)))

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

?





reply via email to

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