unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* [QUESTION] Add conditional indicator to `mode-line-misc-info' not working
@ 2024-03-07  7:30 Christopher M. Miles
  2024-03-07 14:54 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 7+ messages in thread
From: Christopher M. Miles @ 2024-03-07  7:30 UTC (permalink / raw)
  To: Emacs Help

[-- Attachment #1: Type: text/plain, Size: 1089 bytes --]


I added bellowing init config to my Emacs:

#+begin_src emacs-lisp
(add-to-list 'mode-line-misc-info
             '(image-mode (:eval (image-size (image-get-display-property) :pixels))))
#+end_src

But it's not displaying image info on mode-line when I open an image
with [M-x find-file RET /path/to/image.png RET].

I searched GitHub code for `mode-line-misc-info` examples. I don't know
what does the `image-mode` mean in upper code. Is it a condition which
only evaluate following `(:eval (image-size ...))` snippet in buffer
which major-mode is `image-mode`?

How to correctly add indicator to `mode-line-misc-info`? Please provide
some variant examples. Thanks very much.

Also the docstring of `mode-line-misc-info` is not helpful, please improve it.

My Emacs version info: GNU Emacs 30.0.50

-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-03-07 22:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-07  7:30 [QUESTION] Add conditional indicator to `mode-line-misc-info' not working Christopher M. Miles
2024-03-07 14:54 ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-03-07 15:13   ` On manuals and the Intertubes [was: Add conditional indicator to `mode-line-misc-info'] " tomas
2024-03-07 15:34     ` Eric S Fraga
2024-03-07 15:43       ` [OFFTOPIC] Re: On manuals and the Intertubes " Stefan Monnier via Users list for the GNU Emacs text editor
2024-03-07 17:07         ` Eric S Fraga
2024-03-07 22:56           ` Stefan Monnier via Users list for the GNU Emacs text editor

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).