From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Generation of tags for the current project on the fly Date: Thu, 18 Jan 2018 03:14:49 +0300 Message-ID: <1fad0c79-cd65-df83-9dcc-2650fed4dad1@yandex.ru> References: <4559858d-eb32-d071-fdad-e51430700260@yandex.ru> <83shbb30z1.fsf@gnu.org> <8360863o6a.fsf@gnu.org> <27a58fb2-d2ee-e5fc-158d-ec41be401987@yandex.ru> <83y3l0za1f.fsf@gnu.org> <259c557d-e3a3-c01b-9ba3-30df09d247ea@yandex.ru> <83inc3znpu.fsf@gnu.org> <98f4f0c3-6815-bf86-fa23-1a330c60b9f3@yandex.ru> <87lggwkuth.fsf@tromey.com> <877esgqdhk.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1516234416 25916 195.159.176.226 (18 Jan 2018 00:13:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 18 Jan 2018 00:13:36 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Thunderbird/58.0 Cc: Eli Zaretskii , emacs-devel@gnu.org To: Tom Tromey Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 18 01:13:31 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebxpO-0005ED-3D for ged-emacs-devel@m.gmane.org; Thu, 18 Jan 2018 01:13:10 +0100 Original-Received: from localhost ([::1]:45467 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebxrM-0005qx-GQ for ged-emacs-devel@m.gmane.org; Wed, 17 Jan 2018 19:15:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebxr7-0005qC-QM for emacs-devel@gnu.org; Wed, 17 Jan 2018 19:14:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebxr2-0000TJ-RK for emacs-devel@gnu.org; Wed, 17 Jan 2018 19:14:57 -0500 Original-Received: from mail-lf0-x233.google.com ([2a00:1450:4010:c07::233]:33838) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebxr2-0000S2-IX; Wed, 17 Jan 2018 19:14:52 -0500 Original-Received: by mail-lf0-x233.google.com with SMTP id k19so4019005lfj.1; Wed, 17 Jan 2018 16:14:52 -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=1pCEUE8zTLxqxSi+ZZJloWNDIrFdcJqnkR+c0jnVQZc=; b=u6bvDosqoBTV35NwRMJVWMbnB4V7BRNLbMj2TCHCqXdzs9hc4Bc61kQiprQ48u7r4u PXZz/tC+ivrsvtxQ504PyTz5b08hkq7Ryeu6b4KIuZqdtlDivG3Xzcm+PnT9gEH2kZ8Q AIadmvWYgxBoFxmj5e0VRWNBV/i0jCiPUmehF2MszkULZthppdsTag3f8OWGo3VqvCya 0lgRPcDuKDexfzEi1Ui6GKTeCPVte/Vk9igsVQ2ClIr+rG7GFK8X/nqiFu4Md86d77Ko 4h0CKO9s7spolKL3+3g49vAt+p4ePupBU6NUq1zeM+qyEuw27LpPrZn/FC63K1PNjEx+ 5JZQ== 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=1pCEUE8zTLxqxSi+ZZJloWNDIrFdcJqnkR+c0jnVQZc=; b=AP2SLlfLzfC/3xTZLxcz9WPEnHjg8bVn9qmqlSEmhXpX1rUhwPCpKnPSLVl/uNtzCy xq/zViO18kl3TofZ/JVp8IXNq+AI7IS2OQOz5RNN4V47tlgfuF4rSLSYLNmHZtGpw1EU aLxSLt46Fg4UR108yIcNwbdImnPrkb2+uJuhYk2ckPVkOPAYLS7sXFL621iwQylLKPbu TcWvyEjznU8ZWxVHxElmOae2hF/LUzGEEr46M2plYM+eFtlqckaZ6IQiongbZPAt4/ll OfQHr/UqYqIoPxlMhzBuALXyo8gQrLHTNGSqiKATV44EIQrd6q76XCBi5OIj3nCsp+MB IfsA== X-Gm-Message-State: AKwxytfAB3VfYRCQ0hpLa0qAcJZzjW7cHLNQRXnM+yXt3+6AtY5bMCp2 5+uRbPf4HxPbzCFY2QopZtPYffJd X-Google-Smtp-Source: ACJfBovVQhCzNU7L+HRVTfG5uvzkiAmYMqWWh2PP6wBkKH4sUKP42Rgo5gvb51rHLUyjJnihGFS3DQ== X-Received: by 10.46.56.24 with SMTP id f24mr3435294lja.113.1516234490984; Wed, 17 Jan 2018 16:14:50 -0800 (PST) Original-Received: from [192.168.1.190] ([178.252.127.239]) by smtp.googlemail.com with ESMTPSA id n143sm984248lfb.71.2018.01.17.16.14.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jan 2018 16:14:50 -0800 (PST) In-Reply-To: <877esgqdhk.fsf@tromey.com> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:222065 Archived-At: On 1/18/18 02:20, Tom Tromey wrote: > Dmitry> ctags supports incremental updates? > > Yeah, see "-u" in "ctags --help": Cool. This is probably from Universal Ctags. Still not in Ubuntu (17.04, at least). > -u, --update > Update the tag entries for the given files, leaving tag > entries for other files in place. Currently, this is > implemented by deleting the existing entries for the given > files and then rewriting the new entries at the end of the > tags file. It is often faster to simply rebuild the entire > tag file than to use this. Seems like it updates the file in place. And your implementation copies the entries and allocates a new file. Any difference in performance that you noticed? > Dmitry> The config file duplicates some info in .gitignore and > Dmitry> project-vc-ignores, though. Which is unfortunate. > > True, but there are two reasons for this. One, there are still several > version control systems in use, and I didn't want to try to parse every > config file. I think it should work like: git ls-files | etags - Replace 'git ls-files' with an appropriate incantation for each VCS. > Second, sometimes a generated file will be checked in, but > you might still want to omit it from TAGS -- so some mechanism like this > is needed. Yup. This seems to work (excluding .clang_format; there's also an option to read additional ignores from a file): git ls-files -cdmo --exclude-standard -x .clang-format | etags - > Dmitry> I also doubt that 'make tags' will go away anytime soon. > > Sure, me too, but this approach is taken by more tools nowadays, and it > can live alongside "make tags". Is that true? The modern tools have taken the approach of duplicating the ignore lists? > Dmitry> Any chance your code supports something analogous to 'global > Dmitry> --single-update' (except with multiple file arguments, hopefully)? > Dmitry> That's what I've been trying to describe. > > It could certainly be done without much effort. Very good. Does it handle file deletions as well? >>> I suppose I could push my branch to git if that would be convenient. >>> Just let me know. > > Dmitry> I'm sure it would be helpful, even if only to study the approach. > > I pushed it to feature/etags-update. Thanks! I'll do some benchmarking if nobody beats me to it.