unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: 63754@debbugs.gnu.org
Cc: eliz@gnu.org, tmdmelo@gmail.com
Subject: bug#63754: 29.0.91; tmm breaks when tmm-completion-prompt is nil
Date: Mon, 29 May 2023 19:37:58 +0300	[thread overview]
Message-ID: <86edmz855l.fsf@mail.linkov.net> (raw)
In-Reply-To: <83sfbhhvxd.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 28 May 2023 08:22:38 +0300")

>> > Should be fixed now on the emacs-29 branch.
>>
>> Cool.  I've tested, it's working nicely.  Thanks for the fix.
>
> Thanks for testing, I'm therefore closing this bug.

There is one remaining case where it fails:

  (setq completions-header-format nil)
  (setq tmm-completion-prompt nil)
  (tmm-menubar) ; or `tmm-prompt' with any menu/keymap

Then the first item is deleted.  The patch below fixes this.

>> Sorry if my comment is out of place, but I also gave a try to
>> `tmm-mid-prompt' = nil.  Since it disables the tmm shortcuts, maybe it
>> would be more intuitive to let users input keys and do completion at
>> the minibuffer in this situation? (unless I'm missing some unwanted
>> side effect here)
>>
>> With this little change, for example:
>
> I don't know.  The original completion works on the shortcuts, AFAIU,
> and thus makes no sense when tmm-mid-prompt is nil.  When that
> variable is nil, the user needs to use the arrow keys to select the
> menu items.  If someone wants to add a completion feature to that, I
> don't mind, but I don't know enough about tmm to tell, and such a
> change is definitely not for the release branch.
>
> If someone here has an opinion on this last suggestion, please speak
> up.

AFAICS, completion works without problems in tmm.  The artificial restriction
that removes self-inserting keys was needed to allow only character shortcuts
when tmm-mid-prompt is nil.

diff --git a/lisp/tmm.el b/lisp/tmm.el
index 88254f0d1b8..a4058594622 100644
--- a/lisp/tmm.el
+++ b/lisp/tmm.el
@@ -329,7 +329,8 @@ tmm-completion-delete-prompt
   (with-current-buffer standard-output
     (goto-char (point-min))
     (let* (;; First candidate: first string with mouse-face
-           (menu-start-1 (next-single-char-property-change (point) 'mouse-face))
+           (menu-start-1 (or (and (get-text-property (point) 'mouse-face) (point))
+                             (next-single-char-property-change (point) 'mouse-face)))
            ;; Second candidate: an inactive menu item with tmm-inactive face
            (tps-result (save-excursion
                          (text-property-search-forward 'face 'tmm-inactive t)))





  reply	other threads:[~2023-05-29 16:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-27 14:53 bug#63754: 29.0.91; tmm breaks when tmm-completion-prompt is nil Thiago Melo
2023-05-27 17:15 ` Eli Zaretskii
2023-05-27 19:48   ` Thiago Melo
2023-05-28  5:22     ` Eli Zaretskii
2023-05-29 16:37       ` Juri Linkov [this message]
2023-05-29 17:21         ` 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=86edmz855l.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=63754@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=tmdmelo@gmail.com \
    /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).