all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 46552@debbugs.gnu.org, ynyaaa@gmail.com
Subject: bug#46552: 27.1; image-mode should not move current point
Date: Tue, 16 Feb 2021 18:32:26 +0200	[thread overview]
Message-ID: <83y2fo7z39.fsf@gnu.org> (raw)
In-Reply-To: <87blckxk8t.fsf@gnus.org> (message from Lars Ingebrigtsen on Tue,  16 Feb 2021 13:36:18 +0100)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Tue, 16 Feb 2021 13:36:18 +0100
> Cc: 46552@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).





  reply	other threads:[~2021-02-16 16:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16  9:21 bug#46552: 27.1; image-mode should not move current point ynyaaa
2021-02-16 12:36 ` Lars Ingebrigtsen
2021-02-16 16:32   ` Eli Zaretskii [this message]
2021-02-16 16:40     ` Lars Ingebrigtsen
2021-02-16 16:43       ` Lars Ingebrigtsen
2021-02-16 17:04       ` Eli Zaretskii
2021-02-16 17:09         ` Lars Ingebrigtsen
2021-02-16 17:39           ` Eli Zaretskii
2021-02-16 17:41             ` Lars Ingebrigtsen
2021-02-16 17:53               ` Eli Zaretskii
2021-02-16 21:46                 ` Lars Ingebrigtsen
2021-02-16 17:57           ` Eli Zaretskii
2021-02-16 18:10             ` Lars Ingebrigtsen
2021-02-16 17:17       ` Juri Linkov
2021-02-16 16:24 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83y2fo7z39.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=46552@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=ynyaaa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.