GNU bug report logs -
#19188
point adjustemnt moves *into* invisible text
Previous Next
Reported by: Jonas Bernoulli <jonas <at> bernoul.li>
Date: Wed, 26 Nov 2014 03:10:02 UTC
Severity: normal
Tags: notabug
Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
When moving backward "point adjustment" which is supposed to move
point out of an invisible region may end up doing the opposite.
This problem exists at least in 24.3 and 24.4.
1. Yank this in an empty buffer in fundamental-mode and evaluate it.
(progn
(goto-char (point-min))
(insert "1\n"
(propertize "3\n" 'invisible t)
"5\n"
"7\n")
(backward-char 2))
2. The cursor is now on the "7", which also is the 7th character.
The buffer looks like
.-----
|1
|5
|7
|(progn
|...
`-----
The cursor sits on the "7" and
M-: (point) => 7
3. Move to "5" using e.g. C-p or C-b C-b.
The cursor is now on "5", which also is the 5th character.
However point is not were the cursor is
M-: (point) => 3
The problem is in the code that is supposed to move point *out* of an
invisible region, does the opposite when moving backward places point
on the first character after an invisible region. It moves to the
beginning of the preceding invisible region.
When point adjustment is disabled (non-nil disable-point-adjustment or
global-disable-point-adjustment) then this does not happen.
It also does not happen when moving forward, e.g. starting at "1"
C-p C-f places the cursor on "5" *and* point is also 5.
This bug report was last modified 10 years and 158 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.