GNU bug report logs - #21271
25.0.5; `field' text-property screws with `line-end-position'

Previous Next

Package: emacs;

Reported by: bruce.connor.am <at> gmail.com

Date: Sat, 15 Aug 2015 22:00:04 UTC

Severity: normal

Found in version 25.0.5

Done: Artur Malabarba <bruce.connor.am <at> gmail.com>

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 21271 in the body.
You can then email your comments to 21271 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 bug-gnu-emacs <at> gnu.org:
bug#21271; Package emacs. (Sat, 15 Aug 2015 22:00:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to bruce.connor.am <at> gmail.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 15 Aug 2015 22:00:05 GMT) Full text and rfc822 format available.

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

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.5; `field' text-property screws with `line-end-position'
Date: Sat, 15 Aug 2015 22:59:03 +0100
1. In an empty buffer, hit RET and type some text on the second line.
2. Place point at the start of the second line.
3. Run (line-end-position) and verify that the value is correct
(something greater than 3)
4. Run (add-text-properties (1- (point)) (point) '(field 1))
5. Run (line-end-position) and you'll get 2 (which is the poistion of
the end of the field).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21271; Package emacs. (Sat, 15 Aug 2015 22:35:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: bruce.connor.am <at> gmail.com, 21271 <at> debbugs.gnu.org
Subject: RE: bug#21271: 25.0.5; `field' text-property screws with
 `line-end-position'
Date: Sat, 15 Aug 2015 15:34:29 -0700 (PDT)
Confirmed.  This is the case as far back as property `field' has
existed, AFAICT.  (It is not the case for Emacs 20, which has no
built-in property `field'.  It is the case for Emacs 22.  Dunno
about 21.)

But this part of the doc string seems to indicate that this behavior
is to be expected:

 This function constrains the returned position to the current field
 unless that would be on a different line than the original,
 unconstrained result.  If N is nil or 1, and a rear-sticky field ends
 at point, the scan stops as soon as it starts.  To ignore field
 boundaries bind ‘inhibit-field-text-motion’ to t.

> 1. In an empty buffer, hit RET and type some text on the second
> line.
> 2. Place point at the start of the second line.
> 3. Run (line-end-position) and verify that the value is correct
> (something greater than 3)
> 4. Run (add-text-properties (1- (point)) (point) '(field 1))
> 5. Run (line-end-position) and you'll get 2 (which is the poistion
> of the end of the field).




Reply sent to bruce.connor.am <at> gmail.com:
You have taken responsibility. (Sat, 15 Aug 2015 23:11:01 GMT) Full text and rfc822 format available.

Notification sent to bruce.connor.am <at> gmail.com:
bug acknowledged by developer. (Sat, 15 Aug 2015 23:11:02 GMT) Full text and rfc822 format available.

Message #13 received at 21271-done <at> debbugs.gnu.org (full text, mbox):

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 21271-done <at> debbugs.gnu.org
Subject: Re: bug#21271: 25.0.5;
 `field' text-property screws with `line-end-position'
Date: Sun, 16 Aug 2015 00:10:33 +0100
Thanks Drew. I was so used to this function and so surprised about
this behavior that it didn't even occur to me to read the docstring
more carefully. That even explains how to prevent it.
I'm closing this now.




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

This bug report was last modified 9 years and 339 days ago.

Previous Next


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