all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Lars Ingebrigtsen <larsi@gnus.org>, Kang Niu <isgniuk@gmail.com>
Cc: "52593@debbugs.gnu.org" <52593@debbugs.gnu.org>
Subject: bug#52593: [External] : bug#52593: 28.0.90; (thing-at-point thing) has so much overhead since commit 7db376e560448e61485ba054def8c82b21f33d6a
Date: Fri, 24 Dec 2021 22:43:00 +0000	[thread overview]
Message-ID: <SJ0PR10MB54881785AC4B3AB112C256A9F37F9@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87h7b0er9q.fsf@gnus.org>

> > 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.

That's right - or almost so.  It's definitely right
that thing-at-point functions should not, on their
own and systematically, limit their check/search to
a field that might be present.  That would be awful.

But I think it should not just be an argument to
thing-at-point functions that controls/decides this.

Users, not just Lisp code, should be able to control
whether thing-at-point functions limit checking to a
field at point (when a field is present).

That means either a user option or a defvar that
users and code can bind, to get the behavior they
want.  But this question of how/where to tell
a thing-at-point function what to do about fields
is a secondary question.
___

I disagree strongly with Lars that from now on all
code that uses thing-at-point functions should
have its behavior changed to always respect a field
at point.  That would not only break existing code;
it would be inflexible for no reason.

IIUC, this is essentially about wanting to add a
NEW feature, which is that thing-at-point functions
can BE ABLE to return a thing (of the given kind),
while limiting the check/search to a field at point.

There's nothing wrong with adding that possibility,
as an optional feature.  It would be terribly wrong
to just impose such (backward incompatible) behavior
going forward.

Again: IIUC.

> If a package uses fields to make the buffer more
> understandable, then other packages like symbol-overlay
> should use those fields automatically without having to
> be altered.

Other packages "should"?  No.  Other packages should
perhaps _be able_ to.  Let's not be draconian, please.

Just because one package uses fields to "make the
buffer more understandable", it does not follow that
all (or even any) other packages want or need to
take that particular understandability into account
when checking for a particular kind of thing at
point.  That doesn't follow at all.

You have no way of knowing what some arbitrary other
package might want to do.  Supposing that all packages
must want to respect fields that are provided by some
package (for all of their behavior no less!) is, well,
misguided.

> Ideally the way to make this work would be to change all the thingatp
> functions to do their normal thing, but then see whether there's any
> field separators in that area, and if so, recalculate the "thing".

No, definitely not.  Thing-at-point functions can be
made _able_ to "recalculate the thing".  They should
not do so systematically or generally.

> I think at this point, the way forward is to revert this change on
> emacs-28 to fix the performance regression, and then open a new bug
> report for this.  So I'll do both now.

The bug is not just a performance one (IIUC).  The
bug is in the misguided design that limitation to a
field is what thing-at-point functions should always,
or even generally or by default, do.

Adding the ability to respect a field at point makes
sense.  The fact that a buffer has been given fields
should not, by itself, control what thing-at-point
functions do.  It can reasonably _inform_ what they do.






      reply	other threads:[~2021-12-24 22:43 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
2021-12-22 12:52         ` Lars Ingebrigtsen
2021-12-24 22:43           ` Drew Adams [this message]

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=SJ0PR10MB54881785AC4B3AB112C256A9F37F9@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=52593@debbugs.gnu.org \
    --cc=isgniuk@gmail.com \
    --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 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.