ui/modeline: show UTF-8 for prefer-utf-8 encoding

This commit is contained in:
Henrik Lissner 2018-09-03 04:32:43 +02:00
parent 230135cf06
commit 786ab9e7b5
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -494,7 +494,9 @@ Meant for `+modeline-buffer-path-function'."
(let* ((sys (coding-system-plist buffer-file-coding-system))
(category (plist-get sys :category)))
(cond ((eq category 'coding-category-undecided) "")
((eq category 'coding-category-utf-8) "UTF-8 ")
((or (eq category 'coding-category-utf-8)
(eq (plist-get sys :name) 'prefer-utf-8))
"UTF-8 ")
((concat (upcase (symbol-name (plist-get sys :name))) " "))))))
(def-modeline-segment! +modeline-major-mode