I would like to append some information (that changes over time) to the mode line format and then use it in the title.
My thought being is that once a minute I would set the frame-title-format to be that of the mode-line-format + pomodoro count.
Something along the lines of:
(defun runOnceAMinute ()
(setq frame-title-format (concat mode-line-format my/PomodoroCount))
)
But I can't quite figure out how.
EDIT
I would need to update the string that I append. E.g the pomodoro-count would increment after each pomodoro.
EDIT 2
I got it to work by editing mode-line-format
variable and using the eval construct:
("%e" ......... "[Pomodorors: " (:eval (number-to-string my/pomCount)) "]")
This is not Drew's original answer, but Drew mentioned it in his comment.
mode-line-format
has been simplified in recent years to (more or less) just a smallish list of other variables; so you would typically modify one of those child variables (or some further descendant), rather thanmode-line-format
itself. SeeC-h v mode-line-format
, and then similarlyC-h v
for any of the component variables you want to learn about.(..... "HI" )
and this shows up. But if I want to print an integer, it doesn't show up?(.... (number-to-string my/count))
any ideas why?C-h v mode-line-format
carefully: it describes the behaviour of the various different constructs that you can use, and it's a bit complicated. For more details, see the manual:C-h i g (elisp) Mode Line Format
(defun my-eval-string (string) "Evaluate elisp code stored in a string." (eval (car (read-from-string string)))) ;; pomodoro (doom-modeline-def-segment pomodoro "pomodoro segment" (my-eval-string "pomodoro-mode-line-string"))