about summary refs log tree commit diff
path: root/emacs/.emacs.d/wpc/modeline.el
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-09-01T12·44+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-09-01T13·00+0100
commit718899c629bb1b8bd05285c2e8c5a1709e8e5226 (patch)
treebd360e7b7779e8d8f05df3eb1059887ede6ed8c7 /emacs/.emacs.d/wpc/modeline.el
parent3b2fffe954e3927673e403ee124a78f78bb1c45c (diff)
More Elisp linting
In order for this to scale, I need to solve two things:
1. Ad-hoc ignore fill-column rules for URLs and other exceptions.
2. Run Elisp flychecker without evaluating my Elisp code and firing its
   side-effects.
Diffstat (limited to 'emacs/.emacs.d/wpc/modeline.el')
-rw-r--r--emacs/.emacs.d/wpc/modeline.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/emacs/.emacs.d/wpc/modeline.el b/emacs/.emacs.d/wpc/modeline.el
index cca336c733aa..6852bb284bc5 100644
--- a/emacs/.emacs.d/wpc/modeline.el
+++ b/emacs/.emacs.d/wpc/modeline.el
@@ -8,18 +8,21 @@
 ;;; Commentary:
 ;; Because I use EXWM, I treat my Emacs mode-line like my system bar: I need to
 ;; quickly check the system time, and I expect it to be at the bottom-right of
-;; my Emacs frame. I used doom-modeline for awhile, which is an impressive
+;; my Emacs frame.  I used doom-modeline for awhile, which is an impressive
 ;; package, but it conditionally colorizes on the modeline for the active
-;; buffer. So if my bottom-right window is inactive, I cannot see the time.
+;; buffer.  So if my bottom-right window is inactive, I cannot see the time.
 ;;
 ;; My friend, @tazjin, has a modeline setup that I think is more compatible with
 ;; EXWM, so I'm going to base my setup off of his.
 
+;;; Code:
+
 (use-package telephone-line)
 
 (defun modeline-bottom-right-window? ()
-  "Determines whether the last (i.e. bottom-right) window of the
-  active frame is showing the buffer in which this function is
+  "Determines whether the last (i.e.
+bottom-right) window of the
+active frame is showing the buffer in which this function is
   executed."
   (let* ((frame (selected-frame))
          (right-windows (window-at-side-list frame 'right))
@@ -28,9 +31,7 @@
     (eq (current-buffer) (window-buffer last-window))))
 
 (defun modeline-maybe-render-time ()
-  "Renders the mode-line-misc-info string for display in the
-  mode-line if the currently active window is the last one in the
-  frame.
+  "Conditionally renders the `mode-line-misc-info' string.
 
   The idea is to not display information like the current time,
   load, battery levels on all buffers."
@@ -47,7 +48,8 @@
       (format "[%s]" exwm-workspace-current-index)))
   ;; Define a highlight font for ~ important ~ information in the last
   ;; window.
-  (defface special-highlight '((t (:foreground "white" :background "#5f627f"))) "")
+  (defface special-highlight
+    '((t (:foreground "white" :background "#5f627f"))) "")
   (add-to-list 'telephone-line-faces
                '(highlight . (special-highlight . special-highlight)))
   (setq telephone-line-lhs
@@ -61,7 +63,6 @@
         telephone-line-primary-right-separator 'telephone-line-tan-right
         telephone-line-secondary-left-separator 'telephone-line-tan-hollow-left
         telephone-line-secondary-right-separator 'telephone-line-tan-hollow-right)
-
   (telephone-line-mode 1))
 
 (provide 'modeline)