From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: pot@gnu.org, 73484@debbugs.gnu.org, spwhitton@spwhitton.name
Subject: bug#73484: 31.0.50; Abolishing etags-regen-file-extensions
Date: Thu, 10 Oct 2024 08:13:11 +0300 [thread overview]
Message-ID: <86o73s35i0.fsf@gnu.org> (raw)
In-Reply-To: <ba81b071-d5f4-4133-b5d6-e94684aec84b@gutov.dev> (message from Dmitry Gutov on Thu, 10 Oct 2024 01:22:13 +0300)
> Date: Thu, 10 Oct 2024 01:22:13 +0300
> Cc: pot@gnu.org, spwhitton@spwhitton.name, 73484@debbugs.gnu.org
> From: Dmitry Gutov <dmitry@gutov.dev>
>
> On 09/10/2024 22:11, Eli Zaretskii wrote:
>
> >> This is basically a "uniqueness" operation using linear search, O(N^2).
> >
> > Yes, this seems to be a protection against the same file name
> > mentioned more than once on the command line..
>
> Or, maybe more likely, against having symlinks scanned if the symlink
> target is also in the passed list.
Yes, that, but also any other possible ways of specifying the same
file twice, like having a file both compressed and uncompressed, etc.
> >> Is there a hash table we could use?
> >
> > Something like that should do, yes.
>
> Can we use search.h? hcreate/hsearch/etc. IIUC it's on in the C stndard,
> and
> https://www.gnu.org/savannah-checkouts/gnu/gnulib/manual/html_node/hcreate.html
> says it's available on certain platforms.
I think we shouldn't: it is not sufficiently portable and Gnulib
doesn't have an implementation for it for those platforms that don't
have it.
We could perhaps use the standard tsearch (although it will be more
expensive). Alternatively, we could steal the hash table code from
somewhere, for example, from Gawk.
> >> Or perhaps we would skip the search when the canonicalized name is the
> >> same as the original one.
> >
> > That's not the same as the loop above does, I think.
>
> If we assumed the duplicate check is only necessary for symlinks, and
> there is on average a small number of them, I think we could avoid using
> a hash table. But passing the same exact file 2 times would result in
> duplicate tags.
canonicalize_filename in etags.c does not resolve symlinks, AFAICT, so
the symlink scenario will not be solved by that. We'd need realpath
or its equivalent, I think?
next prev parent reply other threads:[~2024-10-10 5:13 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-20 9:20 etags-regen-mode: handling extensionless files Sean Whitton
2024-09-20 18:23 ` Dmitry Gutov
2024-09-22 12:02 ` Sean Whitton
2024-09-23 17:00 ` Dmitry Gutov
2024-09-25 6:21 ` Sean Whitton
2024-09-25 11:41 ` Dmitry Gutov
2024-09-25 19:27 ` bug#73484: 31.0.50; Abolishing etags-regen-file-extensions Sean Whitton
2024-09-25 22:30 ` Dmitry Gutov
2024-09-26 7:43 ` Francesco Potortì
2024-09-26 12:18 ` Dmitry Gutov
2024-09-29 8:25 ` Eli Zaretskii
2024-09-29 10:56 ` Eli Zaretskii
2024-09-29 17:15 ` Francesco Potortì
2024-09-30 23:19 ` Dmitry Gutov
2024-10-01 15:00 ` Eli Zaretskii
2024-10-01 22:01 ` Dmitry Gutov
2024-10-02 11:28 ` Eli Zaretskii
2024-10-02 18:00 ` Dmitry Gutov
2024-10-02 18:56 ` Eli Zaretskii
2024-10-02 22:03 ` Dmitry Gutov
2024-10-03 6:27 ` Eli Zaretskii
2024-10-04 1:25 ` Dmitry Gutov
2024-10-04 6:45 ` Eli Zaretskii
2024-10-04 23:01 ` Dmitry Gutov
2024-10-05 7:02 ` Eli Zaretskii
2024-10-05 14:29 ` Dmitry Gutov
2024-10-05 15:27 ` Eli Zaretskii
2024-10-05 20:27 ` Dmitry Gutov
2024-10-05 16:38 ` Francesco Potortì
2024-10-05 17:12 ` Eli Zaretskii
2024-10-06 0:56 ` Dmitry Gutov
2024-10-06 6:22 ` Eli Zaretskii
2024-10-06 19:14 ` Dmitry Gutov
2024-10-07 2:33 ` Eli Zaretskii
2024-10-07 7:11 ` Dmitry Gutov
2024-10-07 16:05 ` Eli Zaretskii
2024-10-07 17:36 ` Dmitry Gutov
2024-10-07 19:05 ` Eli Zaretskii
2024-10-07 22:08 ` Dmitry Gutov
2024-10-08 13:04 ` Eli Zaretskii
2024-10-09 18:23 ` Dmitry Gutov
2024-10-09 19:11 ` Eli Zaretskii
2024-10-09 22:22 ` Dmitry Gutov
2024-10-10 5:13 ` Eli Zaretskii [this message]
2024-10-10 1:07 ` Francesco Potortì
2024-10-10 5:41 ` Eli Zaretskii
2024-10-10 8:27 ` Francesco Potortì
2024-10-10 8:35 ` Eli Zaretskii
2024-10-10 14:25 ` Francesco Potortì
2024-10-10 16:28 ` Eli Zaretskii
2024-10-11 10:37 ` Francesco Potortì
2024-10-10 10:17 ` Dmitry Gutov
2024-10-10 1:39 ` Francesco Potortì
2024-10-10 5:45 ` Eli Zaretskii
2024-09-25 12:10 ` etags-regen-mode: handling extensionless files Eli Zaretskii
2024-09-25 21:19 ` Francesco Potortì
2024-09-26 6:22 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86o73s35i0.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=73484@debbugs.gnu.org \
--cc=dmitry@gutov.dev \
--cc=pot@gnu.org \
--cc=spwhitton@spwhitton.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.