From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#63754: 29.0.91; tmm breaks when tmm-completion-prompt is nil Date: Mon, 29 May 2023 19:37:58 +0300 Organization: LINKOV.NET Message-ID: <86edmz855l.fsf@mail.linkov.net> References: <831qj1k867.fsf@gnu.org> <83sfbhhvxd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13746"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: eliz@gnu.org, tmdmelo@gmail.com To: 63754@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 29 19:08:48 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q3gMQ-0003Lq-Qt for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 29 May 2023 19:08:46 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3gLm-000460-67; Mon, 29 May 2023 13:08:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3gLk-00045c-Pp for bug-gnu-emacs@gnu.org; Mon, 29 May 2023 13:08:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q3gLk-00020P-Gg for bug-gnu-emacs@gnu.org; Mon, 29 May 2023 13:08:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3gLj-0001sW-Ch for bug-gnu-emacs@gnu.org; Mon, 29 May 2023 13:08:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 May 2023 17:08:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63754 X-GNU-PR-Package: emacs Original-Received: via spool by 63754-submit@debbugs.gnu.org id=B63754.16853800627136 (code B ref 63754); Mon, 29 May 2023 17:08:03 +0000 Original-Received: (at 63754) by debbugs.gnu.org; 29 May 2023 17:07:42 +0000 Original-Received: from localhost ([127.0.0.1]:59034 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3gLN-0001r1-Mx for submit@debbugs.gnu.org; Mon, 29 May 2023 13:07:41 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:37393) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3gLL-0001qn-FO for 63754@debbugs.gnu.org; Mon, 29 May 2023 13:07:39 -0400 X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net X-GND-Sasl: juri@linkov.net Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 71C90FF802; Mon, 29 May 2023 17:07:32 +0000 (UTC) In-Reply-To: <83sfbhhvxd.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 28 May 2023 08:22:38 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262604 Archived-At: >> > 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)))