Mercurial > emacs
comparison lisp/bs.el @ 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 | da8b3e61b182 |
children | 90daaeee02f3 |
comparison
equal
deleted
inserted
replaced
105196:d991506f9286 | 105197:3ed1736067e6 |
---|---|
1325 (format-mode-line mode-name nil nil start-buffer)) | 1325 (format-mode-line mode-name nil nil start-buffer)) |
1326 | 1326 |
1327 (defun bs--get-file-name (start-buffer all-buffers) | 1327 (defun bs--get-file-name (start-buffer all-buffers) |
1328 "Return string for column 'File' in Buffer Selection Menu. | 1328 "Return string for column 'File' in Buffer Selection Menu. |
1329 This is the variable `buffer-file-name' of current buffer. | 1329 This is the variable `buffer-file-name' of current buffer. |
1330 If current mode is `dired-mode' or `shell-mode' it returns the | 1330 If not visiting a file, `list-buffers-directory' is returned instead. |
1331 default directory. | |
1332 START-BUFFER is the buffer where we started buffer selection. | 1331 START-BUFFER is the buffer where we started buffer selection. |
1333 ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu." | 1332 ALL-BUFFERS is the list of buffers appearing in Buffer Selection Menu." |
1334 (propertize (if (member major-mode '(shell-mode dired-mode)) | 1333 (propertize (or buffer-file-name |
1335 default-directory | 1334 (bound-and-true-p list-buffers-directory) |
1336 (or buffer-file-name "")) | 1335 "") |
1337 'mouse-face 'highlight | 1336 'mouse-face 'highlight |
1338 'help-echo "mouse-2: select this buffer, mouse-3: select in other frame")) | 1337 'help-echo "mouse-2: select this buffer, mouse-3: select in other frame")) |
1339 | 1338 |
1340 (defun bs--insert-one-entry (buffer) | 1339 (defun bs--insert-one-entry (buffer) |
1341 "Generate one entry for buffer BUFFER in Buffer Selection Menu. | 1340 "Generate one entry for buffer BUFFER in Buffer Selection Menu. |