I set up an org-timer indicator in the mode line with this.
(setq-default
mode-line-format
(quote
(
;; org-timer
(:eval
(unless (not org-timer-countdown-timer)
(propertize (let* ((rtime (decode-time
(time-subtract
(timer--time org-timer-countdown-timer)
(current-time))))
(rmins (nth 1 rtime))
(rsecs (nth 0 rtime)))
(format "🕔 %d:%d" rmins rsecs))
'face '(:foreground "cyan" :weight bold)
'help-echo "org-timer")))
)))
I want this org-timer indicator to be shown in the active mode line only, instead of all mode lines. How to do it?
redisplay
engine is able to check each window under certain circumstances (e.g., when the mode-line is refreshed naturally, or when it is forced to refresh). When themode-line-format
contains the function(selected-window)
, a different window will be returned as redisplay visits the various windows. That value can be compared with a pre-recorded value -- e.g., thepost-command-hook
can be used to record the last knownselected-window
and that value can later be compared with a function inside themode-line-format
. So, I use the PCH to record/store theselected-window
.org-timer
. What should I do? I hope a more general way. Even it did inspired me. Can you give me more exactly code example? Because I found it set different'face
, But I need to change the display string.