Skip to content

Commit

Permalink
Code simplifacition
Browse files Browse the repository at this point in the history
  • Loading branch information
rougier committed May 31, 2021
1 parent 9c5e465 commit c0afcfc
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions nano-modeline.el
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
(nano-modeline-compose (nano-modeline-status)
"Agenda"
""
(format-time-string "%H:%M")))
(format-time-string "%A %-e %B %Y")))

;; ---------------------------------------------------------------------
(defun nano-modeline-term-mode-p ()
Expand Down Expand Up @@ -492,22 +492,18 @@

;; ---------------------------------------------------------------------
(defun nano-modeline-update-windows ()
"Modify the mode line depending on the presence of a window below."
"Modify the mode line depending on the presence of a window
below or a buffer local variable 'no-mode-line'."
(dolist (window (window-list))
(with-selected-window window
(if (or (one-window-p t)
(eq (window-in-direction 'below) (minibuffer-window))
(not (window-in-direction 'below)))
(with-current-buffer (window-buffer window)
(setq mode-line-format (list "")))
;; (setq mode-line-format (list "")))
(with-current-buffer (window-buffer window)
(setq mode-line-format nil)))
;; (if (window-in-direction 'above)
;; (face-remap-add-relative 'header-line '(:overline "#777777"))
;; (face-remap-add-relative 'header-line '(:overline nil)))
)))
(if (or (not (boundp 'no-mode-line)) (not no-mode-line))
(setq mode-line-format
(cond ((one-window-p t) (list ""))
((eq (window-in-direction 'below) (minibuffer-window)) (list ""))
((not (window-in-direction 'below)) (list ""))
(t nil))))))))

(add-hook 'window-configuration-change-hook 'nano-modeline-update-windows)

(setq eshell-status-in-modeline nil)
Expand All @@ -516,3 +512,6 @@
(nano-modeline)

(provide 'nano-modeline)



0 comments on commit c0afcfc

Please sign in to comment.