all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Markus Triska <triska@metalevel.at>
Cc: 32978@debbugs.gnu.org
Subject: bug#32978: 26.1; newline-and-indent duplicates displayed image
Date: Sun, 14 Oct 2018 17:38:02 +0300	[thread overview]
Message-ID: <83tvlotwz9.fsf@gnu.org> (raw)
In-Reply-To: <87k1mtcvcf.fsf@metalevel.at> (message from Markus Triska on Sun,  07 Oct 2018 23:14:56 +0200)

> From: Markus Triska <triska@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.





  reply	other threads:[~2018-10-14 14:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-07 21:14 bug#32978: 26.1; newline-and-indent duplicates displayed image Markus Triska
2018-10-14 14:38 ` Eli Zaretskii [this message]
2018-10-14 20:40   ` Markus Triska
2018-10-15  2:33     ` Eli Zaretskii
2019-04-19 19:28       ` Noam Postavsky

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=83tvlotwz9.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=32978@debbugs.gnu.org \
    --cc=triska@metalevel.at \
    /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.