rougier / nano-theme

GNU Emacs / N Λ N O Theme
GNU General Public License v3.0
369 stars 35 forks source link

How to customize the modeline? #49

Closed Moanrisy closed 1 year ago

Moanrisy commented 1 year ago

I would like to add org-pomodoro modeline.

When I didn't use any theme, it shown the pomodor timer on the modeline. But in nano the modeline so empty.

I try edit nano-modeline.el in .emacs.d\straight\repos\nano-emacs

with this code `(setq-default mode-line-format '("%e" mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote mode-line-frame-identification mode-line-buffer-identification " " (:eval (my-org-pomodoro-mode-line)) " " mode-line-position (vc-mode vc-mode) " " mode-line-modes mode-line-misc-info mode-line-end-spaces))

(defun my-org-pomodoro-mode-line () (when (and (featurep 'org-pomodoro) (bound-and-true-p org-pomodoro-mode)) (format " Pomodoro: %s" (org-pomodoro-format-seconds))))

`

and comment this line ;; (setq-default mode-line-format "")

but after I check mode-line-format variable, it still show ""

Anyone can help?

rougier commented 1 year ago

Could you post a screenshot of the faulty result?

Moanrisy commented 1 year ago

After I think about it again. I think i'm gonna keep nano modeline with the default setting.

Instead, I add a hook to launch countdown app that running timer for 25min when org-pomodoro started.

rougier commented 1 year ago

If you're still interested, there is a branch of nano-modeline that will be soon merged into master. The (big) difference is that now you can define a modeline for each mode independently and you can compose a modeline with miscellaneous elements that are given with the modeline or you can make your own.

For example, the default nano-modeline is now written:

(defun nano-modeline-text-mode (&optional default)
  "Nano line for text mode. Can be made DEFAULT mode."

  (funcall nano-modeline-position
           '((nano-modeline-buffer-status) " "
             (nano-modeline-buffer-name) " "
             (nano-modeline-git-info))
           '((nano-modeline-cursor-position)
             (nano-modeline-window-dedicated))
           default))