From: Juanma Barranquero Date: Fri, 25 Sep 2009 04:46:34 +0000 (+0000) Subject: * bs.el (bs--get-file-name): Use `list-buffers-directory' X-Git-Tag: emacs-pretest-23.1.90~1147 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=027b19421d470108e774137d9179efb4134d543d;p=emacs.git * bs.el (bs--get-file-name): Use `list-buffers-directory' when available, instead of hardcoding mode names. Doc fix. --- 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"))