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: Wed, 13 Jan 2021 00:26:50 +0200 Message-ID: <09159508-db02-75f8-ec4e-692c62360905@yandex.ru> References: <779a6328-9ca5-202a-25a2-b270c66fe6dd@yandex.ru> <8fc5e96c-ebb8-c668-9b2a-c7c4ee54c0b9@yandex.ru> <83r1mwltob.fsf@gnu.org> <0bee9ab4-46bc-b6fd-97b6-e26cc80f1610@yandex.ru> <875z45dbm7.fsf@tromey.com> <1e9c9572-52ee-339b-78a2-731b9eb5f3de@yandex.ru> <871resd93f.fsf@tromey.com> <83mtxffrou.fsf@gnu.org> <106abdbb-ce7a-4911-0831-149da3dccfb3@yandex.ru> <83o8hudwgo.fsf@gnu.org> <8335z6dql2.fsf@gnu.org> <3c688f2e-a32c-63b8-235b-8ef92e87fe83@yandex.ru> <83y2gyca4z.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="12089"; 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, emacs-devel@gnu.org, john@yates-sheets.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 12 23:28:05 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 1kzS8y-00030S-P6 for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Jan 2021 23:28:04 +0100 Original-Received: from localhost ([::1]:58990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzS8x-00032g-Ot for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Jan 2021 17:28:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzS7w-0002DV-Qz for emacs-devel@gnu.org; Tue, 12 Jan 2021 17:27:01 -0500 Original-Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:44060) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kzS7t-00049j-SV; Tue, 12 Jan 2021 17:27:00 -0500 Original-Received: by mail-ed1-x530.google.com with SMTP id p22so4121909edu.11; Tue, 12 Jan 2021 14:26:56 -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=ZHhUTjsDKVYt/tFsMDCEqYreanZtIDt5iTuIwNHaiWw=; b=meeEuE3mINi3ubbx/lku8dva95NMk/QUCcs8g7upezXQet/hXmtAKI5lpxp6Lr5DJZ 3qw6BupRMjoU3V+EEYcIRvXslIY8w2T5K1kA7WIjmybyyzwPWKY6D2mtHUNPHWQ3Dnd4 CpqgHMJ5iBeW63KTrg7USBaSDlxa6iPNQQTZE8W9mleltX4ClpjZsz0fp+/+xxUbiVKn wenXy2aZTKlHBTj1pv3dU0YJgs5DDUwguGCtEnlUjvoLaoHQMl/my6dQkWljb4/Vaavl i10K316EgNcKvhzL7j9yxLHkC6ux4kTmz5fKVweWoXxlix/fwksuYf5BjMu6t4TUqD9y 0pMQ== 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=ZHhUTjsDKVYt/tFsMDCEqYreanZtIDt5iTuIwNHaiWw=; b=RGcxm/mTHohnDHG95+TEuajtQWDsmkTY9QaT+zr2v07/ma0LBDdWWAK4wcAR/XS3SF dp7Gm6wyntyZsMv8V2Cy2SeVWjr4jxQ+tEEvRTZYDD8MaDJhrkpajpFkwwwvCXPwDGku +ABpp6nutkIAEHFkg24lgMRtS+AH90rUq5jX7i5Aw0X982aykDaKlluHDw8yG52Wz8Lb q6gCL+0RZIX90NtVIkkjEhR3jQM9VHnlj1xDG+4BUsh/cbRtPrTBL+k3+icBOi6uVaQA gwqsL+AjmhvVYPAsOTbG7iuYejv2K1uyEgzOd3JgLEZYnGj+4ew+XcaM2UR174l1fklC um+A== X-Gm-Message-State: AOAM533onBiXKJVTQpy4mo6YbCRP5Pl7OMyUqXXdL+lOjuDXN6IoZxv8 r1CcNJzu1DxdlCn39YwT8F8EkCg5K8IIjw== X-Google-Smtp-Source: ABdhPJwdEoGXXVUPyOQaYhsg5s+nQEL2EX4QJEkvxA4m7Sti6n1g3zIyXmEE92DUkZ9d7UQXUkTL7A== X-Received: by 2002:a05:6402:40c4:: with SMTP id z4mr1022256edb.233.1610490414978; Tue, 12 Jan 2021 14:26:54 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id ch30sm17827edb.8.2021.01.12.14.26.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Jan 2021 14:26:53 -0800 (PST) In-Reply-To: <83y2gyca4z.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=raaahh@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, 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:263025 Archived-At: On 12.01.2021 19:55, Eli Zaretskii wrote: >> Cc: tom@tromey.com, john@yates-sheets.org, philipk@posteo.net, >> emacs-devel@gnu.org >> From: Dmitry Gutov >> Date: Tue, 12 Jan 2021 19:32:18 +0200 >> >>> What about regenerating etags only if M-. etc. fail to find an >>> identifier? >> >> There are downsides. >> >> You will have to press M-. twice sometimes with that approach. > > Why twice? I thought about regenerating automatically once the search > fails, then retrying the search with an updated tags table. Hm, I guess we can do that. Still, I try to navigate to unknown symbols often enough. It can be an unfamiliar class, I don't know if it's defined here or in some dependency library... If every time I did that Emacs froze for, say, a second, and I didn't know the reasoning for it, my opinion of the editor would get pretty low. So it might be a fine approach, but you have to know what it's doing and why. So, off by default. >> Completion will routinely fail to show some tags that should be present. >> Also, if the rescan takes a while, I'm not sure you'd want to do that on >> every 'M-.' failure. > > You could also regenerate when the user switches to another branch. > That's not a very frequent thing to do. That can be part of it. So far the options seem to be: - Brute-force it with project-files and 'stat', checking to see which files were added, which removed, and which ones have modtime more recent than the previous update. - Do something clever with Git. I.e. track the current revision, see whether it changed and which files changed with it, and also check the modtimes of untracked files. - inotify. Seems to be the most effort-intensive option. I've also seen the 'watchman' program (by Facebook) mentioned as pretty reliable, but depending on it is probably not great. Anyway, if you have any suggestions regarding how to write the file quicker (and why utf-8-emacs coding didn't help), that would be great.