Commit 027b1942 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

* bs.el (bs--get-file-name): Use `list-buffers-directory'

  when available, instead of hardcoding mode names.  Doc fix.
parent 11ee8d90
2009-09-25 Juanma Barranquero <lekktu@gmail.com> 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. * menu-bar.el (list-buffers-directory): Add docstring.
Make automatically buffer-local. Make automatically buffer-local.
......
...@@ -1327,13 +1327,12 @@ ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu." ...@@ -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) (defun bs--get-file-name (start-buffer all-buffers)
"Return string for column 'File' in Buffer Selection Menu. "Return string for column 'File' in Buffer Selection Menu.
This is the variable `buffer-file-name' of current buffer. This is the variable `buffer-file-name' of current buffer.
If current mode is `dired-mode' or `shell-mode' it returns the If not visiting a file, `list-buffers-directory' is returned instead.
default directory.
START-BUFFER is the buffer where we started buffer selection. START-BUFFER is the buffer where we started buffer selection.
ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu." ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu."
(propertize (if (member major-mode '(shell-mode dired-mode)) (propertize (or buffer-file-name
default-directory (bound-and-true-p list-buffers-directory)
(or buffer-file-name "")) "")
'mouse-face 'highlight 'mouse-face 'highlight
'help-echo "mouse-2: select this buffer, mouse-3: select in other frame")) 'help-echo "mouse-2: select this buffer, mouse-3: select in other frame"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment