From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron Newsgroups: gmane.emacs.devel Subject: Re: master 6b7ff60a5e7: Highlight the suffix in *Completions* buffer in 'basic' style too Date: Sun, 30 Jun 2024 20:14:02 +0200 Message-ID: References: <171823002031.28307.18221225159709452537@vcs2.savannah.gnu.org> <20240612220700.A0F4DC1FB4C@vcs2.savannah.gnu.org> <86h6dwf40q.fsf@mail.linkov.net> <86frtffpdb.fsf@mail.linkov.net> <867ce6pwrq.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26784"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org, Dmitry Gutov To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 30 20:14:39 2024 Return-path: Envelope-to: ged-emacs-devel@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 1sNz4R-0006lr-JP for ged-emacs-devel@m.gmane-mx.org; Sun, 30 Jun 2024 20:14:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNz42-0006Og-GO; Sun, 30 Jun 2024 14:14:14 -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 1sNz3y-0006Nj-2P for emacs-devel@gnu.org; Sun, 30 Jun 2024 14:14:10 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sNz3v-0000iS-Ef for emacs-devel@gnu.org; Sun, 30 Jun 2024 14:14:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1719771245; bh=xIIClwZnJW1h1jjtF/lK3YQq2Ufh1zR0D3OW9BrL3IE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=B6ltGCKFEzJMe+ZaD7nTOKG3VLLFKRHpqNnyl082M9z6Xoow8fd8GPTJDn8LsHRFp TGQi5p1jO+t4UweMs58kEc5v5hIOP/PVq7aGkYTXVwP1csybE9cajtl79mHpWaiTFW L0JXfM9Ew0nbjMwWzZEZ+XggHYNKDOXfjhOMmNZ3aM3xkJloQ40kynRcFY7wgmORSM Jp1w/Hx9Qz14LyHlxJKj4AyCoqNQiGtTLEQ+9vyf4yYQmwagrQ9g8TCHsqQfDbsQLi OsPr4ONnmFMNXf9/PxLcbSMHByvJbGQtIL43R43gZ1dLrmdLqxC81wQGancU9B57XC mitD7DWEl3TAw== In-Reply-To: <867ce6pwrq.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 30 Jun 2024 19:29:29 +0300") Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:320974 Archived-At: Hi Juri, Juri Linkov writes: > I don't know what commits caused this, but there is still a regression > in another case: > > 0. emacs -Q > 1. M-x icomplete-mode RET > 2. M-x rgrep RET foo RET b > > Error in post-command-hook (icomplete-post-command-hook): > (wrong-type-argument number-or-marker-p nil) Ouch. AFAICT the problem is in grep.el, and it's not specific to icomplete-mode, e.g. I can reproduce it with: M-: (grep-read-files "foo") RET b ? grep-read-files calls completing-read with a misbehaving completion table, that returns some completion candidates unconditionally. This breaks the assumption of completion-pcm--all-completions that the candidates it gets actually match the given pattern. Does the diff below help? (Note that this change has the downside that file name quoting/unquoting is no longer applied. Handling that with completion-table-merge might be a bit more tricky.) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 459f00e6805..e8d1e692d0f 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -1181,9 +1181,7 @@ grep-read-files (files (completing-read (format-prompt "Search for \"%s\" in files matching wildcard" default regexp) - (completion-table-merge - (lambda (_string _pred _action) defaults) - #'read-file-name-internal) + (completion-table-merge defaults #'completion-file-name-table) nil nil nil 'grep-files-history defaults))) (and files (or (cdr (assoc files grep-files-aliases))