GNU bug report logs - #46552
27.1; image-mode should not move current point

Previous Next

Package: emacs;

Reported by: ynyaaa <at> gmail.com

Date: Tue, 16 Feb 2021 09:23:01 UTC

Severity: normal

Found in version 27.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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 46552 <at> debbugs.gnu.org, ynyaaa <at> gmail.com
Subject: bug#46552: 27.1; image-mode should not move current point
Date: Tue, 16 Feb 2021 18:32:26 +0200
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Tue, 16 Feb 2021 13:36:18 +0100
> Cc: 46552 <at> debbugs.gnu.org
> 
> This is most puzzling.  I can reproduce this problem in Emacs 28 without
> a problem.  But:
> 
> C-c C-c runs the command image-toggle-display (found in
> image-minor-mode-map), which is an interactive Lisp closure in
> ‘image-mode.el’.
> 
> If I instead say `M-: (image-toggle-display) RET' or even
> `M-: (call-interactively 'image-toggle-display) RET', I can't.
> 
> And `C-c C-c' should be totally equivalent to the latter, right?
> 
> So what's moving point?

It's the "point-adjustment" feature, which moves point out of
invisible/intangible/display-property/etc text, where we don't want
the user to see point, ever.  Try setting
global-disable-point-adjustment non-nil, and you will see what happens
when this is disabled.

> It must be some...  hook function or something that reacts
> differently to the two things...  but looking through the
> image-mode.el code, it's not obvious what that could be.

It's not in image-mode.el, it's a general feature of Emacs not
directly related to images.

> Anybody got any ideas here?

The point adjustment needs to decide whether to move point before or
after the display property.  Its logic is based on heuristics that can
break/change behavior depending on how the command was invoked,
because it's based on the previous value of point (if point moved
forward, the logic prefers to adjust point in the forward direction,
and vice versa).




This bug report was last modified 4 years and 191 days ago.

Previous Next


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