From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#32978: 26.1; newline-and-indent duplicates displayed image Date: Sun, 14 Oct 2018 17:38:02 +0300 Message-ID: <83tvlotwz9.fsf@gnu.org> References: <87k1mtcvcf.fsf@metalevel.at> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1539527826 429 195.159.176.226 (14 Oct 2018 14:37:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 14 Oct 2018 14:37:06 +0000 (UTC) Cc: 32978@debbugs.gnu.org To: Markus Triska Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 14 16:37:02 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBhVu-0008SZ-3Q for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Oct 2018 16:37:02 +0200 Original-Received: from localhost ([::1]:48596 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBhY0-0005DQ-GT for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Oct 2018 10:39:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBhXt-0005DL-89 for bug-gnu-emacs@gnu.org; Sun, 14 Oct 2018 10:39:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gBhXq-0004tr-0y for bug-gnu-emacs@gnu.org; Sun, 14 Oct 2018 10:39:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45170) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gBhXp-0004tg-TI for bug-gnu-emacs@gnu.org; Sun, 14 Oct 2018 10:39:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gBhXp-00082N-Ls for bug-gnu-emacs@gnu.org; Sun, 14 Oct 2018 10:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Oct 2018 14:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32978 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32978-submit@debbugs.gnu.org id=B32978.153952788630829 (code B ref 32978); Sun, 14 Oct 2018 14:39:01 +0000 Original-Received: (at 32978) by debbugs.gnu.org; 14 Oct 2018 14:38:06 +0000 Original-Received: from localhost ([127.0.0.1]:49428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBhWw-00081B-5F for submit@debbugs.gnu.org; Sun, 14 Oct 2018 10:38:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42176) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBhWt-00080d-TV for 32978@debbugs.gnu.org; Sun, 14 Oct 2018 10:38:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gBhWl-0004Fw-I3 for 32978@debbugs.gnu.org; Sun, 14 Oct 2018 10:37:58 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBhWl-0004Fo-DW; Sun, 14 Oct 2018 10:37:55 -0400 Original-Received: from [176.228.60.248] (port=1661 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gBhWl-0003Vz-0T; Sun, 14 Oct 2018 10:37:55 -0400 In-reply-to: <87k1mtcvcf.fsf@metalevel.at> (message from Markus Triska on Sun, 07 Oct 2018 23:14:56 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:151236 Archived-At: > From: Markus Triska > 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.