GNU bug report logs - #78746
31.0.50; ido-confirm-unique-completion has no effect

Previous Next

Package: emacs;

Reported by: Pip Cet <pipcet <at> protonmail.com>

Date: Tue, 10 Jun 2025 14:59:03 UTC

Severity: normal

Found in version 31.0.50

To reply to this bug, email your comments to 78746 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#78746; Package emacs. (Tue, 10 Jun 2025 14:59:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pip Cet <pipcet <at> protonmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 10 Jun 2025 14:59:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pip Cet <pipcet <at> protonmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; ido-confirm-unique-completion has no effect
Date: Tue, 10 Jun 2025 14:58:16 +0000
This bug was found by searching the Emacs .el files for misleading
indentation automatically.  This code in ido.el:

     ((and (= 1 (length ido-matches))
	   (not (and ido-enable-tramp-completion
		     (string-equal ido-current-directory "/")
		     (string-match ".[@:]\\'" (ido-name (car ido-matches)))))
		     (not (ido-local-file-exists-p (ido-name (car ido-matches)))))
      ;; only one choice, so select it.
      (if (not ido-confirm-unique-completion)
	  (exit-minibuffer)
	(setq ido-rescan (not ido-enable-prefix))
	(delete-region (minibuffer-prompt-end) (point))
	(insert (ido-name (car ido-matches)))))

is indented correctly, but the parentheses are wrong.  It should be:

     ((and (= 1 (length ido-matches))
	   (not (and ido-enable-tramp-completion
		     (string-equal ido-current-directory "/")
		     (string-match ".[@:]\\'" (ido-name (car ido-matches)))
		     (not (ido-local-file-exists-p (ido-name (car ido-matches)))))))
      ;; only one choice, so select it.
      (if (not ido-confirm-unique-completion)
	  (exit-minibuffer)
	(setq ido-rescan (not ido-enable-prefix))
	(delete-region (minibuffer-prompt-end) (point))
	(insert (ido-name (car ido-matches)))))

This inverts the last condition and changes its priority: in effect,
when completing file names in an ido buffer, ido-complete would never
automatically select a single choice (unless that file was deleted
unexpectedly), even when customized to do so, as it was by default.

For buffers, however, ido-complete would complete the sole remaining
buffer name and exit the minibuffer by default, unless a file named like
the single matching buffer name existed in the current directory.

So our options are:

1. change just the code and make it behave as documented for files as
well as buffers
2. change the code and change the defcustom's default to t, retaining
current behavior for files but not buffers
3. allow the defcustom to specify only files or buffers, and make it
default to applying just to buffers, not files, retaining the current
behavior

I'd prefer the first option.





This bug report was last modified 5 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.