1

I've been doing experiments at displaying static text images in the mode-line using Imagemagick to generate the image (see below). I would like now to generate such an image in a dynamic way, providing information from within Emacs. For example, I could display the current major mode or the cursor line/column (might be slow).

My question is how to dynamically generate the image according to the provided information (e.g. how to call and pass arguments to Imagemagick). Displaying line/column using image Imagemagick might very slow but still, I would like to try.

Multilines mode-line with static text image (through imagemagick)

Imagemagick command used for the screenshot:

convert -antialias -background none -fill white -family Roboto -weight regular -gravity southeast -size 64x42 -pointsize 20 label:"Emacs\nv26.3" label.png

And in the modeline (header line in my case):

(propertize " " 'display (create-image "~/label.png" 'png nil :ascent 90 ))
  • Please pose only one question per question. Please edit, simplifying to a single question, and post your other question separately. Thx. – Drew May 6 at 23:26
  • You can look into nyan-cat for inspiration. Bsically, add an eval form into mode-line-format. – Yuan Fu Jun 3 at 1:45
2

I've found a solution using SVG.

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.