bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#52593: 28.0.90; (thing-at-point thing) has so much overhead since co


From: Kang Niu
Subject: bug#52593: 28.0.90; (thing-at-point thing) has so much overhead since commit 7db376e560448e61485ba054def8c82b21f33d6a
Date: Wed, 22 Dec 2021 10:44:27 +0800

Maybe an optional arg for thing-at-point is necessary to respect fields?
As I understand, it should be determined by the user of thing-at-point to get what kind of thing at point.
If the user knows or expects fields in the text, he passes the optional arg.
If the user just wants the "normal" thing at the point whether there are fields or not, he calls it without the opt arg as the old way.

Eli Zaretskii <eliz@gnu.org> 于2021年12月19日周日 21:26写道:
[Forwarding to the bug tracker.  Please use Reply All to keep the bug
tracker on the CC list.]

> From: Kang Niu <isgniuk@gmail.com>
> Date: Sun, 19 Dec 2021 21:07:24 +0800
>
> Thanks for your reply. I'v added two lines of code at the beginning of narrow-to-region and made a test.
>
> 2681   EMACS_INT s = fix_position (start), e = fix_position (end);
> 2682   if (BEGV == s && ZV == e)
> 2683     return Qnil;
>
> The overhead was still there with little improvement.

That is very strange, since the code is almost a no-op.

Does field-beginning and field-end indeed return BOB and EOB in that
case?  Maybe field-beginning and field-end take this time?

> The overhead disappears only if I comment out (narrow-to-region (field-beginning) (field-end)) in
> thing-at-point.

Perhaps thing-at-point should acquire a new optional argument saying
"don't pay attention to fields"?

> It is unnoticed but with some modes that call thing-at-point in post-command-hook, it's unbearable.
>
> OS:
> ArchLinux with gcc-11.1.0
> &
> Ubuntu16.04 with gcc-9
>
> configuration:
> ./configuration 'CFLAGS=-O2 -pipe' --prefix=/usr --libdir=/usr/lib --sysconfdir=/etc --libexecdir=/usr/lib
> --localstatedir=/var --without-x --with-x-toolkit=no --without-xwidgets --without-toolkit\
> -scroll-bars --without-dbus --without-gsettings --without-gconf --without-xim --without-xpm --without-jpeg
> --without-tiff --without-gif --without-png --without-rsvg --without-imagem\
> agick --without-lcms2 --without-libsystemd --without-selinux --without-xaw3d --without-gpm --with-sound=no
> --without-xft --without-libotf --without-cairo --without-harfbuzz --withou\
> t-m17n-flt --with-modules --without-compress-install

reply via email to

[Prev in Thread] Current Thread [Next in Thread]