minmo : reorder statuses

This commit is contained in:
bth 2026-06-03 20:27:43 -07:00
commit f02d6811c8

View file

@ -36,13 +36,13 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; unified symbol set for git and disk status on tty and pts ;; unified symbol set for git and disk status on tty and pts
;; ;;
;; disk : git ;; git disk
;; ---------------------------------------- ;; ----------------------------------------
;; unmodified : ◻ : shadow : shadow ;; unmodified : ◻ : shadow : shadow
;; modified : ◱ : error : warning ;; modified : ◱ : warning : error
;; readonly/ignored : ◳ : success : success ;; ignored/readonly : ◳ : success : success
;; orphan/staged : ◰ : warning : link ;; staged/orphan : ◰ : link : warning
;; nofile/untracked : ◲ : link : error ;; untracked/buffer : ◲ : error : link
;; quadrant semantics: ;; quadrant semantics:
;; ;;
@ -55,9 +55,9 @@
'( '(
(unmodified . (((unicode . "◻") (ascii . ".")) . ((disk . nil) (git . nil)))) (unmodified . (((unicode . "◻") (ascii . ".")) . ((disk . nil) (git . nil))))
(modified . (((unicode . "◱") (ascii . "*")) . ((disk . error) (git . warning)))) (modified . (((unicode . "◱") (ascii . "*")) . ((disk . error) (git . warning))))
(readonly/ignored . (((unicode . "◳") (ascii . "_")) . ((disk . success) (git . success)))) (ignored/readonly . (((unicode . "◳") (ascii . "_")) . ((disk . success) (git . success))))
(orphan/staged . (((unicode . "◰") (ascii . "+")) . ((disk . warning) (git . link)))) (staged/orphan . (((unicode . "◰") (ascii . "+")) . ((disk . warning) (git . link))))
(nofile/untracked . (((unicode . "◲") (ascii . "!")) . ((disk . link) (git . error)))) (untracked/buffer . (((unicode . "◲") (ascii . "!")) . ((disk . link) (git . error))))
) )
"Unified symbol set for git and disk status with unicode and ascii variants "Unified symbol set for git and disk status with unicode and ascii variants
and their respective faces.") and their respective faces.")
@ -152,11 +152,11 @@ Optional FORCE means ignore the minmo--git-directory-table."
(concat minmo-git-status-prefix (concat minmo-git-status-prefix
(cond (cond
((string= status " ") (minmo--status 'unmodified 'git)) ((string= status " ") (minmo--status 'unmodified 'git))
((string= status "!!") (minmo--status 'readonly/ignored 'git)) ((string= status "!!") (minmo--status 'ignored/readonly 'git))
((string= status "??") (minmo--status 'nofile/untracked 'git)) ((string= status "??") (minmo--status 'untracked/buffer 'git))
;; report modified whether partially staged or not: ;; report modified whether partially staged or not:
((eq char-work ?M) (minmo--status 'modified 'git)) ((eq char-work ?M) (minmo--status 'modified 'git))
((memq char-index '(?M ?A)) (minmo--status 'orphan/staged 'git)) ((memq char-index '(?M ?A)) (minmo--status 'staged/orphan 'git))
(t (minmo--status 'unmodified 'git)))))) (t (minmo--status 'unmodified 'git))))))
(defun minmo--update-git-cache (&optional force) (defun minmo--update-git-cache (&optional force)
@ -273,15 +273,15 @@ Optional FORCE means ignore the minmo--git-directory-table."
(cond (cond
;; readonly: ;; readonly:
(buffer-read-only (buffer-read-only
(minmo--status 'readonly/ignored 'disk)) (minmo--status 'ignored/readonly 'disk))
;; no file but modified: ;; no file but modified:
((and (not buffer-file-name) (buffer-modified-p)) ((and (not buffer-file-name) (buffer-modified-p))
(minmo--status 'nofile/untracked 'disk)) (minmo--status 'untracked/buffer 'disk))
;; has a path but was never visited or no longer exists. ;; has a path but was never visited or no longer exists.
;; NOTE: visited-file-modtime involves no disk read: ;; NOTE: visited-file-modtime involves no disk read:
((and buffer-file-name (or (eq -1 (visited-file-modtime)) ((and buffer-file-name (or (eq -1 (visited-file-modtime))
(not minmo--file-exists-cache))) (not minmo--file-exists-cache)))
(minmo--status 'orphan/staged 'disk)) (minmo--status 'staged/orphan 'disk))
;; normally modified: ;; normally modified:
((and buffer-file-name (buffer-modified-p)) ((and buffer-file-name (buffer-modified-p))
(minmo--status 'modified 'disk)) (minmo--status 'modified 'disk))