changeset 105197:3ed1736067e6

* bs.el (bs--get-file-name): Use `list-buffers-directory' when available, instead of hardcoding mode names. Doc fix.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 25 Sep 2009 04:46:34 +0000
parents d991506f9286
children 550b90cc7226
files lisp/ChangeLog lisp/bs.el
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Sep 25 04:35:14 2009 +0000
+++ b/lisp/ChangeLog	Fri Sep 25 04:46:34 2009 +0000
@@ -1,5 +1,8 @@
 2009-09-25  Juanma Barranquero  <lekktu@gmail.com>
 
+	* 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.
 
--- a/lisp/bs.el	Fri Sep 25 04:35:14 2009 +0000
+++ b/lisp/bs.el	Fri Sep 25 04:46:34 2009 +0000
@@ -1327,13 +1327,12 @@
 (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"))