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: Automatic (e)tags generation and incremental updates Date: Thu, 7 Jan 2021 17:56:57 +0200 Message-ID: <0bee9ab4-46bc-b6fd-97b6-e26cc80f1610@yandex.ru> References: <779a6328-9ca5-202a-25a2-b270c66fe6dd@yandex.ru> <8fc5e96c-ebb8-c668-9b2a-c7c4ee54c0b9@yandex.ru> <83r1mwltob.fsf@gnu.org> 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="34115"; 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: philipk@posteo.net, tom@tromey.com, john@yates-sheets.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 07 16:59:00 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 1kxXgi-0008lM-Ha for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Jan 2021 16:59:00 +0100 Original-Received: from localhost ([::1]:50268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxXgh-00067M-J7 for ged-emacs-devel@m.gmane-mx.org; Thu, 07 Jan 2021 10:58:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxXeq-0004KO-1E for emacs-devel@gnu.org; Thu, 07 Jan 2021 10:57:04 -0500 Original-Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:40175) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kxXeo-00058l-6l; Thu, 07 Jan 2021 10:57:03 -0500 Original-Received: by mail-wr1-x432.google.com with SMTP id 91so6128774wrj.7; Thu, 07 Jan 2021 07:57:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ScL0EWLASPUUNyNyopXtonx9uhlBAIBgtpmZPMLwz0M=; b=aa0otDHKguKIy+3tMxVGiPSdXxD8GkcNSg9lNaboOdqdyvlWU4HpE368ts0rpviJAb xzTpEKDee58ECqUGlarSl2pDsJjEzHFRJBTnuRrStE1y6GMMRMjGzHrAuiu2CSiQLuii 7cQVavXoLhtz8qgwLRgOoBnaAyKekOrt+1xmt9Khn5tkaPQR43XId7f0IFgKLixnLHq5 2JsjIx9VrfVcw1CTOvy0vDxWihkaYRHU58/6Oep8PLW6e543iWS+UCNJcB8l86prPtwa fLfNCNg7ObKM7pukf0LiL0I3LU8Cy15YPSNrRtWoMpZWwDJEdRHrtipEIWXqtaEUT5Oe bXGw== 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:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ScL0EWLASPUUNyNyopXtonx9uhlBAIBgtpmZPMLwz0M=; b=mut+Db3qekcYintznqPsQpPK4POkfscQ4KXaIpDgIhCojI70oATV0j0JUUWlrYZiCt BMa1mZX2LqM+sewUQ/+Y5pBkwhkTDnXajUxbpZ84ncbyZ8YhuRGx2kwdi9qtFInOPTpx V2PZCZWMdbaeInuYfEvGVqAtfmhiBvm4C1V0hOSVMvi+k6ipqEpYXx92vXsl6+50ERj6 UdknsZQ4HGPNWgiF5D/2hMBkqcWP/UTd2U7CiuEEBXxtBqD1nYdncbdsgwd9qXQA3JYE ZvG6O/LcH+cuKfHljDVIa51W2o1iJ2+7U3leaUwMBB1ucRJTysR7mJYNs7ZDpx40Xk8v u4BQ== X-Gm-Message-State: AOAM533frFL6Kc7fKPdBePIQA7/iFQ4MadEOPJ/aM29/5i1H9Jin/9o1 nGE3ae3/fhSGZJlWt64W94I= X-Google-Smtp-Source: ABdhPJz2vzjkPzsoZ7NSpDzYTgvQT98+bbg8p4agLR6FAy6ZlgLf1N+Nu2+ZvNwABxuG5I39LvTFTg== X-Received: by 2002:a05:6000:1152:: with SMTP id d18mr9682555wrx.6.1610035020472; Thu, 07 Jan 2021 07:57:00 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id v7sm8445615wma.26.2021.01.07.07.56.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Jan 2021 07:56:59 -0800 (PST) In-Reply-To: <83r1mwltob.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=raaahh@gmail.com; helo=mail-wr1-x432.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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, NICE_REPLY_A=-0.267, 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:262691 Archived-At: Hi Eli, On 07.01.2021 16:15, Eli Zaretskii wrote: > Thanks for working on this branch. > > However, it is hard to check it out without investing an inordinate > amount of time, without having some guidance: what features are added, > how they work, and what are the relevant commands to invoke them and > variables to control them. Would it be possible to post a short > summary of that? The changes are large, and when I looked at them, it > was hard for me to figure out what exactly are we gaining and how to > test that. The changes are now fairly small and non-invasive, you can review the diff like this: git diff master...scratch/etags-regen They include: - New file and new minor mode etags-regen-mode with 3 defcustom's (see the docstrings). - A change to .dir-locals.el which sets the value of one of those options, so that the resulting tags table for the Emacs project itself looks close enough to what 'make tags' generates. - A change to lib-src/etags.c which implements handing of '-L' flag, for compatibility with ctags. To try it out: - Start Emacs built from this branch and open, say, src/xdisp.c. - Call 'M-x etags-regen-mode' to enable it. - DO NOT call 'M-x visit-tags-table'. - Call some xref command like 'M-.'. See message "Generating new tags table..." (it's saved in /tmp/...), then see navigation happen. - Pressing C-M-i instead should also trigger tags table generation. - Rename some function, try navigating to the new name. That should work. Navigation to the previous name should fail (unless there are other definitions for that name). What doesn't work: - When you switch between projects, the previously generated tags tables are discarded. It's not too hard to improve, but that would involve some choices/tradeoffs. - When files are deleted, or otherwise changed outside of Emacs (perhaps with 'git checkout'), nothing is updated. I have a few new ideas, haven't started on them yet. Workaround: toggle etags-regen-mode off and on, which will result in full rescan when you use 'M-.'.