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#55800: using rgrep function interactively with fido-mode or fido-vertical-mode causes errors Date: Mon, 13 Jun 2022 10:20:44 +0300 Organization: LINKOV.NET Message-ID: <867d5lau4j.fsf@mail.linkov.net> References: <83wndvack5.fsf@gnu.org> <83pmjna1di.fsf@gnu.org> <83fskj9sax.fsf@gnu.org> <86zginli36.fsf@mail.linkov.net> <86y1y5bvpc.fsf@mail.linkov.net> <86ilp8di8q.fsf@mail.linkov.net> <86pmjdoi3a.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38711"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 55800@debbugs.gnu.org, Eli Zaretskii To: Yilkal Argaw Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 13 09:45:40 2022 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 1o0elW-0009wT-S1 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Jun 2022 09:45:38 +0200 Original-Received: from localhost ([::1]:58756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0elV-0000MF-BW for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 13 Jun 2022 03:45:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0el9-0000Lk-KH for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2022 03:45:15 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35050) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o0ekw-0001Dy-F9 for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2022 03:45:13 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o0ekw-0000rZ-CC for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2022 03:45:02 -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, 13 Jun 2022 07:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55800 X-GNU-PR-Package: emacs Original-Received: via spool by 55800-submit@debbugs.gnu.org id=B55800.16551062453234 (code B ref 55800); Mon, 13 Jun 2022 07:45:02 +0000 Original-Received: (at 55800) by debbugs.gnu.org; 13 Jun 2022 07:44:05 +0000 Original-Received: from localhost ([127.0.0.1]:57180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0ek1-0000q6-7E for submit@debbugs.gnu.org; Mon, 13 Jun 2022 03:44:05 -0400 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]:54989) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0ejz-0000pN-DI for 55800@debbugs.gnu.org; Mon, 13 Jun 2022 03:44:04 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id B3B98100006; Mon, 13 Jun 2022 07:43:52 +0000 (UTC) In-Reply-To: <86pmjdoi3a.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 12 Jun 2022 21:24:41 +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" Xref: news.gmane.io gmane.emacs.bugs:234381 Archived-At: --=-=-= Content-Type: text/plain >> So maybe fido-mode could be fixed to always provide the default value >> as the first highlighted candidate? Then RET will select it. > > Another part of the problem is still unsolved and the question still is: > shouldn't fido-mode bubble the default value to the top of the list > even when the default value doesn't exist in the list of completion > candidates? This is the same question as was asked in > https://debbugs.gnu.org/38992#76 It seems there is no way to change the behaviour of fido-mode, so what remains to do is to add the default values to the completion list only in rgrep, then fido-mode will highlight the default at the top: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=grep-read-files.patch diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index e0c9e6c76b..5d45a7d88f 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -1072,15 +1072,18 @@ grep-read-files default-extension (car grep-files-history) (car (car grep-files-aliases)))) + (defaults + (delete-dups + (delq nil + (append (list default default-alias default-extension) + (mapcar #'car grep-files-aliases))))) (files (completing-read (format-prompt "Search for \"%s\" in files matching wildcard" default regexp) - #'read-file-name-internal - nil nil nil 'grep-files-history - (delete-dups - (delq nil - (append (list default default-alias default-extension) - (mapcar #'car grep-files-aliases))))))) + (completion-table-merge + (lambda (_string _pred _action) defaults) + #'read-file-name-internal) + nil nil nil 'grep-files-history defaults))) (and files (or (cdr (assoc files grep-files-aliases)) files)))) --=-=-=--