From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: A read-based grep-like for symbols (el-search?) (was Do shorthands break basic tooling (tags, grep, etc)? (was Re: Shorthands have landed on master)) Date: Sat, 02 Oct 2021 03:05:35 +0100 Message-ID: <87sfxk41w0.fsf@gmail.com> References: <25d8d72022b571db5291@heytings.org> <87h7e2xsl5.fsf@gmail.com> <25d8d72022e1ea7ed022@heytings.org> <87fstl7lzw.fsf@web.de> <87a6jt7ilx.fsf@web.de> <87fstlzlaq.fsf@gmail.com> <20211001070242.GC16352@tuxteam.de> <8735pk5i3j.fsf@gmail.com> <8fc4f254-5dc0-f3c0-7a72-c217b154438a@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6767"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: tomas@tuxteam.de, emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Oct 02 04:07:14 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 1mWUQj-0001al-Dh for ged-emacs-devel@m.gmane-mx.org; Sat, 02 Oct 2021 04:07:13 +0200 Original-Received: from localhost ([::1]:58682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWUQi-0003FF-5H for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Oct 2021 22:07:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWUPE-0002QE-Ry for emacs-devel@gnu.org; Fri, 01 Oct 2021 22:05:41 -0400 Original-Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:42566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWUPC-0007GL-1Q for emacs-devel@gnu.org; Fri, 01 Oct 2021 22:05:40 -0400 Original-Received: by mail-wr1-x42b.google.com with SMTP id v17so18142643wrv.9 for ; Fri, 01 Oct 2021 19:05:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=AOaeIXFb3sZG2tMHLcIehzdf9NuR0L3eR/i2QwpmevM=; b=ZSU29c0RRdsWatpnXEf0jKiFKYQS4wRm4RZTvM5fO8mPk2A7w+32T/LKTuh/Jzi0zZ 6jz1nhmzZX2s/tOhWkkr6gEVYyWgA0/TgztSCYF5kENLAWxP2C2qj/k/ZxfFoUzGpR0J H10iPn3sYeu7Sydi368G+OTlGxfquhdKpP05hW3A54DvkXeotkEFLG6xWy4FiEMKGlDX efaA2Q7gbCOtuDIeG1O/bl0yg8PgNcaadwIqEam143soLI+sjI6PStJqRG2c/hJqINDd d+oStWQdiCfOdnCogE991a3PPif8pSPas69t+mZArFxjP0ufCXKg+fz3NfBDN7e0VPOy dWfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=AOaeIXFb3sZG2tMHLcIehzdf9NuR0L3eR/i2QwpmevM=; b=30BLehAGGl1WYIGX9XtQvM+MD7DpZtj0zuYkRHU3RtD8aEJotvleBc1MNpnvJ5XTfx H49Gj5ZzlyoIrhFV2AuAod8vr4V0OjVAJkIFqVJeGa0vFYIsoUPm9VdkzqE0zMbHbnDJ tThwNqbh8QE2DSagVmpdliYbmW1g/ZYZMBA2iOiDbQm3Wsytfh4pS0aKzhB9q8lbzHPS WJlnmn07rELGaRvltyAbpcQvLykp+xJs8QzniM+vp+kn0E/7JBJCIAElQ0/Nb45AVCrC aH7ED21/DQO+RFxC32t3JsWwEOWz+GQ0QfKXEeu4UTPaVBowFsJam9ISpl1jqQk1I3wg Dsyw== X-Gm-Message-State: AOAM533MOf1DT1EvOEEcs7c2M4CSeLVuF7mzs4IRk3DlBbCBqRTqQ6sw sEs0JuyjU7129OS4r1e7l5ymeJIDT50= X-Google-Smtp-Source: ABdhPJwZ4+2AU4DnjvthPbqd/Mc8bCc7RQxnlJsW354QPRhH8PyskmI74dKRqd1kGDoPxrft2oM2OQ== X-Received: by 2002:a5d:64e5:: with SMTP id g5mr1095891wri.282.1633140335555; Fri, 01 Oct 2021 19:05:35 -0700 (PDT) Original-Received: from krug ([87.196.156.235]) by smtp.gmail.com with ESMTPSA id h18sm7071199wrs.75.2021.10.01.19.05.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 19:05:34 -0700 (PDT) In-Reply-To: <8fc4f254-5dc0-f3c0-7a72-c217b154438a@yandex.ru> (Dmitry Gutov's message of "Sat, 2 Oct 2021 04:43:58 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=joaotavora@gmail.com; helo=mail-wr1-x42b.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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.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:276038 Archived-At: Dmitry Gutov writes: > Whatever search feature we end up implementing, should work on Elisp > code anywhere, inside or outside of Emacs core. Yes. xref-find-references is that feature for me. But my understanding is that you were somehow suggesting another, simpler method of having grep search by only the suffix. Which is a good idea, but -- as always -- needs some assumptions in the code. I'm just saying we shouldn't _force_ any code to be constrained to such assumptions. But if _some code_ happens to want to be constrained by those assumption, then your idea is valuable and should exist alongside xref-find-references. >> Rather, I think we must understand what the grep-inclined want to do. > I wasn't really describing what the users of Grep would do. If that > was the goal, prohibiting shorthands would be the answer. I'm not talking about what they _would_ do. Obviously they would Grep. But they don't grep gratutiously, they are trying to answer questions. If you give them tools that give those answers, maybe they will start using those tools. >> For example it might make sense to enforce some rules for external >> symbols (the ones that one commonly searches for across files) and >> others for internal symbols. > > I think the "private" symbols are largely irrelevant to this > discussion. Unless people really are (?) going to use shorthands for > them. I would. In fact, I would use them _prominently_ for private symbols, which are the vast majority of symbols I write and precisely where I feel most pain. eglot--this, eglot--that, eglot-test--foo. For definitions of external symbols, like '(defun eglot-super-important-bit () )' I would _not_ use them, precisely to safeguard answering some basic questions with "grep". That would be "my rule", at least a draft version of it. But also, like probably most people passionately discussing this feature, I too haven't really had time to even play around with it (I spend my Emacs hack budget writing e-mails ;-) ). >> What does that do? Returns nil here. I'd like the approach to work >> with Leo Liu's ack.el, for example, which is the particular 'grep' >> interface I use. It uses 'thingatpt'. > > Yes, sorry. That one was for 'find-tag' and 'xref-find-definitions' > with etags. > > Tools like ack-el indeed use thingatpt, though I wonder whether we > should add a new "thing" rather than change how 'symbol' works. That > is, consider whether any of the existing users might not like this > change. Yes, I also think we should add a new "thing". For your "grep-by-parts" idea, I mean, I hope that's understood. For xref-find-references, the 'symbol' is the thing. Jo=C3=A3o