minmo : staged status for disk
This commit is contained in:
parent
be5c57e909
commit
31056f946a
1 changed files with 14 additions and 7 deletions
|
|
@ -41,7 +41,7 @@
|
||||||
;; unmodified : ◻ : shadow : shadow
|
;; unmodified : ◻ : shadow : shadow
|
||||||
;; modified : ◱ : error : warning
|
;; modified : ◱ : error : warning
|
||||||
;; readonly/ignored : ◳ : success : success
|
;; readonly/ignored : ◳ : success : success
|
||||||
;; staged : ◰ : : link
|
;; staged : ◰ : warning : link
|
||||||
;; nofile/untracked : ◲ : link : error
|
;; nofile/untracked : ◲ : link : error
|
||||||
|
|
||||||
;; quadrant semantics:
|
;; quadrant semantics:
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
(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))))
|
(readonly/ignored . (((unicode . "◳") (ascii . "_")) . ((disk . success) (git . success))))
|
||||||
(staged . (((unicode . "◰") (ascii . "+")) . ((disk . link) (git . link))))
|
(staged . (((unicode . "◰") (ascii . "+")) . ((disk . warning) (git . link))))
|
||||||
(nofile/untracked . (((unicode . "◲") (ascii . "!")) . ((disk . link) (git . error))))
|
(nofile/untracked . (((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
|
||||||
|
|
@ -247,13 +247,20 @@ Optional FORCE means ignore the minmo--git-directory-table."
|
||||||
|
|
||||||
(defun minmo-disk-status ()
|
(defun minmo-disk-status ()
|
||||||
(cond
|
(cond
|
||||||
((and buffer-file-name (buffer-modified-p))
|
;; readonly:
|
||||||
(minmo--status 'modified 'disk))
|
|
||||||
;; for buffers with no file, like *scratch*:
|
|
||||||
((and (not buffer-file-name) (buffer-modified-p))
|
|
||||||
(minmo--status 'nofile/untracked 'disk))
|
|
||||||
(buffer-read-only
|
(buffer-read-only
|
||||||
(minmo--status 'readonly/ignored 'disk))
|
(minmo--status 'readonly/ignored 'disk))
|
||||||
|
;; no file but modified:
|
||||||
|
((and (not buffer-file-name) (buffer-modified-p))
|
||||||
|
(minmo--status 'nofile/untracked 'disk))
|
||||||
|
;; has a path but was never visited: new unsaved file
|
||||||
|
;; NOTE: visited-file-modtime involves no disk read:
|
||||||
|
((and buffer-file-name (eq -1 (visited-file-modtime)))
|
||||||
|
(minmo--status 'staged 'disk))
|
||||||
|
;; normally modified:
|
||||||
|
((and buffer-file-name (buffer-modified-p))
|
||||||
|
(minmo--status 'modified 'disk))
|
||||||
|
;; unmodified (fallback):
|
||||||
(t (minmo--status 'unmodified 'disk))
|
(t (minmo--status 'unmodified 'disk))
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue