From 027b19421d470108e774137d9179efb4134d543d Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 25 Sep 2009 04:46:34 +0000 Subject: [PATCH] * bs.el (bs--get-file-name): Use `list-buffers-directory' when available, instead of hardcoding mode names. Doc fix. --- lisp/ChangeLog | 3 +++ lisp/bs.el | 9 ++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b0a45070495..95aa7019901 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-09-25 Juanma Barranquero + * bs.el (bs--get-file-name): Use `list-buffers-directory' + when available, instead of hardcoding mode names. Doc fix. + * menu-bar.el (list-buffers-directory): Add docstring. Make automatically buffer-local. diff --git a/lisp/bs.el b/lisp/bs.el index 0c7a53cf636..54924196bf0 100644 --- a/lisp/bs.el +++ b/lisp/bs.el @@ -1327,13 +1327,12 @@ ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu." (defun bs--get-file-name (start-buffer all-buffers) "Return string for column 'File' in Buffer Selection Menu. This is the variable `buffer-file-name' of current buffer. -If current mode is `dired-mode' or `shell-mode' it returns the -default directory. +If not visiting a file, `list-buffers-directory' is returned instead. START-BUFFER is the buffer where we started buffer selection. ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu." - (propertize (if (member major-mode '(shell-mode dired-mode)) - default-directory - (or buffer-file-name "")) + (propertize (or buffer-file-name + (bound-and-true-p list-buffers-directory) + "") 'mouse-face 'highlight 'help-echo "mouse-2: select this buffer, mouse-3: select in other frame")) -- 2.39.5