In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2022-02-19 built on orion Repository revision: 563bb08c5998f82e034a0aa1b48dce29fb9bc375 Repository branch: rgr-smtpmail-env-from Windowing system distributor 'The X.Org Foundation', version 11.0.12003000 System Description: openSUSE Leap 15.3 Configured using: 'configure --with-dbus=no --with-gsettings=no --with-gif=ifavailable --with-tiff=no --with-gnutls=yes --with-gconf=no' Configured features: ACL CAIRO FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB To reproduce: In master ecaedf2117cb015ad4028e4d6fc7058608c98096: 1. "emacs -Q &" 2. Visit pretty much any random file that is NOT a tags file; for this purpose, lisp/abbrev.el from the source tree will do nicely. 3. Type "C-x C-b" to get the "*Buffer List*" window to appear. 4. Type "C-x o" to move the to the buffer list, then move to the abbrev.el line, and type "t" to invoke Buffer-menu-visit-tags-table on it (which I seem to do accidentally more often than I care to admit). This produces the error message: user-error: File /scratch/rogers/emacs/lisp/abbrev.el is not a valid tags table but the abbrev.el buffer is left in tags-table-mode, and any undo information is thrown away. The attached patch addresses the problem in a straightforward way by making Buffer-menu-visit-tags-table prompt the user for buffers not already in tags-table-mode. The real problem is that visit-tags-table assumes that the user knows what they're doing, and makes these irreversible changes before being sure of having a valid tags table. That would be a harder thing to fix, though -- and might not deal as well with my buffer-menu typos. ;-} -- Bob Rogers http://www.rgrjr.com/