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#47012: xref copies keymap properties to minibuffer Date: Wed, 24 Mar 2021 22:38:34 +0200 Organization: LINKOV.NET Message-ID: <87sg4kb839.fsf@mail.linkov.net> References: <87czw9tnu9.fsf@mail.linkov.net> <3aad442a-7319-5db5-2fc6-560bb032c34d@yandex.ru> <87a6r9v24b.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="34955"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 47012@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 24 21:42:14 2021 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 1lPAKT-0008yD-FC for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Mar 2021 21:42:13 +0100 Original-Received: from localhost ([::1]:47006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPAKS-0007EY-9d for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Mar 2021 16:42:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPAKI-0007DQ-GS for bug-gnu-emacs@gnu.org; Wed, 24 Mar 2021 16:42:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lPAKI-0001E3-1b for bug-gnu-emacs@gnu.org; Wed, 24 Mar 2021 16:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lPAKH-0004Np-VP for bug-gnu-emacs@gnu.org; Wed, 24 Mar 2021 16:42:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Mar 2021 20:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47012 X-GNU-PR-Package: emacs Original-Received: via spool by 47012-submit@debbugs.gnu.org id=B47012.161661851116833 (code B ref 47012); Wed, 24 Mar 2021 20:42:01 +0000 Original-Received: (at 47012) by debbugs.gnu.org; 24 Mar 2021 20:41:51 +0000 Original-Received: from localhost ([127.0.0.1]:36188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lPAK7-0004NR-10 for submit@debbugs.gnu.org; Wed, 24 Mar 2021 16:41:51 -0400 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]:45845) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lPAK5-0004NC-8l for 47012@debbugs.gnu.org; Wed, 24 Mar 2021 16:41:50 -0400 Original-Received: from mail.gandi.net (m91-129-107-223.cust.tele2.ee [91.129.107.223]) (Authenticated sender: juri@linkov.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id D6AAC100007; Wed, 24 Mar 2021 20:41:41 +0000 (UTC) In-Reply-To: <87a6r9v24b.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 11 Mar 2021 22:58:44 +0200") 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:202965 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit >> FWIW, it's was project.el's problem, not xref's. > > I thought it's the xref's problem because Help says it's in xref.el. > Typing 'C-h f project--read-regexp RET' shows: > > project--read-regexp is a Lisp function in ‘xref.el’. > > But this is because I tried to override this function in the init file: > > ;; Redefine to use `minibuffer-history': > (with-eval-after-load 'project > (defun project--read-regexp () > (let ((sym (thing-at-point 'symbol t))) > (read-regexp "Find regexp" > (and sym (regexp-quote sym)) > 'minibuffer-history)))) > > Oh, well, need to find another way to do this > (no feature request for this :-) Actually, can't do this without feature request, and can't use it as is, because never use regexp while searching in project, whereas it pollutes the regexp history for commands where I really use regexps, not just strings. A simple patch could be a saver to use with e.g. (setq project-regexp-history-variable 'minibuffer-history): --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=project-regexp-history-variable.patch diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index b6a886f731..280a8d8929 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -781,9 +781,12 @@ project--find-regexp-in-files (user-error "No matches for: %s" regexp)) xrefs)) +(defvar project-regexp-history-variable nil) + (defun project--read-regexp () (let ((sym (thing-at-point 'symbol t))) - (read-regexp "Find regexp" (and sym (regexp-quote sym))))) + (read-regexp "Find regexp" (and sym (regexp-quote sym)) + project-regexp-history-variable))) ;;;###autoload (defun project-find-file () --=-=-=--