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 02:46:24 +0100 Message-ID: <87y27c42rz.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> <87a6jsohbs.fsf@gmail.com> <875yugofxy.fsf@gmail.com> <79846850-25e0-b0cc-e59f-26f346c1e64d@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="40418"; 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 03:47:41 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 1mWU7p-000ABb-MI for ged-emacs-devel@m.gmane-mx.org; Sat, 02 Oct 2021 03:47:41 +0200 Original-Received: from localhost ([::1]:56410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWU7n-0000RU-UX for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Oct 2021 21:47:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWU6i-00083f-Ni for emacs-devel@gnu.org; Fri, 01 Oct 2021 21:46:32 -0400 Original-Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:37380) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWU6c-0003Jl-Ox for emacs-devel@gnu.org; Fri, 01 Oct 2021 21:46:32 -0400 Original-Received: by mail-wm1-x330.google.com with SMTP id j10-20020a1c230a000000b0030d523b6693so2029205wmj.2 for ; Fri, 01 Oct 2021 18:46:26 -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=i94v9kqK8f925lyCZRg8sPURgJuQoyufoZ8nhSLCb8U=; b=fL6RWgpVNJY0rhyNJ6ASqJwEmvN27E/zbZTaFHyW9sEm3PnsdtbZOyvjBscdAcNmIV 0NkGExsshNIxBGRvUPfQxnL3UGrO6qFI8URQOeBE8Bqt5Ih5pZM5uZrmkpf84iFfZu7p RDfHmVQQkKGlPisQK2gq63eLWp5gBTk+/eMONsxUHUIsDUaBD0TQ+Gh07bXw+vu7iriB 9PEcGSbCTsVaBcnqhbmISEjbZuXlpMvEa+RajwOC0I2a/phkQys8oN5kBODS6Hk7B1sH D4QP5u2cP+Jdbw6KSM9yN1BytHx+FQom0/tO867hgSXnYsf1pFR+RKKsxH/SrJ/Fts6e 1NTg== 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=i94v9kqK8f925lyCZRg8sPURgJuQoyufoZ8nhSLCb8U=; b=bWfXnqQhyjgOtJuQG9YsoaY0Zk5Te2cIVeB6C3oXTYDa9jgxwx3tP0ArHjVB7RsTOw /xQszrJm0p/4sfsw+GP5iTokKIWIXkH8Vcw8iJhf5X53IdvWuTjdz8o8IkPxPJyiWB4x U08PoOh/vV4g8oaQGmRY7/XTtRlw3X+l7/OPQeXm7y+uHmBinG86KZ7zxfPqAZuJoFox 5G3IWnxZanXuNMNqRnGKbrk1X39N8tu/S+UM8mp9KPbzSOz8iuu0D/dmtFttk/5Mnmat c46oeWplollcZ1EVYk6hwLBUc1/dx0wWgHvOXsJbdmj8BEdUaOitCZed1MLT7SG4zbAd TuXQ== X-Gm-Message-State: AOAM5326ZPF/+uCKtC54kaiSfyGFeYUHr+q/3gRNosUKUFEjEpxHbYRP grF0QesvHhNOFcYs3d+kdvtYmKBA0x0= X-Google-Smtp-Source: ABdhPJwS7W8UknmfM6/UEO+0kQZFl5JqaA6arGBJcRwVKnwY0llsPKr2yMjGhLV9k8iT8TD1xYGRUw== X-Received: by 2002:a05:600c:4ec6:: with SMTP id g6mr7370927wmq.95.1633139184308; Fri, 01 Oct 2021 18:46:24 -0700 (PDT) Original-Received: from krug ([87.196.156.235]) by smtp.gmail.com with ESMTPSA id w1sm9068966wmc.19.2021.10.01.18.46.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 18:46:23 -0700 (PDT) In-Reply-To: <79846850-25e0-b0cc-e59f-26f346c1e64d@yandex.ru> (Dmitry Gutov's message of "Sat, 2 Oct 2021 04:14:23 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=joaotavora@gmail.com; helo=mail-wm1-x330.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_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 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:276037 Archived-At: Dmitry Gutov writes: > On 01.10.2021 19:41, Jo=C3=A3o T=C3=A1vora wrote: > If analysis is implemented in Lisp, the concurrency will be limited by > that part. Though I guess you could launch multiple Emacs instances > and then combine their results somehow. Yes, that's exactly what I suggested. The combination is a sort operation, which isn't very heavy for a 1000 matches. >> * designing a caching strategy seems fairly easy here. > Probably doable, yes, though both harder than the approach I > described, and almost certainly slower even with cache (which needs > regular invalidation). And the first search in the session (without > cache to fall back on) will likely hurt the most. You can very well make big parts of the database when building, for example when byte-compiling. And you only invalidate when you change a file. > Anyway, good luck. I just hope you don't end up with etags-like > approach where the user will need to built and rebuild the index > manually every time they want it to be fresh. No that's not the goal. The goal is to make a proper symbolic xref-find-references for elisp which isn't regexp based (and which takes around 4-5 seconds here everytime, btw... and sometimes asks me if I want to apply local variables for a file it's visiting... bug?) Anyway, the reason I'm reasonably confident this _can_ be done is also because this _has_ been done, in Common Lisp implementations. That's were xref.el comes from, ultimately. They use even more advanced stuff, like macroexpansion, so they catch the make-foo of defstruct. Some implementations have even more advanced stuff like proper who-calls, who-sets, who-macroexpands. They've had it for decades! Have a look at SLIME or Sly and plug them to SBCL or Allegro Common Lisp, for example. Jo=C3=A3o