unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Morgan Smith <Morgan.J.Smith@outlook.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 63913@debbugs.gnu.org
Subject: bug#63913: [PATCH] * lisp/minibuffer.el (minibuffer-completion-help): Only ding when appropriate.
Date: Tue, 06 Jun 2023 15:08:26 -0400	[thread overview]
Message-ID: <DM5PR03MB316328C67459CBDD727744BCC552A@DM5PR03MB3163.namprd03.prod.outlook.com> (raw)
In-Reply-To: <831qio4z3d.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 06 Jun 2023 07:19:51 -0400")

[-- Attachment #1: Type: text/plain, Size: 137 bytes --]

I'm running on commit 7ca1d782f5910d0c3978c6798a45c6854ec668c7 from the
master branch.

I really hoping you can reproduce it with this:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-test-for-when-completion-auto-help-is-visible.patch --]
[-- Type: text/x-patch, Size: 1915 bytes --]

From a1f095c8b26000d7526ce4791767c8a69eb915ea Mon Sep 17 00:00:00 2001
From: Morgan Smith <Morgan.J.Smith@outlook.com>
Date: Tue, 6 Jun 2023 15:02:57 -0400
Subject: [PATCH] Add test for when completion-auto-help is 'visible

* test/lisp/minibuffer-tests.el (completion-auto-help-test): Add for
for when completion-auto-help is 'visible.  Also test for successful
completion message.
---
 test/lisp/minibuffer-tests.el | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el
index 1de8e56cbd4..a67fc555772 100644
--- a/test/lisp/minibuffer-tests.el
+++ b/test/lisp/minibuffer-tests.el
@@ -353,12 +353,23 @@
             '("a" "ab" "ac")
           (execute-kbd-macro (kbd "a TAB TAB"))
           (should (equal (car messages) "Complete, but not unique"))
-          (should-not (get-buffer-window "*Completions*" 0))))
+          (should-not (get-buffer-window "*Completions*" 0))
+          (execute-kbd-macro (kbd "b TAB"))
+          (should (equal (car messages) "Sole completion"))))
       (let ((completion-auto-help t))
         (completing-read-with-minibuffer-setup
             '("a" "ab" "ac")
           (execute-kbd-macro (kbd "a TAB TAB"))
-          (should (get-buffer-window "*Completions*" 0)))))))
+          (should (get-buffer-window "*Completions*" 0))
+          (execute-kbd-macro (kbd "b TAB"))
+          (should (equal (car messages) "Sole completion"))))
+      (let ((completion-auto-help 'visible))
+        (completing-read-with-minibuffer-setup
+         '("a" "ab" "ac" "achoo")
+         (execute-kbd-macro (kbd "a TAB TAB"))
+         (should (get-buffer-window "*Completions*" 0))
+         (execute-kbd-macro (kbd "ch TAB"))
+         (should (equal (car messages) "Sole completion")))))))
 
 (ert-deftest completion-auto-select-test ()
   (let ((completion-auto-select t))
-- 
2.40.1


[-- Attachment #3: Type: text/plain, Size: 503 bytes --]


It should error out because apparently dings cause ert errors.  I did
not know that before but I am happy about it.

Eli Zaretskii <eliz@gnu.org> writes:

>
>> Also that situation doesn't respect completion-fail-discreetly if you
>> where to type in a failing completion before the final TAB press.
>
> Recipe, please.

I said this from a static analysis point of view but I couldn't seem to
reproduce this with a test.  It might be a dead code pathway but it
would still be nice for it to be correct.

  reply	other threads:[~2023-06-06 19:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05 17:50 bug#63913: [PATCH] * lisp/minibuffer.el (minibuffer-completion-help): Only ding when appropriate Morgan Smith
2023-06-05 18:50 ` Eli Zaretskii
2023-06-05 19:09   ` Morgan Smith
2023-06-06 11:19     ` Eli Zaretskii
2023-06-06 19:08       ` Morgan Smith [this message]
2023-06-08  9:59         ` Eli Zaretskii
2023-06-08 16:54           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-10  9:13             ` Eli Zaretskii
2023-06-10 17:34               ` Morgan Smith
2023-06-10 17:56                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM5PR03MB316328C67459CBDD727744BCC552A@DM5PR03MB3163.namprd03.prod.outlook.com \
    --to=morgan.j.smith@outlook.com \
    --cc=63913@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).