Skip to content

Commit

Permalink
Simplify modeline buffer state
Browse files Browse the repository at this point in the history
  • Loading branch information
xuchengpeng committed Nov 27, 2018
1 parent 5643155 commit e48e65c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/ui/modeline/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -357,20 +357,20 @@ Meant for `+modeline-buffer-path-function'."
(let* ((active (active))
(base (buffer-base-buffer))
(icon (cond (buffer-read-only
(propertize "<ReadOnly>"
(propertize "<R>"
'face (if active 'dotemacs-modeline-warning)
'help-echo "Buffer is read-only"))
((buffer-modified-p base)
(propertize "<Modified>"
(propertize "<M>"
'face (if active 'dotemacs-modeline-buffer-modified)
'help-echo "Buffer has been modified"))
((and (buffer-file-name base)
(not (file-exists-p (buffer-file-name base))))
(propertize "<Error>"
(propertize "<E>"
'face (if active 'dotemacs-modeline-urgent)
'help-echo "Buffer does not exists"))
(t
(propertize "<Normal>"
(propertize "<N>"
'face (if active 'dotemacs-modeline-info)
'help-echo "Buffer is in normal state")))))
(if icon (concat " " icon))))
Expand Down

0 comments on commit e48e65c

Please sign in to comment.