(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)))))
\f
(defun buffer-menu (&optional arg)
"Make a menu of buffers so you can save, delete or select them.
(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 `>'.
(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