emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Buffer-menu-revert-function


From: Luc Teirlinck
Subject: Buffer-menu-revert-function
Date: Fri, 25 Nov 2005 21:37:43 -0600 (CST)

When you enable autoreverting of the Buffer Menu, the current buffer
looses the `.', that normally gets prepended to it.  This is
especially bad if you elect to sort the Buffer Menu in some order
other than visited order.

The reason is that `Buffer-menu-revert-function' has to be called with
*Buffer List* as the current buffer.  The same problem would occur
whenever any Lisp function calls `Buffer-menu-revert-function'.

The patch below fixes this.  I will install if there are no objections.

===File ~/buff-menu-diff====================================
*** buff-menu.el        29 Sep 2005 18:18:34 -0500      1.93
--- buff-menu.el        25 Nov 2005 21:26:07 -0600      
***************
*** 210,216 ****
        (prop (point-min))
        ;; do not make undo records for the reversion.
        (buffer-undo-list t))
!     (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)
--- 210,221 ----
        (prop (point-min))
        ;; do not make undo records for the reversion.
        (buffer-undo-list t))
!     ;; 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)
============================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]