all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Markus Triska <triska@metalevel.at>
Cc: 52929@debbugs.gnu.org
Subject: bug#52929: 27.1; Images are sometimes not fully displayed
Date: Sat, 1 Jan 2022 17:01:27 +0100	[thread overview]
Message-ID: <83f2f02c-9276-44e8-f15b-70cdf666dcd8@gmx.at> (raw)
In-Reply-To: <87h7anlq95.fsf@metalevel.at>

 >> Please try with adding a (no-special-glyphs . t) entry to the parameters
 >> of the child frame.
 >
 > This solves the issue completely, thank you a lot for this! Could you
 > please briefly explain why this is necessary to fully show the image? In
 > particular, which glyph was shown here that used the 1 pixel width?

When a window has no right fringe, Emacs by default usurps the rightmost
character on each text line so it can indicate there whether that line
is truncated or continued.  The maximum width of the special glyph to be
displayed there (typically a "$" or a "\") is subtracted from the
maximum width of the display area of that window.  So with the right
fringe turned off, you as a rule always lose one column to the display
engine even when displayed lines are never truncated or continued.

But Eli can explain it better.

Note that with current master you need not calculate the size of your
image yourself.  Emacs can do it for you as with

(with-current-buffer (get-buffer-create "Happy New Year 2022!")
   (setq cursor-type nil mode-line-format nil)
   (erase-buffer)
   (insert-image-file "/home/martin/Downloads/202202.png")
   (let* ((size (buffer-text-pixel-size))
	 (width (car size))
	 (height (cdr size))
	 (frame (make-frame `((parent-frame . ,(selected-frame))
			      (no-special-glyphs . t)
			      (minibuffer . nil)
			      (left . 100)
			      (top . 100)
			      (internal-border-width . 0)
			      (vertical-scroll-bars . nil)
			      (left-fringe . 0)
			      (right-fringe . 0)
			      (width . (text-pixels . ,width))
			      (height . (text-pixels . ,height))))))
     (read-key)
     (delete-frame frame)))

With Emacs 27 you would have to use 'window-text-pixel-size' or
'fit-frame-to-buffer' which both have the problem that you first have to
put your buffer into a window in order to resize it appropriately.

martin





  reply	other threads:[~2022-01-01 16:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-01  9:00 bug#52929: 27.1; Images are sometimes not fully displayed Markus Triska
2022-01-01 10:06 ` martin rudalics
2022-01-01 10:11   ` Markus Triska
2022-01-01 16:01     ` martin rudalics [this message]
2022-01-01 16:17       ` Eli Zaretskii
2022-01-01 17:06         ` Markus Triska

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=83f2f02c-9276-44e8-f15b-70cdf666dcd8@gmx.at \
    --to=rudalics@gmx.at \
    --cc=52929@debbugs.gnu.org \
    --cc=triska@metalevel.at \
    /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.