ui/modeline: refactor encoding segment
This commit is contained in:
parent
95bea5b95b
commit
f075c30710
1 changed files with 11 additions and 7 deletions
|
@ -464,16 +464,19 @@ lines are selected, or the NxM dimensions of a block selection.")
|
|||
;;; `+modeline-encoding'
|
||||
(def-modeline-var! +modeline-encoding
|
||||
'(:eval
|
||||
(concat (pcase (coding-system-eol-type buffer-file-coding-system)
|
||||
(0 " LF ")
|
||||
(1 " RLF ")
|
||||
(2 " CR "))
|
||||
(concat (coding-system-eol-type-mnemonic buffer-file-coding-system)
|
||||
" "
|
||||
(let ((sys (coding-system-plist buffer-file-coding-system)))
|
||||
(if (memq (plist-get sys :category)
|
||||
'(coding-category-undecided coding-category-utf-8))
|
||||
"UTF-8"
|
||||
(upcase (symbol-name (plist-get sys :name)))))
|
||||
" ")))
|
||||
(upcase (symbol-name (plist-get sys :name))))))))
|
||||
|
||||
;; Clearer mnemonic labels for EOL styles
|
||||
(setq eol-mnemonic-dos "CRLF"
|
||||
eol-mnemonic-mac "CR"
|
||||
eol-mnemonic-unix "LF"
|
||||
eol-mnemonic-undecided "??")
|
||||
|
||||
|
||||
;;
|
||||
|
@ -493,6 +496,7 @@ lines are selected, or the NxM dimensions of a block selection.")
|
|||
vc-mode " "))
|
||||
" "
|
||||
+modeline-encoding
|
||||
" "
|
||||
(+modeline-checker ("" +modeline-checker " "))))
|
||||
|
||||
(def-modeline! project
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue