From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Generation of tags for the current project on the fly Date: Sun, 14 Jan 2018 18:21:00 +0200 Message-ID: <83y3l0za1f.fsf@gnu.org> References: <4559858d-eb32-d071-fdad-e51430700260@yandex.ru> <83shbb30z1.fsf@gnu.org> <8360863o6a.fsf@gnu.org> <27a58fb2-d2ee-e5fc-158d-ec41be401987@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1515946773 24936 195.159.176.226 (14 Jan 2018 16:19:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 14 Jan 2018 16:19:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 14 17:19:29 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 1eal0F-0005p2-W6 for ged-emacs-devel@m.gmane.org; Sun, 14 Jan 2018 17:19:24 +0100 Original-Received: from localhost ([::1]:47306 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eal2F-0006jn-Ar for ged-emacs-devel@m.gmane.org; Sun, 14 Jan 2018 11:21:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eal29-0006jW-Ad for emacs-devel@gnu.org; Sun, 14 Jan 2018 11:21:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eal24-0007nn-HC for emacs-devel@gnu.org; Sun, 14 Jan 2018 11:21:21 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eal24-0007nj-De; Sun, 14 Jan 2018 11:21:16 -0500 Original-Received: from [176.228.60.248] (port=2635 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eal23-0000fP-SW; Sun, 14 Jan 2018 11:21:16 -0500 In-reply-to: <27a58fb2-d2ee-e5fc-158d-ec41be401987@yandex.ru> (message from Dmitry Gutov on Sun, 14 Jan 2018 05:05:04 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:221955 Archived-At: > Cc: emacs-devel@gnu.org > From: Dmitry Gutov > Date: Sun, 14 Jan 2018 05:05:04 +0300 > > >>> We could offer generating a tags table if we don't find one in the > >>> tree, instead of generating it automatically. > >> > >> And then what? Visit it? > > > > No, just do what you intended, but only after an approval. It could > > be that the user thought she already visited a tags table, or some > > other mistake. > > OK, so if the user says yes, we "temporarily visit" to auto-generated > tags table. Then the user saves a file and that table get invalidated > (or via some other mechanism), and we want to index it again. Ask again? No, I think asking once per project should be enough. > >> Warm, probably. But that's the relevant time, isn't it? > > > > Not necessarily. The first time a tree is scanned could well be the > > shortly after you start working on a project. > > Not sure what you mean. The tree has to be scanned *sometime* at least > once, hasn't it? I mean the first time the tags table is required might very well be at the beginning of working on a project, at which time the project source tree is not yet in the cache. > For instance, could you try to see how long takes the generation of the > file list alone? And populating the buffer with it. But without passing > it to etags. What Lisp shall I use for that? > > Invoking 'find' will always be faster, as it's optimized for > > traversing directory trees. > > 'git ls-files' will probably be faster still. Yes, but that only works in Git repositories. > > No, TAGS is a standard target in GNU Makefile's. > > OK, good to know. Two questions, then: > > - Can we make it output the tags to stdout? Not likely. But you could just visit the TAGS file(s), no? > - Can we detect than a given Makefile has a proper TAGS target (that can > output to stdout)? Maybe CEDET has something, but if not, searching for ^TAGS: should be easy. > Not sure yet how to handle the TAGS files inclusions, though. "make TAGS" should handle it, as it does in Emacs.