GNU bug report logs - #9454
24.0.50; thingatpt.el should be updated to respect field boundaries

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Tue, 6 Sep 2011 23:20:03 UTC

Severity: wishlist

Found in version 24.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9454 in the body.
You can then email your comments to 9454 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9454; Package emacs. (Tue, 06 Sep 2011 23:20:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 06 Sep 2011 23:20:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.0.50; thingatpt.el should be updated to respect field boundaries
Date: Tue, 6 Sep 2011 16:14:57 -0700
I'm no expert on fields, to put it mildly.  But my impression is that
thing-at-point functions should not cross field boundaries.
 
I ran into this using a thing-at-point function (actually, a
thing-near-point function) in the minibuffer.  Now that (forward-line 0)
takes you across the field boundary and into the prompt field, I ended
up with "Text is read-only" errors.
 
(And just why is it an improvement to have two fields here?  What was
wrong with the (simple) situation before?)
 
To fix this I ended up splattering my own thing-at-point code with
`constrain-to-field' calls.  Butt ugly, but unless I'm missing something
(quite possible), unavoidable.
 
Anyway, this is a heads-up that you might want to take a look at
thingatpt.el and DTRT wrt field boudaries.  FWIW, my own code is here:
http://www.emacswiki.org/emacs/download/thingatpt%2b.el.  Among other
things, it contains fixes for Emacs bugs #8667, #8628, and #9300 (fixes
already communicated, but still not applied to vanilla Emacs).
 

In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-09-05 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.5) --no-opt'
 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9454; Package emacs. (Tue, 20 Aug 2019 02:48:02 GMT) Full text and rfc822 format available.

Message #8 received at 9454 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 9454 <at> debbugs.gnu.org
Subject: Re: bug#9454: 24.0.50; thingatpt.el should be updated to respect
 field boundaries
Date: Mon, 19 Aug 2019 19:47:00 -0700
"Drew Adams" <drew.adams <at> oracle.com> writes:

> I'm no expert on fields, to put it mildly.  But my impression is that
> thing-at-point functions should not cross field boundaries.
>
> I ran into this using a thing-at-point function (actually, a
> thing-near-point function) in the minibuffer.  Now that (forward-line 0)
> takes you across the field boundary and into the prompt field, I ended
> up with "Text is read-only" errors.

Do you have a test case to reproduce this bug?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9454; Package emacs. (Tue, 20 Aug 2019 15:27:02 GMT) Full text and rfc822 format available.

Message #11 received at 9454 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 9454 <at> debbugs.gnu.org
Subject: RE: bug#9454: 24.0.50; thingatpt.el should be updated to respect
 field boundaries
Date: Tue, 20 Aug 2019 08:26:34 -0700 (PDT)
[Message part 1 (text/plain, inline)]
> Do you have a test case to reproduce this bug?

No.

See the original report.  It points you to my
code that fixes the problem by sprinkling
`constrain-to-field' everywhere.

To give an idea, attached are two functions,
my version and the vanilla version.  Ediff
them.  See the additions of this:

 (constrain-to-field nil orig)

I believe that the vanilla function needs
similar protection.  For you to decide.

That's just one thingatpt.el function.  I
also added `constraint-to-field to other
such functions.

See thingatpt+.el if you want to see the
occurrences, to maybe save some time when
checking where thingatpt.el might need the
same treatment.

I think you get the idea.  Thing-at-point
should respect fields.  Do it or don't do
it; your choice.
[throw-my-thg.el (application/octet-stream, attachment)]
[throw-vanilla-thg.el (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9454; Package emacs. (Wed, 21 Aug 2019 20:12:02 GMT) Full text and rfc822 format available.

Message #14 received at 9454 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 9454 <at> debbugs.gnu.org
Subject: Re: bug#9454: 24.0.50; thingatpt.el should be updated to respect
 field boundaries
Date: Wed, 21 Aug 2019 13:11:06 -0700
Drew Adams <drew.adams <at> oracle.com> writes:

>> Do you have a test case to reproduce this bug?
>
> No.
>
> See the original report.  It points you to my
> code that fixes the problem by sprinkling
> `constrain-to-field' everywhere.

I understand the problem conceptually, but without a test case to verify
that there's a problem here in practice, it's difficult to say whether
the proposed fix fixes the problem.

This is why we (in the bug reporting process) encourage sending in test
cases, because that makes everything easier.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9454; Package emacs. (Wed, 25 Aug 2021 16:06:01 GMT) Full text and rfc822 format available.

Message #17 received at 9454 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 9454 <at> debbugs.gnu.org
Subject: Re: bug#9454: 24.0.50; thingatpt.el should be updated to respect
 field boundaries
Date: Wed, 25 Aug 2021 18:05:22 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I understand the problem conceptually, but without a test case to verify
> that there's a problem here in practice, it's difficult to say whether
> the proposed fix fixes the problem.

I've now pushed a fix to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 9454 <at> debbugs.gnu.org and "Drew Adams" <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 25 Aug 2021 16:06:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 23 Sep 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 216 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.