From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: xref-query-replace Date: Sat, 9 Jan 2016 19:48:17 +0300 Message-ID: <569139D1.5040907@yandex.ru> References: <8360z2ojqd.fsf@gnu.org> <56912C28.8010002@yandex.ru> <831t9qogl8.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1452358119 19376 80.91.229.3 (9 Jan 2016 16:48:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 9 Jan 2016 16:48:39 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 09 17:48:32 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aHwgo-0001sk-TK for ged-emacs-devel@m.gmane.org; Sat, 09 Jan 2016 17:48:31 +0100 Original-Received: from localhost ([::1]:41301 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHwgo-0000e3-5z for ged-emacs-devel@m.gmane.org; Sat, 09 Jan 2016 11:48:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHwgi-0000aq-MM for emacs-devel@gnu.org; Sat, 09 Jan 2016 11:48:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aHwgd-0002ly-GU for emacs-devel@gnu.org; Sat, 09 Jan 2016 11:48:24 -0500 Original-Received: from mail-lf0-x232.google.com ([2a00:1450:4010:c07::232]:32784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aHwgd-0002lr-85; Sat, 09 Jan 2016 11:48:19 -0500 Original-Received: by mail-lf0-x232.google.com with SMTP id m198so45845379lfm.0; Sat, 09 Jan 2016 08:48:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=SxWZMJ3jNAhJ/AuIa9lHEvfCnYDBhxBC+zj86030bOQ=; b=LMUtz9Tu25lUatfQXCqLWH8+jhA4jhsklURM4ywU7s6CTvMiWqXEJeg9LFrsPkWCK1 29vAQ8HoVGJwm+YnPvtzOBD3tq6bbZ+FdC4XbXJK9uGcFYa4ngcWtwgnRBjSy5yRVaTP gIpxOVZFemtbVUjlamOrgn+wH2YrGnFc4kfhtT2NT3xkkA6xP/4RtEekyZ7A/8daLRNu aNUPd7NILh3ZsvXy8fwdv+BEEqxKYQry/udIDJfRVlrUDF34zQdhvokNoMXFqeAHk1FF snshfd3zMHTquRLGU/FvKO+Kg2w3cTV5wJS+TCtPWfTWYeExuqguEJJp0ruzY14oEMi3 /KZA== X-Received: by 10.25.169.129 with SMTP id s123mr18663662lfe.39.1452358098399; Sat, 09 Jan 2016 08:48:18 -0800 (PST) Original-Received: from [192.168.1.190] ([178.252.127.222]) by smtp.googlemail.com with ESMTPSA id 87sm14277292lfr.44.2016.01.09.08.48.17 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 09 Jan 2016 08:48:17 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Thunderbird/43.0 In-Reply-To: <831t9qogl8.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:197908 Archived-At: On 01/09/2016 07:36 PM, Eli Zaretskii wrote: >> I've posted a thread about it in November: >> http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01465.html > > Thanks. I've read it now, and it describes exactly what I did. (Btw, > why does it say to agree to ".*"? aren't other regexps supposed to > work as well?) Of course. These are just the steps to try it out quickly. > Same result with this recipe: > > emacs -Q > C-x C-f src/xdisp.c > M-. > > Press RET to confirm visiting the TAGS table in src/ (you should have > one, of course). You are now presented with a *xref* buffer that > lists many matches for "Display". (Should xref pick up symbols inside > comments?) etags does, apparently. Why else would xref show them? In general, I'd say "yes", for "find references" or "find regexp" results. But not for "find definitions". > In that buffer, type: > > r RET xyzzy RET > > I get the same disappointing result. > > Stepping through xref-query-replace, it seems like xref-match-length > always returns nil, so no matches are collected. Which sounds about > right, since I see no non-trivial definitions for xref-match-length, > or maybe I'm blind. > > What am I doing wrong? You're calling the "find definitions" command, not the "find references" or "find regexp". xref-find-definitions returns a set of xrefs which we don't consider to be a set of "matches", currently. While the English language may frown on this, I think it's good that xref-query-replace doesn't work across the "find definitions" result, because if it did, you'd end up with a codebase in which the function's (definition is|definitions are) renamed, but all its usages keep referring to the old name. Try starting with xref-find-references (bound to M-?).