From: Kang Niu <isgniuk@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>, Lars Ingebrigtsen <larsi@gnus.org>
Cc: 52593@debbugs.gnu.org
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 [thread overview]
Message-ID: <CAOa1fPtprXs7x62FA1Ufhh_mm0bu3OOAq=M9JRc7kiVeqFJ3OQ@mail.gmail.com> (raw)
In-Reply-To: <83ee689156.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2319 bytes --]
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
>
[-- Attachment #2: Type: text/html, Size: 3013 bytes --]
next prev parent reply other threads:[~2021-12-22 2:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-18 5:59 bug#52593: 28.0.90; (thing-at-point thing) has so much overhead since commit 7db376e560448e61485ba054def8c82b21f33d6a Kang Niu
2021-12-18 7:48 ` Eli Zaretskii
[not found] ` <CAOa1fPsPmyHpzyT8AUzkc4vFGCJXgWJ3NVjGg=99hF4b8AuaWQ@mail.gmail.com>
2021-12-19 13:26 ` Eli Zaretskii
2021-12-19 13:35 ` Lars Ingebrigtsen
2021-12-19 14:39 ` Kang Niu
2021-12-19 14:44 ` Lars Ingebrigtsen
2021-12-19 15:19 ` Kang Niu
2021-12-19 15:37 ` Kang Niu
2021-12-19 15:49 ` Lars Ingebrigtsen
2021-12-19 15:55 ` Lars Ingebrigtsen
2021-12-19 16:14 ` Lars Ingebrigtsen
[not found] ` <CAOa1fPuD=gVEF-SKtvuu4jkzu3p40xUBoejBjUrv-v0kDrc0qg@mail.gmail.com>
2021-12-20 9:24 ` Lars Ingebrigtsen
2021-12-19 16:22 ` Lars Ingebrigtsen
2021-12-19 17:21 ` Lars Ingebrigtsen
2021-12-19 17:33 ` Lars Ingebrigtsen
2021-12-19 17:38 ` Eli Zaretskii
2021-12-20 9:23 ` Lars Ingebrigtsen
2021-12-20 17:23 ` Eli Zaretskii
2021-12-21 11:03 ` Lars Ingebrigtsen
2021-12-22 2:44 ` Kang Niu [this message]
2021-12-22 12:52 ` Lars Ingebrigtsen
2021-12-24 22:43 ` bug#52593: [External] : " Drew Adams
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAOa1fPtprXs7x62FA1Ufhh_mm0bu3OOAq=M9JRc7kiVeqFJ3OQ@mail.gmail.com' \
--to=isgniuk@gmail.com \
--cc=52593@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=larsi@gnus.org \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).