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: Sun, 21 Jan 2018 15:26:27 +0300 Message-ID: <854cd0fd-5e4f-771a-0f58-b94373a2f98c@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> <1fad0c79-cd65-df83-9dcc-2650fed4dad1@yandex.ru> <76696ae3-318c-bb83-bbf9-a4f8680114ba@yandex.ru> <87lggsnkwc.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: 8bit X-Trace: blaine.gmane.org 1516537532 32302 195.159.176.226 (21 Jan 2018 12:25:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 21 Jan 2018 12:25:32 +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 Sun Jan 21 13:25:27 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 1edEgR-0007CC-1Y for ged-emacs-devel@m.gmane.org; Sun, 21 Jan 2018 13:25:11 +0100 Original-Received: from localhost ([::1]:53600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edEiR-0006Oc-Dt for ged-emacs-devel@m.gmane.org; Sun, 21 Jan 2018 07:27:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edEho-0006O6-2e for emacs-devel@gnu.org; Sun, 21 Jan 2018 07:26:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edEhk-0004an-Tt for emacs-devel@gnu.org; Sun, 21 Jan 2018 07:26:36 -0500 Original-Received: from mail-lf0-x236.google.com ([2a00:1450:4010:c07::236]:34557) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1edEhk-0004ZE-MB; Sun, 21 Jan 2018 07:26:32 -0500 Original-Received: by mail-lf0-x236.google.com with SMTP id k19so7276291lfj.1; Sun, 21 Jan 2018 04:26:32 -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=abAZRhYh3moblBvJhLkoG319El2Z6Sid/Ny5/zso8KA=; b=n0/uRVJq9VcEX1zmTPfmxFDWnXqhDHAP3qYU0AtQlIwA0V4UydeNlPgyP/Sbq+VvVh Tv8+Q9C9qX052GKTPRuiHzPdc9C+4WemJoHaanjtCQXpF81zq5in/+VHEcQnw8O/cLBc uHy9HjkzilPA+DXcuJA87wS+DAdXCP0ujATXm8e3VyDjiRwxA0qoaCnrAb5jGUAHvDYK i5lZ1+1GE4bOFWp29hpbgAjkke4Kdjbrk6BYUmeqMeqylVcLdB9MpVwvGv1IeGbENvTj 1KkbY7Me+I1x8JdiMmY0OToHjtIneq+gMo+4nYpUaRhHo2KcXfX4XAb0ms3GHZylfW9/ vtyg== 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=abAZRhYh3moblBvJhLkoG319El2Z6Sid/Ny5/zso8KA=; b=py6T0N1aRpi5Uq3fUFpZxh/wBbH/gF7CXpdQW1oIdo/Od64xD7eIZ0Ua3ZLgOxBj7x j3gO2sAqRN9d2zWXrbxNwouPsqRsa4dyzMSVO3OQvpnf+XViwdAxLCD02Xpr4mtnz7Tq gydN9lSioBANAofZgg2f8aCFzXOuL/UMfB+vKZBhyrZgLhdRNTNqrgwTHi/AaJr46x1u N3lJy+WdH/fUuAhcu8VQefqvsXX9AV4cuY2UdytUujcx+JiKfeOgbY2KSveeLmJk5hZR zqpCgUmfGSGA55/9huIWGyD19eCFxjgRlUARSvPyL7tIl/gfi7bTBWQofgRGMY5M5kp7 z3lw== X-Gm-Message-State: AKwxytfJzqKXyTY0buWOzDzZTxD2bv4Y0nwGYXzIoEA7/oj+qv6LceK4 J9AkZFenThjmJrEtNLYhH0koNBfX X-Google-Smtp-Source: AH8x225RJ4hXbIxMuFuMeCxyP/BtDnch/1X+b18tdJsgB6DFB/L8VebzPxmTv1GbJitIjmCGL8Rnmg== X-Received: by 10.25.75.132 with SMTP id y126mr1727923lfa.122.1516537590841; Sun, 21 Jan 2018 04:26:30 -0800 (PST) Original-Received: from [192.168.1.174] ([178.252.127.239]) by smtp.googlemail.com with ESMTPSA id i65sm2283983lfb.11.2018.01.21.04.26.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Jan 2018 04:26:29 -0800 (PST) In-Reply-To: <87lggsnkwc.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::236 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:222123 Archived-At: On 1/21/18 2:57 AM, Tom Tromey wrote: > Dmitry> 3. 'lib-src/etags src/category.c -u -o TAGS' results in having only > Dmitry> that file's tags inside TAGS (before, it contained the entries for all > Dmitry> .c files). This behavior contradicts the help and stops the rest of my > Dmitry> testing in its tracks. > > Another bug on my part, I think I've fixed it now. Thanks! It's working better now, but here's another experiment: ~/v/emacs-master (feature/etags-update|…) $ make tags ~/v/emacs-master (feature/etags-update|…) $ echo src/doc.c | lib-src/etags - -u -o src/TAGS ~/v/emacs-master (feature/etags-update|…) $ echo src/doc.c | lib-src/etags - -u -o src/TAGS lib-src/etags: invalid TAGS file Also getting the same result after a third call to 'etags --find'. > The next question for you is how you want it to work. > > Right now there are two modes: > > * The old mode (but with the possibility of -u) That's how I'm going to use it for now. BTW, '--find' looks consistently slower here than 'find -name "*.rb" |': $ bash -c "time find . -name \"*.rb\" | ~/vc/emacs-master/lib-src/etags - -o TAGS" real 0m0,215s user 0m0,200s sys 0m0,116s $ rm TAGS $ bash -c "time ~/vc/emacs-master/lib-src/etags --find" real 0m0,329s user 0m0,180s sys 0m0,136s $ cat .etags !* *.rb > * --find mode -- which implies -u. The .etags file is only read in find > mode. Not sure --find should always imply -u, actually (or '-o TAGS'). Might be harder for debugging. Also, '--find' doesn't deal with deleted files, so you'll delete one, call '--find', and the entry will remain in TAGS. Anyway, my intention for now is to cherry-pick the '-u' feature as soon as it's working well. Nothing against '--find', but it should probably be a separate discussion. > My idea for this code was to use locate-dominating-file to find the > .etags file and just run "etags --find" from there on save. That would complicate things somewhat, especially when .etags is not a VC root of the project. You could create a .etags based project type, though. > However I know you'd like to use git ls-files, and maybe other things -- > you mentioned correctly handling file deletions. Speaking of deletions, this is not strictly necessary (we could just delete the whole TAGS and recreate), but it would be helpful if, when passed a non-existing file that is in TAGS, 'etags -u' deleted it from the index. Right now, it only complains "No such file or directory", but keeps it in the index.