summaryrefslogtreecommitdiff
path: root/lisp/buff-menu.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/buff-menu.el')
-rw-r--r--lisp/buff-menu.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index e48aa9e34b4..818fc19a4fd 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -210,7 +210,12 @@ Letters do not insert themselves; instead, they are commands.
(prop (point-min))
;; do not make undo records for the reversion.
(buffer-undo-list t))
- (list-buffers-noselect Buffer-menu-files-only)
+ ;; We can be called by Auto Revert Mode with the "*Buffer Menu*"
+ ;; temporarily the current buffer. Make sure that the
+ ;; interactively current buffer is correctly identified with a `.'
+ ;; by `list-buffers-noselect'.
+ (with-current-buffer (window-buffer)
+ (list-buffers-noselect Buffer-menu-files-only))
(if oline
(while (setq prop (next-single-property-change prop 'buffer))
(when (eq (get-text-property prop 'buffer) oline)
@@ -717,7 +722,7 @@ For more information, see the function `buffer-menu'."
(if (memq c '(?\n ?\s)) c underline))
header)))))
;; Collect info for every buffer we're interested in.
- (dolist (buffer (or buffer-list (buffer-list)))
+ (dolist (buffer (or buffer-list (buffer-list (selected-frame))))
(with-current-buffer buffer
(let ((name (buffer-name))
(file buffer-file-name))