From 4b5702e69a2a4b3812abcb8302df2d52275f6e07 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Sat, 30 Jul 2016 16:26:07 +0800 Subject: [PATCH] emacs - fix the bug modeline modified indicator not show readly when the buufer is readonly --- emacs.d/config.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs.d/config.org b/emacs.d/config.org index 1b0eb73..f0a8f95 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -437,7 +437,7 @@ Revised powerline-center-theme :group 'powerline) ;; Don't show buffer modified for scratch and eshell mode - (defun sd/buffer-show-modified () + (defun sd/buffer-is-eshel-or-scratch () "Dot not show modified indicator for buffers" (interactive) (unless (or (string-match "*scratch*" (buffer-name)) @@ -454,7 +454,7 @@ Revised powerline-center-theme (mode-line-buffer-id (if active 'sd/mode-line-buffer-id 'mode-line-buffer-id-inactive)) (mode-line (if active 'mode-line 'mode-line-inactive)) (my-face1 (if active 'sd/powerline-active1 'powerline-inactive1)) - (my-face-buffer-modified (if (and (sd/buffer-show-modified) (buffer-modified-p)) + (my-face-buffer-modified (if (and (sd/buffer-is-eshel-or-scratch) (buffer-modified-p) (not buffer-read-only)) 'sd/buffer-modified-active1 (if buffer-read-only 'sd/buffer-view-active1 my-face1))) -- 2.11.0