GNU bug report logs - #32978
26.1; newline-and-indent duplicates displayed image

Previous Next

Package: emacs;

Reported by: Markus Triska <triska <at> metalevel.at>

Date: Sun, 7 Oct 2018 21:20:02 UTC

Severity: normal

Tags: notabug

Found in version 26.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 32978 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Markus Triska <triska <at> metalevel.at>
Cc: 32978 <at> debbugs.gnu.org
Subject: Re: bug#32978: 26.1; newline-and-indent duplicates displayed image
Date: Sun, 14 Oct 2018 17:38:02 +0300
> From: Markus Triska <triska <at> metalevel.at>
> Date: Sun, 07 Oct 2018 23:14:56 +0200
> 
> 
>     $ emacs -Q --eval='(progn (insert-image-file "test.png")
>                               (forward-char)
>                               (newline-and-indent))'
> 
> As a result, test.png is displayed twice, both in line 1 and in line 2.
> 
> In this case, I expect test.png to be displayed only in line 1.

Not sure why you expected that.  Perhaps you thought that forward-char
will move to after the image?  But that is a feature of the command
loop, and happens only after a command finishes, and Emacs is back to
the command loop.  It doesn't happen in the middle of a Lisp program.
So what your program did is insert a newline character in the middle
of text covered by a 'display' text property, and then the behavior
you observe is expected, right?

If I modify your program as follows:

  (let ((inserted (cadr (insert-image-file "test.png"))))
    (goto-char (1+ inserted))
    (newline-and-indent))

then only one image is displayed, on line 1.

If what forward-char does in this case is not the reason for your
expectations, please tell more about your reasoning.




This bug report was last modified 6 years and 33 days ago.

Previous Next


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