I am using GNU Emacs to display the cover of the album mpd is currently playing, inserting it into a *jukebox*
buffer with this code:
(put-image (create-image albumartname 'imagemagick nil :width 1022) 0 albumartname)
(The window is maximized and the screen is 1024 pixels wide.)
I would like to have that image fill the entire width of Emacs' window, but a column of empty space always appears to the right of the image:
The width of this column depends on the font size - if I turn down the font size to 1, there is just a tiny column of empty space. If I turn the font size up to 38, it is much wider.
I have tried both (visual-line-mode 1)
and (toggle-truncate-lines 1)
, without any luck. I have turned scrollbars and fringes off.
Is there a way to coerce Emacs into not showing that column of empty space?
Update:
Some more information:
Here is a screenshot if I do:
(add-to-list 'default-frame-alist '(font . "URW Gothic L-1"))
(I have changed the background-color):
I tried the suggestion of setting
(setq frame-resize-pixelwise t)
but that didn't help.
I have also tried to add an overlay with a face with height 1 to the picture, which I couldn't make work either.
Could it be a column reserved for the "truncate char"? If I make the window narrower, it looks like this:
Notice how the column has a "$" below the image, where the line is longer than the screen, so Emacs definitely can paint there.
Update 2
I have gotten a little further. If I set the default font size to 1:
(add-to-list 'default-frame-alist '(font . "URW Gothic L-1"))
and I define a face:
(defface jukebox-cover
'((t (:family "URW Gothic L" :height 380 :foundry "urw" :slant normal :weight normal :width normal)))
"Jukebox cover workaround face"
:group 'jukebox-mode)
And then after displaying the image and putting the text in the buffer:
(put-image (create-image albumartname 'imagemagick nil :width 1020) 1 albumartname)
(insert (format "\n%s\n%s\n%s " title album artist))
I then add and overlay with the face I defined:
(overlay-put (make-overlay (point-min) (point-max)) 'face 'jukebox-cover)
then it looks like this:
Now I just need to figure out how to make the minibuffer font readable again as well.
M-x set-fringe-style
) – Stefan Mar 10 '19 at 02:14frame-resize-pixelwise
! – Stefan Mar 10 '19 at 17:15frame-resize-pixelwise
to 't, but that didn't change anything either, unfortunately. Could it be a column for displaying the $ of truncated lines, added because the image is too wide? – asjo Mar 10 '19 at 21:26