Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defcustom my-mode-line-readonly-string "<READONLY>"
- "モード行でバッファが読み取り専用であることを示す文字列。"
- :type 'string
- :group 'my)
- (defcustom my-mode-line-modified-string "<MODIFIED>"
- "モード行でバッファが変更された状態であることを示す文字列。"
- :type 'string
- :group 'my)
- (defcustom my-mode-line-readonly-string-face nil
- "`my-mode-line-readonly-string' に適用するフェイス。"
- :type 'face
- :group 'my)
- (defcustom my-mode-line-modified-string-face font-lock-warning-face
- "`my-mode-line-modified-string' に適用するフェイス。"
- :type 'face
- :group 'my)
- (setq-default mode-line-modified
- (let ((my-mode-line-readonly-string-propertized
- (propertize (replace-regexp-in-string
- "%" "%%"
- my-mode-line-readonly-string)
- 'face my-mode-line-readonly-string-face))
- (my-mode-line-modified-string-propertized
- (propertize (replace-regexp-in-string
- "%" "%%"
- my-mode-line-modified-string)
- 'face my-mode-line-modified-string-face)))
- `(:eval
- (cond ((buffer-modified-p)
- (list (if buffer-read-only
- ,my-mode-line-readonly-string-propertized
- "")
- ,my-mode-line-modified-string-propertized))
- (buffer-read-only
- ,my-mode-line-readonly-string-propertized)
- (t
- "")))))
Add Comment
Please, Sign In to add comment