all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Al Haji-Ali <abdo.haji.ali@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: larsi@gnus.org, 62637@debbugs.gnu.org
Subject: bug#62637: 29.0.60; Issues when displaying images
Date: Mon, 03 Apr 2023 19:30:38 +0100	[thread overview]
Message-ID: <m2sfdglsxd.fsf@gmail.com> (raw)
In-Reply-To: <83iledudtc.fsf@gnu.org>

Thanks Lars for explaining.

I understand the issue now regarding indentation. I think passing a non-empty string to `insert-image` in `mml-inline-image` (and maybe by default in `insert-image`?) would be better IMO.

Regarding the overlay visibility, the issue for me was the different behaviour of `put-image` and `insert-image` in different cases. Which can be seen in the following example:

(let (content-begin content-end
      (img (create-image "/tmp/tmp.png")))
  (goto-char (point-max))

  (insert "\ninsert-image:\n")
  (setq content-begin (point))
  (insert-image img "I")
  (insert "\n")
  (setq content-end (point))
  (overlay-put (make-overlay content-begin content-end) 'invisible t)

  (insert "\nput-image without new line:\n")
  (setq content-begin (point))
  (put-image img (point-marker))
  (setq content-end (point))
  (overlay-put (make-overlay content-begin content-end) 'invisible t)
  
  (insert "\nput-image with new line:\n")
  (setq content-begin (point))
  (put-image img (point-marker))
  (insert "\n")
  (setq content-end (point))
  (overlay-put (make-overlay content-begin content-end) 'invisible t))

This code tests overlay visibility for images with three cases:
- using insert-image: as you explained this does not work as expected.
- using put-image: Since put-images uses an overlay, I guess the same logic applies.
- put-image with a newline: Seems to work for some reason. This is what `mml-inline-image` was using before and why notmuch was working.

Sorry for the noise. I am not sure there's a bug in this case, only unjustified expectations as you put it.

Best regards,
-- Al

On 03/04/2023, Eli Zaretskii wrote:
>
>
>> Cc: 62637@debbugs.gnu.org
>> Date: Mon, 03 Apr 2023 16:35:02 +0300
>> From: Eli Zaretskii <eliz@gnu.org>
>>
>> As for indentation: put-image uses a different default for the text on
>> which it puts the image 'display' property.  That explains why
>> re-indentation didn't remove the image in Emacs 28.
>
> Actually, put-image uses an overlay string with the 'display'
> property, so it doesn't put the property on buffer text, and thus
> re-indentation doesn't affect it.





  reply	other threads:[~2023-04-03 18:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-02 13:31 bug#62637: 29.0.60; Issues when displaying images Abdul-Lateef Haji-Ali via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-03 13:35 ` Eli Zaretskii
2023-04-03 16:32   ` Eli Zaretskii
2023-04-03 18:30     ` Al Haji-Ali [this message]
2023-04-03 18:42       ` Eli Zaretskii
2023-04-08 13:03   ` Eli Zaretskii

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=m2sfdglsxd.fsf@gmail.com \
    --to=abdo.haji.ali@gmail.com \
    --cc=62637@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    /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.