]> git.eshelyaron.com Git - emacs.git/commitdiff
* bs.el (bs--get-file-name): Use `list-buffers-directory'
authorJuanma Barranquero <lekktu@gmail.com>
Fri, 25 Sep 2009 04:46:34 +0000 (04:46 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Fri, 25 Sep 2009 04:46:34 +0000 (04:46 +0000)
  when available, instead of hardcoding mode names.  Doc fix.

lisp/ChangeLog
lisp/bs.el

index b0a4507049553847bd2636935cb5f1d0214abd7d..95aa7019901b68742e7c7296bd30398fc0969050 100644 (file)
@@ -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.
 
index 0c7a53cf63643af3a88e0931d05aaccef3c61b01..54924196bf0c09ce9c14644c7ac57e900421aa22 100644 (file)
@@ -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"))