Michael Albinus writes: > Something like this. But the final `auto-revert-remove-current-buffer' > needs the buffer to be removed as the current one. So it is a bit more > complex. > > I came up with the following patch: > > *** /tmp/ediffWnT0dx 2019-03-24 15:30:02.022068542 +0100 > --- /home/albinus/src/emacs/lisp/autorevert.el 2019-03-24 15:26:41.756960378 +0100 > *************** > *** 343,352 **** > > ;; Functions: > > ! (defun auto-revert-remove-current-buffer () > "Remove dead buffer from `auto-revert-buffer-list'." > (setq auto-revert-buffer-list > ! (delq (current-buffer) auto-revert-buffer-list))) > > ;;;###autoload > (define-minor-mode auto-revert-mode > --- 343,352 ---- > > ;; Functions: > > ! (defun auto-revert-remove-current-buffer (&optional buffer) > "Remove dead buffer from `auto-revert-buffer-list'." > (setq auto-revert-buffer-list > ! (delq (or buffer (current-buffer)) auto-revert-buffer-list))) > > ;;;###autoload > (define-minor-mode auto-revert-mode Can you please update the docstring? E.g. "Remove BUFFER from `auto-revert-buffer-list'. BUFFER defaults to `current-buffer'." > *************** > *** 772,781 **** > (setq bufs (delq nil > (mapcar > (lambda (buf) > ! (with-current-buffer buf > ! (and (or (not (file-remote-p default-directory)) > ! (file-remote-p default-directory nil t)) > ! buf))) > bufs))) > ;; Partition `bufs' into two halves depending on whether or not > ;; the buffers are in `auto-revert-remaining-buffers'. The two > --- 772,783 ---- > (setq bufs (delq nil > (mapcar > (lambda (buf) > ! (and (buffer-live-p buf) > ! (with-current-buffer buf > ! (and > ! (or (not (file-remote-p default-directory)) > ! (file-remote-p default-directory nil t)) > ! buf)))) > bufs))) > ;; Partition `bufs' into two halves depending on whether or not > ;; the buffers are in `auto-revert-remaining-buffers'. The > two Indentation seems a bit off here. Note that you can use 'when' instead of 'and' to fit more easily within 80 columns, if you prefer. Otherwise LGTM. Can you please also make the following change while you're at it?