unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Spaulding, Jeff" <jeff.spaulding@englobal.com>
To: Stefan Kangas <stefan@marxist.se>, Lars Ingebrigtsen <larsi@gnus.org>
Cc: "47240@debbugs.gnu.org" <47240@debbugs.gnu.org>
Subject: bug#47240: Images Treated as Whitespace and Removed from Buffer
Date: Sun, 4 Apr 2021 00:37:37 +0000	[thread overview]
Message-ID: <DM6PR14MB34989E8836C02200CACAE7B6EB789@DM6PR14MB3498.namprd14.prod.outlook.com> (raw)
In-Reply-To: <CADwFkm=qQ-8nYvCPB_rg4Krw5MAOKTjjyDWRMY=fhuBjmuRUcA@mail.gmail.com>

Assuming that images being treated as whitespace is the intended behavior (which I think is odd, but I can accept), I feel that a documentation change would be sufficient.

I was surprised by the fact that images were treated as whitespace.  It doesn't seem intuitive that an image would be treated the same as an invisible piece of text.

Documenting this would prevent others from having to go through the confusion I did, however.

-----Original Message-----
From: Stefan Kangas [mailto:stefan@marxist.se] 
Sent: Saturday, April 3, 2021 7:30 PM
To: Lars Ingebrigtsen
Cc: Spaulding, Jeff; 47240@debbugs.gnu.org
Subject: Re: bug#47240: Images Treated as Whitespace and Removed from Buffer

Lars Ingebrigtsen <larsi@gnus.org> writes:

> "Spaulding, Jeff" <jeff.spaulding@englobal.com> 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?

  reply	other threads:[~2021-04-04  0:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18  1:04 bug#47240: Images Treated as Whitespace and Removed from Buffer Spaulding, Jeff
2021-03-19  8:45 ` Lars Ingebrigtsen
2021-04-04  0:30   ` Stefan Kangas
2021-04-04  0:37     ` Spaulding, Jeff [this message]
2021-04-04 19:48     ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM6PR14MB34989E8836C02200CACAE7B6EB789@DM6PR14MB3498.namprd14.prod.outlook.com \
    --to=jeff.spaulding@englobal.com \
    --cc=47240@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=stefan@marxist.se \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).