GNU bug report logs -
#68900
29.1; Inconsistent Cursor Behavior when Executed as Lisp Code vs. Run by Key Binding
Previous Next
Reported by: Jaft <jaft.r <at> outlook.com>
Date: Fri, 2 Feb 2024 22:49:01 UTC
Severity: normal
Tags: notabug
Found in version 29.1
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Ahhh; you know, I was looking at Invisible Text (GNU Emacs Lisp Reference Manual) but missed the end where it talks about Adjusting Point. While I'd been wondering if "relocat[ing] point to the other side of the text" might be affecting this, I don't think I'd grasped that it'd be after the command runs, either.
Thanks so much for clarifying it (and pointing out where to look, in the documentation). Do I need to close this, in any way, or was you tagging it as "notabug" sufficient?
|
|
| |
Invisible Text (GNU Emacs Lisp Reference Manual)
Invisible Text (GNU Emacs Lisp Reference Manual)
|
|
|
On Saturday, February 3, 2024 at 01:31:09 AM CST, Eli Zaretskii <eliz <at> gnu.org> wrote:
tags 68900 notabug
thanks
> Date: Fri, 02 Feb 2024 16:47:57 -0600
> From: Jaft <jaft.r <at> outlook.com>
>
> This is where the inconsistent behavior is: if we M-: (forward-line -1)
> or M-: (previous-line) and, then, M-: (point), we'll get what (I would
> think) we'd expect: point 72, the point of the beginning of the second
> line.
>
> BUT, if we do the above via key-binding – i.e. if, from point 145, we
> press C-p to get to the line above – and, then, run M-: (point), we
> get back the number 1.
This is the point-adjustment feature in action: it moves point out of
the invisible text in the direction of the last movement. If you want
to disable it, set global-disable-point-adjustment to a non-nil value;
if you want to disable that temporarily in a Lisp program, set
disable-point-adjustment non-nil before invoking some cursor-movement
command. In your recipe, if you set global-disable-point-adjustment
non-nil, the behavior of previous-line, whether via M-: or C-p, will
be consistent: it will end at position 72.
This is not a bug, but the intended behavior. Read all about it in
the "Adjusting Point" section of the ELisp manual. Admittedly, this
feature can sometimes cause surprising behavior.
[Message part 2 (text/html, inline)]
This bug report was last modified 1 year and 109 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.