From 1433a3916049615cc3ab4880939b3842c9242c29 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 12 Oct 2021 18:40:17 -0500 Subject: totally unhelpful commit message ;) --- lisp/acdw-modeline.el | 72 ++++++++++++++++++++++++++++----------------------- lisp/acdw-org.el | 3 ++- 2 files changed, 41 insertions(+), 34 deletions(-) (limited to 'lisp') diff --git a/lisp/acdw-modeline.el b/lisp/acdw-modeline.el index adfcb44..d9b1c8b 100644 --- a/lisp/acdw-modeline.el +++ b/lisp/acdw-modeline.el @@ -33,13 +33,18 @@ Otherwise, cdr should be a function that takes two points (see `count-words')." (defun acdw-modeline/buffer-name () ; gonsie "Display the buffer name in a face reflecting its modified status." - (propertize (concat (format " %-20s" (truncate-string 20 (buffer-name) "~"))) - 'face 'bold - ;; (if (buffer-modified-p) - ;; 'font-lock-warning-face - ;; 'font-lock-type-face) - 'help-echo (or (buffer-file-name) - (buffer-name)))) + (propertize + (concat + (format " %-20s" + (truncate-string 20 + (string-trim (buffer-name) "*" "*") + "~"))) + 'face 'bold + ;; (if (buffer-modified-p) + ;; 'font-lock-warning-face + ;; 'font-lock-type-face) + 'help-echo (or (buffer-file-name) + (buffer-name)))) (defun acdw-modeline/erc () "ERC indicator for the modeline." @@ -90,31 +95,32 @@ Otherwise, cdr should be a function that takes two points (see `count-words')." (defun acdw-modeline/modified () ; modified from `simple-modeline' "Displays a color-coded buffer modification/read-only indicator in the mode-line." - (if (not (string-match-p "\\*.*\\*" (buffer-name))) - (let* ((read-only (and buffer-read-only (buffer-file-name))) - (modified (buffer-modified-p))) - (propertize - (concat " " - (cond - ((derived-mode-p 'special-mode - 'lui-mode) - "~") - (read-only "=") - (modified "+") - (t "-"))) - 'help-echo (format - (concat "Buffer is %s and %smodified\n" - "mouse-1: Toggle read-only status.") - (if read-only "read-only" "writable") - (if modified "" "not ")) - 'local-map (purecopy (simple-modeline-make-mouse-map - 'mouse-1 - (lambda (event) - (interactive "e") - (with-selected-window - (posn-window (event-start event)) - (read-only-mode 'toggle))))) - 'mouse-face 'mode-line-highlight)))) + (let* ((read-only (and buffer-read-only (buffer-file-name))) + (modified (buffer-modified-p))) + (propertize + (concat " " + (cond + ((string-match-p "\\*.*\\*" (buffer-name)) + "*") + ((derived-mode-p 'special-mode + 'lui-mode) + "~") + (read-only "=") + (modified "+") + (t "-"))) + 'help-echo (format + (concat "Buffer is %s and %smodified\n" + "mouse-1: Toggle read-only status.") + (if read-only "read-only" "writable") + (if modified "" "not ")) + 'local-map (purecopy (simple-modeline-make-mouse-map + 'mouse-1 + (lambda (event) + (interactive "e") + (with-selected-window + (posn-window (event-start event)) + (read-only-mode 'toggle))))) + 'mouse-face 'mode-line-highlight))) (defun acdw-modeline/narrowed () "Display an indication if the buffer is narrowed." @@ -195,7 +201,7 @@ is, if point < mark." (defun acdw-modeline/wc () "Display current `wc-buffer-stats'." (when (bound-and-true-p wc-mode) - (or wc-buffer-stats " [w]"))) + (format "%8s" (or (cadr wc-buffer-stats) "[w]")))) (defun acdw-modeline/winum () "Show the `winum' number of the current window in the modeline. diff --git a/lisp/acdw-org.el b/lisp/acdw-org.el index a1558a2..f0a1d49 100644 --- a/lisp/acdw-org.el +++ b/lisp/acdw-org.el @@ -465,7 +465,8 @@ probably abandon it at some point for a better solution (see: (save-excursion (save-match-data (widen) - (while (not (org-entry-is-todo-p)) + (while (not (or (org-entry-is-todo-p) + (org-entry-is-done-p))) ;; TODO: need a better error message (org-previous-visible-heading 1)) (org-narrow-to-subtree)))) -- cgit 1.4.1-21-gabe81