summaryrefslogtreecommitdiff
path: root/lisp/buff-menu.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/buff-menu.el')
-rw-r--r--lisp/buff-menu.el13
1 files changed, 9 insertions, 4 deletions
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index 50c2c155caf..179cc5484cd 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -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."