From 32800720dddb0061cd8f4187091f29c6088e5415 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 12 Mar 2021 17:22:32 -0600 Subject: Move `acdw/modeline' functions into `acdw/pkg' forms This change means I don't have to `require' libraries that haven't been registered with `straight' yet. --- lisp/acdw.el | 44 -------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'lisp') diff --git a/lisp/acdw.el b/lisp/acdw.el index b1843c9..201db1f 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -21,9 +21,6 @@ ;; ;;; Code: -(require 'simple-modeline) -(require 'minions) - ;;; Utilities (defun acdw/when-unfocused (func &rest args) @@ -54,47 +51,6 @@ Ready for use with `after-focus-change-function'." (run-at-time sunset-time (* 60 60 24) sunset-command) (run-at-time "12:00am" (* 60 60 24) sunset-command))) -;;; Mode line segments (for `simple-modeline') -(defun acdw/modeline-modified () - "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 - (if read-only " ×" (if modified " ●" " ○")) - 'face `(:inherit - ,(if modified 'simple-modeline-status-modified - (if read-only 'simple-modeline-status-error - 'simple-modeline-unimportant))) - 'help-echo (format - "Buffer is %s and %smodified\nmouse-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-minions () - "Display a button for `minions-minor-modes-menu'." - (concat - " " - (propertize - "ⱷ" - 'help-echo (format - "Minor modes menu\nmouse-1: show menu.") - 'local-map (purecopy (simple-modeline-make-mouse-map - 'mouse-1 - (lambda (event) - (interactive "e") - (with-selected-window (posn-window (event-start - event)) - (minions-minor-modes-menu))))) - 'mouse-face 'mode-line-highlight))) - ;;; Directories (think `no-littering') (defvar acdw/dir (expand-file-name -- cgit 1.4.1-21-gabe81