minmo : defgroup and :type annotations to all defcustom
This commit is contained in:
parent
39ee3c4c17
commit
dac53aa613
1 changed files with 48 additions and 15 deletions
|
|
@ -51,6 +51,12 @@
|
||||||
;; top ◰◳ : staged/ignored : ready
|
;; top ◰◳ : staged/ignored : ready
|
||||||
;; bottom ◱◲ : modified/untracked : unready
|
;; bottom ◱◲ : modified/untracked : unready
|
||||||
|
|
||||||
|
(defgroup minmo nil
|
||||||
|
"(min)imal (mo)de-line"
|
||||||
|
:link '(url-link :tag "Website" "https://git.bth.moi/bth/minmo")
|
||||||
|
:group 'convenience
|
||||||
|
:prefix "minmo-")
|
||||||
|
|
||||||
(defcustom minmo-status-alist
|
(defcustom minmo-status-alist
|
||||||
'(
|
'(
|
||||||
(unmodified . (((unicode . "◻") (ascii . ".")) . ((disk . nil) (git . nil))))
|
(unmodified . (((unicode . "◻") (ascii . ".")) . ((disk . nil) (git . nil))))
|
||||||
|
|
@ -73,7 +79,7 @@
|
||||||
:value-type (choice :tag "Face"
|
:value-type (choice :tag "Face"
|
||||||
(face :tag "Face name")
|
(face :tag "Face name")
|
||||||
(const :tag "None" nil)))))
|
(const :tag "None" nil)))))
|
||||||
)
|
:group 'minmo)
|
||||||
|
|
||||||
(defcustom minmo-use-ascii nil
|
(defcustom minmo-use-ascii nil
|
||||||
"Whether to use ascii symbols instead of unicode. Defaults to ascii if
|
"Whether to use ascii symbols instead of unicode. Defaults to ascii if
|
||||||
|
|
@ -82,7 +88,8 @@
|
||||||
:set (lambda (sym val)
|
:set (lambda (sym val)
|
||||||
(if (not (string-prefix-p "xterm" (tty-type)))
|
(if (not (string-prefix-p "xterm" (tty-type)))
|
||||||
(set sym t)
|
(set sym t)
|
||||||
(set sym val))))
|
(set sym val)))
|
||||||
|
:group 'minmo)
|
||||||
|
|
||||||
(defun minmo--status-string-face (status fstype)
|
(defun minmo--status-string-face (status fstype)
|
||||||
(let* (
|
(let* (
|
||||||
|
|
@ -103,7 +110,9 @@ filesystem FSTYPE, 'git or 'disk."
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;; branch
|
;;;; branch
|
||||||
|
|
||||||
(defcustom minmo-git-branch-prefix ":" "prefix for the branch string.")
|
(defcustom minmo-git-branch-prefix ":" "prefix for the branch string."
|
||||||
|
:type '(string)
|
||||||
|
:group 'minmo)
|
||||||
|
|
||||||
(defvar-local minmo--git-branch-cache nil
|
(defvar-local minmo--git-branch-cache nil
|
||||||
"Cached mode-line string for git branch.")
|
"Cached mode-line string for git branch.")
|
||||||
|
|
@ -127,7 +136,9 @@ filesystem FSTYPE, 'git or 'disk."
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;; status
|
;;;; status
|
||||||
|
|
||||||
(defcustom minmo-git-status-prefix " " "prefix for the git status string.")
|
(defcustom minmo-git-status-prefix " " "prefix for the git status string."
|
||||||
|
:type '(string)
|
||||||
|
:group 'minmo)
|
||||||
|
|
||||||
(defvar-local minmo--git-status-cache nil
|
(defvar-local minmo--git-status-cache nil
|
||||||
"Cached mode-line string for git file status.")
|
"Cached mode-line string for git file status.")
|
||||||
|
|
@ -334,7 +345,9 @@ Optional FORCE means ignore the minmo--git-directory-table."
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;; project
|
;;; project
|
||||||
|
|
||||||
(defcustom minmo-project-prefix " " "prefix for the project notifier.")
|
(defcustom minmo-project-prefix " " "prefix for the project notifier."
|
||||||
|
:type '(string)
|
||||||
|
:group 'minmo)
|
||||||
|
|
||||||
(defvar-local minmo--project-cache nil)
|
(defvar-local minmo--project-cache nil)
|
||||||
|
|
||||||
|
|
@ -358,10 +371,14 @@ Optional FORCE means ignore the minmo--git-directory-table."
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;; major-mode
|
;;; major-mode
|
||||||
|
|
||||||
(defcustom minmo-major-mode-prefix " " "prefix for the major mode notifier.")
|
(defcustom minmo-major-mode-prefix " " "prefix for the major mode notifier."
|
||||||
|
:type '(string)
|
||||||
|
:group 'minmo)
|
||||||
|
|
||||||
(defcustom minmo-major-modes-to-ignore '(emacs-lisp-mode markdown-mode um-mode)
|
(defcustom minmo-major-modes-to-ignore '(emacs-lisp-mode markdown-mode um-mode)
|
||||||
"list of major-modes to ignore")
|
"list of major-modes to ignore"
|
||||||
|
:type '(repeat symbol)
|
||||||
|
:group 'minmo)
|
||||||
|
|
||||||
;; current solution is to throw out a few redundant, obvious modes.
|
;; current solution is to throw out a few redundant, obvious modes.
|
||||||
;; NOTE: using major-mode directly, rather than mode-name, because
|
;; NOTE: using major-mode directly, rather than mode-name, because
|
||||||
|
|
@ -377,7 +394,9 @@ Optional FORCE means ignore the minmo--git-directory-table."
|
||||||
;;; input-method
|
;;; input-method
|
||||||
|
|
||||||
(defcustom minmo-input-method-suffix " | "
|
(defcustom minmo-input-method-suffix " | "
|
||||||
"suffix for the input method notifier.")
|
"suffix for the input method notifier."
|
||||||
|
:type '(string)
|
||||||
|
:group 'minmo)
|
||||||
|
|
||||||
(defun minmo-input-method ()
|
(defun minmo-input-method ()
|
||||||
(when current-input-method-title
|
(when current-input-method-title
|
||||||
|
|
@ -387,9 +406,13 @@ Optional FORCE means ignore the minmo--git-directory-table."
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;; line column
|
;;; line column
|
||||||
|
|
||||||
(defcustom minmo-line-column-format "%l:%c" "format for line number and column.")
|
(defcustom minmo-line-column-format "%l:%c" "format for line number and column."
|
||||||
|
:type '(string)
|
||||||
|
:group 'minmo)
|
||||||
|
|
||||||
(defcustom minmo-line-column-suffix " " "suffix for the line number and column.")
|
(defcustom minmo-line-column-suffix " " "suffix for the line number and column."
|
||||||
|
:type '(string)
|
||||||
|
:group 'minmo)
|
||||||
|
|
||||||
;; line count can be expensive for large files, when run continuously. cache it.
|
;; line count can be expensive for large files, when run continuously. cache it.
|
||||||
(defvar-local minmo--total-lines-cache nil
|
(defvar-local minmo--total-lines-cache nil
|
||||||
|
|
@ -431,16 +454,26 @@ Optional FORCE means ignore the minmo--git-directory-table."
|
||||||
olivetti-mode
|
olivetti-mode
|
||||||
eglot--managed-mode
|
eglot--managed-mode
|
||||||
)
|
)
|
||||||
"minor modes to show.")
|
"minor modes to show."
|
||||||
|
:type '(repeat symbol)
|
||||||
|
:group 'minmo)
|
||||||
|
|
||||||
(defcustom minmo-minor-modes-face 'font-lock-keyword-face "face for minor modes.")
|
(defcustom minmo-minor-modes-face 'font-lock-keyword-face "face for minor modes."
|
||||||
|
:type '(symbol)
|
||||||
|
:group 'minmo)
|
||||||
|
|
||||||
(defcustom minmo-minor-modes-separator " " "separator for the minor modes list.")
|
(defcustom minmo-minor-modes-separator " " "separator for the minor modes list."
|
||||||
|
:type '(string)
|
||||||
|
:group 'minmo)
|
||||||
|
|
||||||
(defcustom minmo-minor-modes-suffix " " "suffix for the minor modes list.")
|
(defcustom minmo-minor-modes-suffix " " "suffix for the minor modes list."
|
||||||
|
:type '(string)
|
||||||
|
:group 'minmo)
|
||||||
|
|
||||||
(defcustom minmo-minor-modes-strip-suffix-regexp "-minor-mode\\|-mode\\|--managed-mode"
|
(defcustom minmo-minor-modes-strip-suffix-regexp "-minor-mode\\|-mode\\|--managed-mode"
|
||||||
"regexp of suffixes from minor modes to strip out.")
|
"regexp of suffixes from minor modes to strip out."
|
||||||
|
:type '(string)
|
||||||
|
:group 'minmo)
|
||||||
|
|
||||||
(defun minmo-minor-modes ()
|
(defun minmo-minor-modes ()
|
||||||
(concat (string-join
|
(concat (string-join
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue