From: Eshel Yaron Date: Sun, 6 Aug 2023 11:36:53 +0000 (+0300) Subject: Update Emacs mode-line configuration X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2f506c8a62117e42f606cc8e79d3bd69342e5944;p=dotfiles.git Update Emacs mode-line configuration --- diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 4e3322e..3d08a7b 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -49,6 +49,7 @@ switch-to-buffer-obey-display-actions t ;; disable new mail mode line indication display-time-mail-function #'ignore + display-time-24hr-format t ;; enable recursive minibuffers enable-recursive-minibuffers t bug-reference-url-format "https://debbugs.gnu.org/%s" @@ -1351,14 +1352,22 @@ as the initial input for completion, and return that directory." (defvar esy/mode-line-format '(" %+ " mode-line-buffer-identification - " (%[" mode-name minor-mode-alist "%])" + " (%[" mode-name mode-line-process minor-mode-alist "%])" (vc-mode vc-mode) - mode-line-process mode-line-format-right-align "%l:%c " (-3 "%p") " " - (:eval (concat "€~" (number-to-string (cdar esy/eur-to-ils-rates)) "₪ ")) + (:eval (when (mode-line-window-selected-p) + (let* ((last-rate (cdar esy/eur-to-ils-rates)) + (prev-rate (cdadr esy/eur-to-ils-rates)) + (face-arrw (cond + ((< prev-rate last-rate) '("↑" . 'error)) + ((< last-rate prev-rate) '("↓" . 'success)) + (t '("→" . 'warning)))) + (arrw (car face-arrw)) + (face (cdr face-arrw))) + (propertize (concat "€" arrw (number-to-string last-rate) "₪ ") 'face face)))) display-time-string battery-mode-line-string)) (add-hook 'after-init-hook