bug#81635: 32.0.50; Change in TAB cycling *Completions* and minibuffer
Stephen Berman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email protected]>
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
When `completion-auto-select' is set to t and `completion-auto-wrap' is also t (the default), then TAB and S-TAB cycle through the *Completions* buffer and after the last (resp. first) completion candidate switches to the minibuffer. In Emacs 30 typing TAB in the minibuffer continues the cycling, i.e., TAB continues with the first candidate, S-TAB with the last. This behavior changed with commit 5b19ca56f1d9 (bug#74019): since then TAB in the minibuffer returns to the last candidate and S-TAB returns to the first, and further TABs or S-TABs just bounce back and forth between that candidate and the minibuffer rather than cycling through *Completions*. That is, after returning to *Completions* from the minibuffer you have to switch from TAB to S-TAB or vice versa in order to resume cycling through *Completions*. This change in behavior seems like unintended fallout from commit 5b19ca56f1d9. The attached patch restores the previous cyclic behavior. I've added Spencer Baugh (the author of that commit) and Stefan Monnier in Cc:, in case they have any comments. In GNU Emacs 32.0.50 (build 8, x86_64-pc-linux-gnu, GTK+ Version 3.24.52, cairo version 1.18.4) of 2026-08-14 built on strobelfs Repository revision: cb22cfe1414bc3aa5a0e0b54f41f5b3453cb1f01 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101024 System Description: Linux From Scratch r13.0-156 Configured using: 'configure -C --with-native-compilation=no 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/opt/qt6/lib/pkgconfig' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINERAMA XINPUT2 XPM XRANDR GTK3 ZLIB
(unnamed)
(text/x-patch, 778 B)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 4da651cc450..0850b182be2 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -3016,7 +3016,8 @@ minibuffer-completion-help
'exact 'finished))))))
(display-completion-list completions nil group-fun)
- (when current-candidate-and-offset
+ (when (and current-candidate-and-offset
+ (not completion-auto-select))
(with-current-buffer standard-output
(when-let* ((match (text-property-search-forward
'completion--string (car current-candidate-and-offset) t)))