From unknown Thu Jun 19 14:02:54 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#32978 <32978@debbugs.gnu.org> To: bug#32978 <32978@debbugs.gnu.org> Subject: Status: 26.1; newline-and-indent duplicates displayed image Reply-To: bug#32978 <32978@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:02:54 +0000 retitle 32978 26.1; newline-and-indent duplicates displayed image reassign 32978 emacs submitter 32978 Markus Triska severity 32978 normal tag 32978 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 07 17:19:21 2018 Received: (at submit) by debbugs.gnu.org; 7 Oct 2018 21:19:21 +0000 Received: from localhost ([127.0.0.1]:39699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g9GSO-000220-Tv for submit@debbugs.gnu.org; Sun, 07 Oct 2018 17:19:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50851) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g9GSN-00021m-03 for submit@debbugs.gnu.org; Sun, 07 Oct 2018 17:19:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9GSG-0001qe-JO for submit@debbugs.gnu.org; Sun, 07 Oct 2018 17:19:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52529) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g9GSF-0001qY-Hc for submit@debbugs.gnu.org; Sun, 07 Oct 2018 17:19:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9GSE-0002zb-Id for bug-gnu-emacs@gnu.org; Sun, 07 Oct 2018 17:19:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9GSB-0001pC-Cl for bug-gnu-emacs@gnu.org; Sun, 07 Oct 2018 17:19:10 -0400 Received: from metalevel.at ([78.46.218.83]:55656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9GSB-0001nH-56 for bug-gnu-emacs@gnu.org; Sun, 07 Oct 2018 17:19:07 -0400 Received: from debian (localhost.localdomain [127.0.0.1]) by metalevel.at (Postfix) with ESMTP id 4876DA03C4 for ; Sun, 7 Oct 2018 23:19:04 +0200 (CEST) Received: by debian (Postfix, from userid 1000) id 6FF1127747; Sun, 7 Oct 2018 23:14:56 +0200 (CEST) From: Markus Triska To: bug-gnu-emacs@gnu.org Subject: 26.1; newline-and-indent duplicates displayed image Date: Sun, 07 Oct 2018 23:14:56 +0200 Message-ID: <87k1mtcvcf.fsf@metalevel.at> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Please download test.png from: https://www.metalevel.at/ei/test.png and then invoke Emacs as follows: $ 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. In GNU Emacs 26.1 (build 1, i686-pc-linux-gnu, X toolkit, Xaw scroll bars) of 2018-05-29 built on debian Repository revision: 07f8f9bc5a51f5aa94eb099f3e15fbe0c20ea1ea Windowing system distributor 'The X.Org Foundation', version 11.0.11902000 System Description: Debian GNU/Linux 9.2 (stretch) From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 14 10:38:06 2018 Received: (at 32978) by debbugs.gnu.org; 14 Oct 2018 14:38:06 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 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 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 Date: Sun, 14 Oct 2018 17:38:02 +0300 Message-Id: <83tvlotwz9.fsf@gnu.org> From: Eli Zaretskii To: Markus Triska In-reply-to: <87k1mtcvcf.fsf@metalevel.at> (message from Markus Triska on Sun, 07 Oct 2018 23:14:56 +0200) Subject: Re: bug#32978: 26.1; newline-and-indent duplicates displayed image References: <87k1mtcvcf.fsf@metalevel.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 32978 Cc: 32978@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 14 16:40:54 2018 Received: (at 32978) by debbugs.gnu.org; 14 Oct 2018 20:40:54 +0000 Received: from localhost ([127.0.0.1]:49615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBnC2-0001oU-9S for submit@debbugs.gnu.org; Sun, 14 Oct 2018 16:40:54 -0400 Received: from metalevel.at ([78.46.218.83]:56488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBnC0-0001oL-4B for 32978@debbugs.gnu.org; Sun, 14 Oct 2018 16:40:52 -0400 Received: by metalevel.at (Postfix, from userid 1000) id 3D241A0462; Sun, 14 Oct 2018 22:40:50 +0200 (CEST) From: Markus Triska To: Eli Zaretskii Subject: Re: bug#32978: 26.1; newline-and-indent duplicates displayed image References: <87k1mtcvcf.fsf@metalevel.at> <83tvlotwz9.fsf@gnu.org> Date: Sun, 14 Oct 2018 22:40:50 +0200 In-Reply-To: <83tvlotwz9.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 14 Oct 2018 17:38:02 +0300") Message-ID: <87lg70mfcd.fsf@metalevel.at> User-Agent: Emacs/24.5 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32978 Cc: 32978@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> 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? Yes indeed! Since a single forward-char moves over the image when used interactively, I got the impression that the image is only a single character. From your code example, I see that this is not the case! I think a very good solution would be to document the return value of insert-image-file, i.e., to add to its description a statement such as: Returns list of absolute file name and number of characters inserted. What do you think? Thank you very much for looking into this! All the best, Markus From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 14 22:33:59 2018 Received: (at control) by debbugs.gnu.org; 15 Oct 2018 02:33:59 +0000 Received: from localhost ([127.0.0.1]:49688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBshj-0002GO-EI for submit@debbugs.gnu.org; Sun, 14 Oct 2018 22:33:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51431) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBshf-0002G9-Qn for control@debbugs.gnu.org; Sun, 14 Oct 2018 22:33:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gBshX-00007U-CM for control@debbugs.gnu.org; Sun, 14 Oct 2018 22:33:50 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBshX-00007M-8X; Sun, 14 Oct 2018 22:33:47 -0400 Received: from [176.228.60.248] (port=2626 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gBshW-0003PT-SW; Sun, 14 Oct 2018 22:33:47 -0400 Date: Mon, 15 Oct 2018 05:33:56 +0300 Message-Id: <83bm7wszu3.fsf@gnu.org> From: Eli Zaretskii To: Markus Triska In-reply-to: <87lg70mfcd.fsf@metalevel.at> (message from Markus Triska on Sun, 14 Oct 2018 22:40:50 +0200) Subject: Re: bug#32978: 26.1; newline-and-indent duplicates displayed image References: <87k1mtcvcf.fsf@metalevel.at> <83tvlotwz9.fsf@gnu.org> <87lg70mfcd.fsf@metalevel.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control Cc: 32978@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) tags 32978 notabug thanks > From: Markus Triska > Cc: 32978@debbugs.gnu.org > Date: Sun, 14 Oct 2018 22:40:50 +0200 > > > Not sure why you expected that. Perhaps you thought that forward-char > > will move to after the image? > > Yes indeed! Since a single forward-char moves over the image when used > interactively, I got the impression that the image is only a single > character. From your code example, I see that this is not the case! No, it's not. You can see in image-file.el that what insert-image-file does is insert the entire image file into the buffer, and then put a 'display' property over all those bytes. So the image spans many characters in this case. > I think a very good solution would be to document the return value of > insert-image-file, i.e., to add to its description a statement such as: > > Returns list of absolute file name and number of characters > inserted. > > What do you think? I was thinking the same; will do. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 19 15:28:25 2019 Received: (at 32978) by debbugs.gnu.org; 19 Apr 2019 19:28:25 +0000 Received: from localhost ([127.0.0.1]:44664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHZBQ-0004Zn-Tb for submit@debbugs.gnu.org; Fri, 19 Apr 2019 15:28:25 -0400 Received: from mail-qt1-f175.google.com ([209.85.160.175]:40746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHZBM-0004ZN-95; Fri, 19 Apr 2019 15:28:20 -0400 Received: by mail-qt1-f175.google.com with SMTP id v7so2867012qti.7; Fri, 19 Apr 2019 12:28:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Ex1sOTFWUb7czQmI+8O6Chv7iSfKTp9gy2uq7x1ZDiY=; b=RfHn2t7uB6qx4OoXucYPJ3f1WQC99X+kO4jbAE6xj1Jpuoj8uqRwTcQnCpr/AAVVFr eY085Hw8N7ZX4mCDHIUxQobnxkx/8aNqTPpbd+/2+/tYo4DHJAZjGQovk/j/zoMtK9Tg +Xj6wsOVEWkCTc67ssGhbxcPmd+A57qND0r8mJbLvQF49pHmdUxwiL8FjIlywUh/MMmG vXiIC+ngj1aDIeQOgYZNdlR4PQZp+7aATWNP2ZWQkp/okoFrzEkOXinjDkTGYJu/bgtp CbRnr1ARCQTQp4jHZCYIv1huy211257GW/LF2OBR2TqoxLhewbj6EumZfv+IUZ2xYJis eCLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Ex1sOTFWUb7czQmI+8O6Chv7iSfKTp9gy2uq7x1ZDiY=; b=cPrnUxKPcNLpMYncM2h7156JrcgucmFnZiJkd8wCGEScuBcFNZ2qcoBtF94GZoinO6 cZ0ze5Ax0qu8GDVH0A/4n95PoQ8ix2DB8M7M657A5YTUpo7O+cBIBPPddZ0RXqLWvL5H yugAi9xPwPYPwjZHPFupvcrS5OtNJbjeiDNqSM0kSXjNhFHkGC+Jr3Xgm5hmAOIPiJJb 4xeMs7D0SRFFuVYoveqU5wzccxV0eYBPb2YnKrNodJ8VhUI/NxcxJTBCtVDnIrroUdMT Afd7CMe+Q442wnG0e3Q7cbFnb6HtT2wdel6zvVoXQPrtWLHincP19Xwcu9yp2g9CZdas ESFA== X-Gm-Message-State: APjAAAWJ7ZCSLH7p9EjWHQeCI3RK23FGgYh3kknDJ3mYHD8uAoRffNKA Bacog5d6nhLrmMOrI/etnOyk6BQq X-Google-Smtp-Source: APXvYqw27Qc9HA3IoIcIi5kYHOu8fQ+eAh75ngBoxn7OafhMP6cbV92wbNlimG0lSxuf+qhFqZWbWQ== X-Received: by 2002:ac8:2295:: with SMTP id f21mr4843925qta.19.1555702094622; Fri, 19 Apr 2019 12:28:14 -0700 (PDT) Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id t2sm3433678qkd.57.2019.04.19.12.28.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Apr 2019 12:28:13 -0700 (PDT) From: Noam Postavsky To: Eli Zaretskii Subject: Re: bug#32978: 26.1; newline-and-indent duplicates displayed image References: <87k1mtcvcf.fsf@metalevel.at> <83tvlotwz9.fsf@gnu.org> <87lg70mfcd.fsf@metalevel.at> <83bm7wszu3.fsf@gnu.org> Date: Fri, 19 Apr 2019 15:28:12 -0400 In-Reply-To: <83bm7wszu3.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 15 Oct 2018 05:33:56 +0300") Message-ID: <878sw5vlpv.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32978 Cc: 32978@debbugs.gnu.org, Markus Triska X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 32978 quit Eli Zaretskii writes: >> I think a very good solution would be to document the return value of >> insert-image-file, i.e., to add to its description a statement such as: >> >> Returns list of absolute file name and number of characters >> inserted. >> >> What do you think? > > I was thinking the same; will do. Done now. 037970f1af 2019-04-19T15:19:45-04:00 "Document insert-image-file's return value (Bug#32978)" https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=037970f1af6c87767501ac6d46c50abe9d3f44e0 From unknown Thu Jun 19 14:02:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 18 May 2019 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator