I had to run the command several times revert-bufferand was very upset to say yes when emacs asks for this message Revert buffer from file abc.txt? (yes or no).
revert-buffer
Revert buffer from file abc.txt? (yes or no)
In any case, to say yes to the car ?
If it's just for interactive use, I would define an alternative function:
(defun my-revert-buffer-noconfirm () "Call `revert-buffer' with the NOCONFIRM argument set." (interactive) (revert-buffer nil t))
Alternatively, as revert-bufferdocstring tells you , look at the variable revert-without-queryif you get a nicer solution.
revert-without-query
.emacs, ( y n):
.emacs
(defalias 'yes-or-no-p 'y-or-n-p)
, , @phils, nil IGNORE-AUTO arg:
nil
IGNORE-AUTO
(defun revert-buffer-no-confirm () "Revert buffer without confirmation." (interactive) (revert-buffer t t))
<f5>, , , MS Windows.
<f5>
, () , . revert-without-query, () .. revert-buffer (, , ) . , .
revert-without-query .
Although, as pointed out by other answers, it is preferable to override a function revert-bufferor key binding, you can automatically answer “yes” to any function with yes-or-no-por, for that matter, y-or-n-pas follows:
yes-or-no-p
y-or-n-p
(defalias 'yes-or-no-p '(lambda (a &rest b) t))
This can be very damaging to your data, so use as you see fit.