From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Consistency for xref-show-{xrefs,definitions}-function Date: Mon, 18 Jan 2021 03:28:11 +0200 Message-ID: <43ada219-4c48-f44c-a324-cc9ff9e507dc@yandex.ru> References: <54ea98d8-7740-d287-6e3f-8c2f870010d5@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40270"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: Juri Linkov To: Gabriel do Nascimento Ribeiro , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 18 02:29:15 2021 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 1l1JM3-000AME-OJ for ged-emacs-devel@m.gmane-mx.org; Mon, 18 Jan 2021 02:29:15 +0100 Original-Received: from localhost ([::1]:41730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1JM2-0004B9-OO for ged-emacs-devel@m.gmane-mx.org; Sun, 17 Jan 2021 20:29:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1JL7-0003lD-W7 for emacs-devel@gnu.org; Sun, 17 Jan 2021 20:28:18 -0500 Original-Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:55832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l1JL5-0002TX-S7 for emacs-devel@gnu.org; Sun, 17 Jan 2021 20:28:17 -0500 Original-Received: by mail-wm1-x331.google.com with SMTP id c124so12165680wma.5 for ; Sun, 17 Jan 2021 17:28:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:cc:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=4grRwnTLkl9JY9in6nIOOmDOlesWtTyiMim22g3uo2Q=; b=aV1fZpq/JQhdYjt6Bt7xw0fLbaVvFj4bp92laMoKWx0Ygt6rg6niclKXGMvVVe+qBH Y11RomcSAe8ji5VI1UxyCnIyuZ+E+xwN3KmIVXz+BE3t4rhmyVkSj0DYSHpV2HZqGEoe hm0OZQBaQ2IyaJiH2bWzTRWxgPv2SqN/3XsyUVN2JFi/PrU/m6VSumP+6DbXE8OD1GY1 vN6HqWSa1CJUOxVHhA3JQnE0QLFVyZIBC46/q5vh131vTrhAw/VOX26jUTSQ+KJRdlyy IUz73ifp4KrbIjwv4ipcpCMvqPNCgfYKmDTYshvnOwc36ZGP07H4fTEX0RJyQW4L3QW4 Xn0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:cc:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4grRwnTLkl9JY9in6nIOOmDOlesWtTyiMim22g3uo2Q=; b=IsEF+GHk3MmnOf8AFevBqEwQS3Y4oiqSv5+GeHu575SyXMAeNjI4OU3y/xMYGy4caT BTJYddGNSnb28rztstekLzsJQMgrP/s1xZrYw7F0iJ8wG9lvheBD9zQmT33KV6y9iNSf IqTdUvHTcgdKTvdpRBBlZzlc8Ysq6x3qHBjefbqWcKDUOzk0CwJ53JYmiZumhphSerkL tjSIXwQjv6GWzCXZ0QsSqthqQtp7cJLhmcDrWv6gZ2vHv4UXJeZqgtjsvjI9Usmh30bQ dupSXQE7JciysMDG1QWM8wBohkAXJGqHKnWdBk4DAKNk8wrfeNWpsUM3XPSxVWphqc7J 57kQ== X-Gm-Message-State: AOAM533ewsWNe3AGVJl3m3nNT5s46Ae8ur2xPY1v2t8ZKbHQKqd7ddQK yFtFPJSnqQrj4dUQkCVuUcI= X-Google-Smtp-Source: ABdhPJzHF2DZYAiIumykTBQN4udX5Wlo32osU4Dfrs9wNjkZuzc5fVkQTPuL3ZS3s1Wc3yIOBSj1OA== X-Received: by 2002:a1c:2e88:: with SMTP id u130mr18521692wmu.83.1610933294015; Sun, 17 Jan 2021 17:28:14 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id c18sm46426817wmk.0.2021.01.17.17.28.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Jan 2021 17:28:13 -0800 (PST) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=raaahh@gmail.com; helo=mail-wm1-x331.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.252, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:263137 Archived-At: On 16.01.2021 22:31, Gabriel do Nascimento Ribeiro wrote: >> >> But you still use project-find-regexp for its "normal" purpose, too, >> right? That is, finding all occurrences of a certain regexp. Maybe to >> rename all occurrences of a symbol, etc. >> >> To only change its behavior in specific situations, you can add a new >> command to your init script and bind it to a key. The code can look >> like: >> >> (defun project-find-regexp-and-jump () >> (interactive) >> ;; Or use a particular function name here directly. >> (let ((xref-show-xrefs-function xref-show-definitions-function)) >> (call-interactively #'project-find-regexp))) >> >> Other suggestions welcome, of course. > > Thanks for your suggestion! I have that function in my init.el called > 'project-find-regexp-completing-read'. I started this thread just to > make sure this is not a dirty hack and the existing functions are > consistent. So I guess is everything okay =) Glad that's working for you. Regarding consistency, perhaps the names could be tweaked a bit, removing "definitions" from their names to avoid implying that the functions must only be used with that variable (even though using them as the "normal" value of xref-show-xrefs-function should be discouraged). Perhaps like: xref-jump-or-show-locations-buffer xref-jump-or-show-transient-buffer-at-bottom xref-completing-read-and-jump These a bit wordy, though, so ideas welcome. This also ties into https://debbugs.gnu.org/cgi/bugreport.cgi?bug=44611#93 (having a "public" show-xrefs function with a name that reflects its purpose of showing a list of search results).