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>
* 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.
......
......@@ -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"))
......
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