Support for mode-line-window-selected-p #10

Closed
opened 2023-12-28 01:48:37 +00:00 by dpassen · 2 comments

It would be great if mood-line-defformat supported mode-line-window-selected-p (introduced in emacs 29.1) to allow for selectively displaying certain segments only in the active window's mode-line.

Thanks for all the work you've put into mood-line already. It's a very nice package. :-)

It would be great if `mood-line-defformat` supported `mode-line-window-selected-p` (introduced in emacs 29.1) to allow for selectively displaying certain segments only in the active window's mode-line. Thanks for all the work you've put into mood-line already. It's a very nice package. :-)
jessieh added the
Kind/Feature
label 2024-01-05 14:35:14 +00:00
jessieh self-assigned this 2024-01-05 14:35:20 +00:00
Owner

I've just checked, and it is very much possible to use mode-line-window-selected-p within mood-line-defformat! :)

;; Example format that only displays the major mode in the selected window:
(mood-line-defformat
 :left
 (((mood-line-segment-buffer-name)     . "  ")
  ((mood-line-segment-cursor-position) . " ")
  (mood-line-segment-scroll))
 :right
 (((mood-line-segment-vc)            . "  ")
  ((when (mode-line-window-selected-p)
     (mood-line-segment-major-mode)) . "  ")
  ((mood-line-segment-checker)       . "  ")))

Is that the sort of usage that you had in mind?

I've just checked, and it is very much possible to use `mode-line-window-selected-p` within `mood-line-defformat`! :) ```lisp ;; Example format that only displays the major mode in the selected window: (mood-line-defformat :left (((mood-line-segment-buffer-name) . " ") ((mood-line-segment-cursor-position) . " ") (mood-line-segment-scroll)) :right (((mood-line-segment-vc) . " ") ((when (mode-line-window-selected-p) (mood-line-segment-major-mode)) . " ") ((mood-line-segment-checker) . " "))) ``` Is that the sort of usage that you had in mind?
Author

Yes, I don't know why this didn't work when I made the issue. I'll give this a try and thanks for looking into it!

Yes, I don't know why this didn't work when I made the issue. I'll give this a try and thanks for looking into it!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: jessieh/mood-line#10
No description provided.