Mercurial > emacs
changeset 30828:26dae0a7f527
(list-buffers-noselect): Set `buffer' as well as
'buffer-menu' property.
(Buffer-menu-buffer): Use `buffer' property if `buffer-name'
fails.
(Buffer-menu-execute): When deleting, test `(and buf (buffer-name
buf))', instead of `(Buffer-menu-buffer nil)', to see if buffer
wasn't killed.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Tue, 15 Aug 2000 21:28:08 +0000 |
parents | 7087bbfb6e30 |
children | a83791be7166 |
files | lisp/buff-menu.el |
diffstat | 1 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/buff-menu.el Tue Aug 15 21:02:00 2000 +0000 +++ b/lisp/buff-menu.el Tue Aug 15 21:28:08 2000 +0000 @@ -158,15 +158,18 @@ (let* ((where (save-excursion (beginning-of-line) (+ (point) Buffer-menu-buffer-column))) - (name (and (not (eobp)) (get-text-property where 'buffer-name)))) + (name (and (not (eobp)) (get-text-property where 'buffer-name))) + (buf (and (not (eobp)) (get-text-property where 'buffer)))) (if name (or (get-buffer name) + (and buf (buffer-name buf) buf) (if error-if-non-existent-p (error "No buffer named `%s'" name) nil)) + (or (and buf (buffer-name buf) buf) (if error-if-non-existent-p (error "No buffer on this line") - nil)))) + nil))))) (defun buffer-menu (&optional arg) "Make a menu of buffers so you can save, delete or select them. @@ -305,12 +308,12 @@ (let ((buf (Buffer-menu-buffer nil))) (or (eq buf nil) (eq buf buff-menu-buffer) - (save-excursion (kill-buffer buf)))) - (if (Buffer-menu-buffer nil) + (save-excursion (kill-buffer buf))) + (if (and buf (buffer-name buf)) (progn (delete-char 1) (insert ? )) (delete-region (point) (progn (forward-line 1) (point))) - (forward-char -1)))))) + (forward-char -1))))))) (defun Buffer-menu-select () "Select this line's buffer; also display buffers marked with `>'. @@ -548,6 +551,8 @@ (indent-to 17 2) (put-text-property this-buffer-line-start name-end 'buffer-name name) + (put-text-property this-buffer-line-start (point) + 'buffer buffer) (put-text-property this-buffer-line-start name-end 'mouse-face 'highlight)) (let (size