GNU bug report logs - #49869
Revert buffer? Yes/No/Maybe

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Wed, 4 Aug 2021 08:47:02 UTC

Severity: wishlist

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Gregory Heytings <gregory <at> heytings.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 49869 <at> debbugs.gnu.org, juri <at> linkov.net
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)

?




This bug report was last modified 3 years and 281 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.