From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#47240: Images Treated as Whitespace and Removed from Buffer Date: Sat, 3 Apr 2021 19:30:07 -0500 Message-ID: References: <87lfajmt00.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2845"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 47240@debbugs.gnu.org, "Spaulding, Jeff" To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 04 02:31:23 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 1lSqfj-0000dC-6p for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Apr 2021 02:31:23 +0200 Original-Received: from localhost ([::1]:41658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSqfi-00065C-72 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Apr 2021 20:31:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSqfP-00064Q-44 for bug-gnu-emacs@gnu.org; Sat, 03 Apr 2021 20:31:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51312) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lSqfO-0000QM-5v for bug-gnu-emacs@gnu.org; Sat, 03 Apr 2021 20:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lSqfO-0000Xm-0m for bug-gnu-emacs@gnu.org; Sat, 03 Apr 2021 20:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Apr 2021 00:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47240 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 47240-submit@debbugs.gnu.org id=B47240.161749621731992 (code B ref 47240); Sun, 04 Apr 2021 00:31:01 +0000 Original-Received: (at 47240) by debbugs.gnu.org; 4 Apr 2021 00:30:17 +0000 Original-Received: from localhost ([127.0.0.1]:34621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lSqee-0008JV-Ew for submit@debbugs.gnu.org; Sat, 03 Apr 2021 20:30:16 -0400 Original-Received: from mail-pg1-f169.google.com ([209.85.215.169]:35558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lSqeb-00088k-UM for 47240@debbugs.gnu.org; Sat, 03 Apr 2021 20:30:14 -0400 Original-Received: by mail-pg1-f169.google.com with SMTP id q10so5888382pgj.2 for <47240@debbugs.gnu.org>; Sat, 03 Apr 2021 17:30:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=RtMCMP3nZOE2InBZw0JL+SDJZ1A7e5Acyx3++2sFwGM=; b=ZmDJmlCcEojlX+qKCJaDOg/Fgzzux8PaqVXafIMBAJZcHabnuZA+8+6mxTSvLAqXS1 0Q9tqTZlGj2uaUxwCYvu8LQoZK2I7DRkIKOmudHSGEBRbhAj/MttBoC0mDG9O4RZ89Da kqdMPz5ies8TUHseVDEIV+mycdeiQ6VYeDhAqLq9prCvnrolO46DWKHQAlCrUujAn5WU Z1l3DOqyEOCgZZBJDAywOUItXCkdxwCOMKxC49BKrycio21gD4BUvaIwkA6V3LfDMsbz leQasPhfuqJPFKVl8Uaeq9YMSNhF/OEDBT2wtMVB9cxOIeF8IXhIkVkVRLLH64YUCvdi 7NXQ== X-Gm-Message-State: AOAM531F3Cz3ohRyzyNnIRBtLREmNVRmrTJynJfMC2gMa1UL0p3a/Y+h JDt6FbTpax2mgZnkYPuPMT7npr1ljuEBgjUEeko= X-Google-Smtp-Source: ABdhPJw8Hl9aR7Bieu2BssqRKmRXsNeW13A5phjsaX0dbq72ZOFGzVzWNpTJ6c+/Pd24mfVR4q3VSFJ2pvCLh/V/Wms= X-Received: by 2002:a65:4046:: with SMTP id h6mr17349167pgp.345.1617496208223; Sat, 03 Apr 2021 17:30:08 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 3 Apr 2021 19:30:07 -0500 In-Reply-To: <87lfajmt00.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 19 Mar 2021 09:45:35 +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:203505 Archived-At: Lars Ingebrigtsen writes: > "Spaulding, Jeff" writes: > >> Press M-: to bring up an Eval: prompt in the minibuffer. Enter the >> following elisp code: >> >> (insert-image (create-image "test.png")) >> >> The image will appear in the buffer. >> >> Press Enter. The image will disappear. >> >> The image seems to always be deleted if the enter key is pressed (bound >> to the newline function), but not when C-j is pressed (bound to the >> electric-newline-and-maybe-indent function). The image will not be >> deleted if there is any text following it on the line. This suggests >> the image is being treated as trailing whitespace, as trailing >> whitespace is treated in the same way. > > I think this is working basically as designed. By default, images are > whitespace and handled as such, but if you don't want that, you have to > say > > (insert-image (create-image "test.png") "*") > > or something like that. > > So I'm not sure whether there's anything to fix here. Does anybody else > have an opinion here? I agree that it seems to works as documented. Perhaps the docstring of `insert-image' could make this caveat more clear though?