From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#46552: 27.1; image-mode should not move current point Date: Tue, 16 Feb 2021 18:32:26 +0200 Message-ID: <83y2fo7z39.fsf@gnu.org> References: <86v9astljs.fsf@gmail.com> <87blckxk8t.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3352"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46552@debbugs.gnu.org, ynyaaa@gmail.com To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 16 17:58:07 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lC3fq-0000iY-MO for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Feb 2021 17:58:06 +0100 Original-Received: from localhost ([::1]:45258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lC3fp-0002F5-No for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Feb 2021 11:58:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC3Hb-0000ua-NA for bug-gnu-emacs@gnu.org; Tue, 16 Feb 2021 11:33:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58044) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lC3Ha-000582-0I for bug-gnu-emacs@gnu.org; Tue, 16 Feb 2021 11:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lC3HZ-0003mK-Rm for bug-gnu-emacs@gnu.org; Tue, 16 Feb 2021 11:33:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Feb 2021 16:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46552 X-GNU-PR-Package: emacs Original-Received: via spool by 46552-submit@debbugs.gnu.org id=B46552.161349315314479 (code B ref 46552); Tue, 16 Feb 2021 16:33:01 +0000 Original-Received: (at 46552) by debbugs.gnu.org; 16 Feb 2021 16:32:33 +0000 Original-Received: from localhost ([127.0.0.1]:41357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lC3H6-0003lT-S1 for submit@debbugs.gnu.org; Tue, 16 Feb 2021 11:32:33 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lC3H5-0003lE-7z for 46552@debbugs.gnu.org; Tue, 16 Feb 2021 11:32:31 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54739) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lC3H0-00053z-0p; Tue, 16 Feb 2021 11:32:26 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1987 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lC3Gs-0003g5-Cg; Tue, 16 Feb 2021 11:32:21 -0500 In-Reply-To: <87blckxk8t.fsf@gnus.org> (message from Lars Ingebrigtsen on Tue, 16 Feb 2021 13:36:18 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:200131 Archived-At: > From: Lars Ingebrigtsen > 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).