Function: revert-buffer-quick

revert-buffer-quick is an interactive and byte-compiled function defined in files.el.gz.

Signature

(revert-buffer-quick &optional AUTO-SAVE)

Documentation

Like revert-buffer, but asks for less confirmation.

If the current buffer is visiting a file, and the buffer is not modified, no confirmation is required.

This command heeds the revert-buffer-quick-short-answers user option.

If AUTO-SAVE (the prefix argument), offer to revert from latest auto-save file, if that is more recent than the visited file.

Probably introduced at or before Emacs version 28.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/files.el.gz
(defun revert-buffer-quick (&optional auto-save)
  "Like `revert-buffer', but asks for less confirmation.
If the current buffer is visiting a file, and the buffer is not
modified, no confirmation is required.

This command heeds the `revert-buffer-quick-short-answers' user option.

If AUTO-SAVE (the prefix argument), offer to revert from latest
auto-save file, if that is more recent than the visited file."
  (interactive "P")
  (cond
   ;; If we've visiting a file, and we have no changes, don't ask for
   ;; confirmation.
   ((and buffer-file-name
         (not (buffer-modified-p)))
    (revert-buffer (not auto-save) t)
    (message "Reverted buffer"))
   ;; Heed `revert-buffer-quick-short-answers'.
   (revert-buffer-quick-short-answers
    (let ((use-short-answers t))
      (revert-buffer (not auto-save))))
   ;; Call `revert-buffer' normally.
   (t
    (revert-buffer (not auto-save)))))