* bug#21271: 25.0.5; `field' text-property screws with `line-end-position'
@ 2015-08-15 21:59 Artur Malabarba
2015-08-15 22:34 ` Drew Adams
0 siblings, 1 reply; 3+ messages in thread
From: Artur Malabarba @ 2015-08-15 21:59 UTC (permalink / raw)
To: 21271
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).
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#21271: 25.0.5; `field' text-property screws with `line-end-position'
2015-08-15 21:59 bug#21271: 25.0.5; `field' text-property screws with `line-end-position' Artur Malabarba
@ 2015-08-15 22:34 ` Drew Adams
2015-08-15 23:10 ` Artur Malabarba
0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2015-08-15 22:34 UTC (permalink / raw)
To: bruce.connor.am, 21271
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).
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#21271: 25.0.5; `field' text-property screws with `line-end-position'
2015-08-15 22:34 ` Drew Adams
@ 2015-08-15 23:10 ` Artur Malabarba
0 siblings, 0 replies; 3+ messages in thread
From: Artur Malabarba @ 2015-08-15 23:10 UTC (permalink / raw)
To: Drew Adams; +Cc: 21271-done
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-08-15 23:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-15 21:59 bug#21271: 25.0.5; `field' text-property screws with `line-end-position' Artur Malabarba
2015-08-15 22:34 ` Drew Adams
2015-08-15 23:10 ` Artur Malabarba
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.