mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-12 15:10:50 +00:00
Make 't' in Buffer-menu be more defensive
* lisp/buff-menu.el (Buffer-menu-visit-tags-table): Verify that the buffer holds a tags-table file before using it as such. (Bug#54133)
This commit is contained in:
parent
bd17fa2c75
commit
794fbd1c07
1 changed files with 9 additions and 4 deletions
|
@ -527,13 +527,18 @@ If UNMARK is non-nil, unmark them."
|
|||
(multi-occur (Buffer-menu-marked-buffers) regexp nlines))
|
||||
|
||||
|
||||
(autoload 'etags-verify-tags-table "etags")
|
||||
(defun Buffer-menu-visit-tags-table ()
|
||||
"Visit the tags table in the buffer on this line. See `visit-tags-table'."
|
||||
(interactive nil Buffer-menu-mode)
|
||||
(let ((file (buffer-file-name (Buffer-menu-buffer t))))
|
||||
(if file
|
||||
(visit-tags-table file)
|
||||
(error "Specified buffer has no file"))))
|
||||
(let* ((buf (Buffer-menu-buffer t))
|
||||
(file (buffer-file-name buf)))
|
||||
(cond
|
||||
((not file) (error "Specified buffer has no file"))
|
||||
((and buf (with-current-buffer buf
|
||||
(etags-verify-tags-table)))
|
||||
(visit-tags-table file))
|
||||
(t (error "Specified buffer is not a tags-table")))))
|
||||
|
||||
(defun Buffer-menu-1-window ()
|
||||
"Select this line's buffer, alone, in full frame."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue