* lisp/bs.el (bs-visit-tags-table): Verify that the
buffer holds a tags-table file before using it as
such. This is identical to bug#54133 affecting
Buffer-menu, and this fix is copied from the one
by Eli Zaretskii in commit
794fbd1c07 of 2022-02-24.
Thanks to Bob Rogers <rogers@rgrjr.com> for noticing.
"Visit the tags table in the buffer on this line.
See `visit-tags-table'."
(interactive)
- (let ((file (buffer-file-name (bs--current-buffer))))
- (if file
- (visit-tags-table file)
- (error "Specified buffer has no file"))))
+ (let* ((buf (bs--current-buffer))
+ (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 bs-toggle-current-to-show ()
"Toggle status of showing flag for buffer in current line."