From 04a11857b94d405a6f471f113a6510daf64f8880 Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Fri, 26 Apr 2019 17:33:38 +0900 Subject: [PATCH] UPdate --- emacs.el | 48 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/emacs.el b/emacs.el index b0fe596..43d7111 100644 --- a/emacs.el +++ b/emacs.el @@ -350,19 +350,21 @@ found, otherwise returns nil." ;; editor ;; Used from term-cursor +;; hbar is too hard to find... (defun my-cursor-type-change (&rest args) "ARGS are discarded." - ;; TODO: Support wdired + ;; TODO: Support wdired and wgrep (if buffer-read-only - (setq cursor-type 'bar) + (setq cursor-type 'hbar) (setq cursor-type 'box))) -(add-hook 'switch-buffer-functions - 'my-cursor-type-change) -(add-hook 'read-only-mode-hook - 'my-cursor-type-change) -(when (fboundp 'global-term-cursor-mode) - (global-term-cursor-mode 1)) -;; (term-cursor--eval) +;; (add-hook 'switch-buffer-functions +;; 'my-cursor-type-change) +;; (add-hook 'read-only-mode-hook +;; 'my-cursor-type-change) +;; (when (fboundp 'global-term-cursor-mode) +;; (global-term-cursor-mode 1)) +;; ;; (term-cursor--eval) + (setq kill-whole-line t) (setq scroll-conservatively 35 @@ -524,6 +526,34 @@ found, otherwise returns nil." (set-frame-parameter nil 'name "") +;; See color-name-rgb-alist for available color names +;; http://www.raebear.net/computers/emacs-colors/ +;; https://www.emacswiki.org/emacs/ListColors +;; (list-colors-display is not a complete list) +(defconst my-mode-line-background-default + (face-background 'mode-line) + "Default color of mode-line at init.") +(defun my-mode-line-color-update (&rest args) + "ARGS are discarded" + (let ((ro "tan") + (rw "grey75")) + (if (or (not buffer-read-only) + (and (eq major-mode 'wdired-mode))) + (set-face-background 'mode-line + rw) + (set-face-background 'mode-line + ro)))) +(add-hook 'switch-buffer-functions + 'my-mode-line-color-update) +(add-hook 'read-only-mode-hook + 'my-mode-line-color-update) +(add-hook 'wdired-mode-hook + 'my-mode-line-color-update) +;; TODO: Support wgrep-mode + +(set-face-background 'header-line + "grey75") + ;; http://www.geocities.jp/simizu_daisuke/bunkei-meadow.html#frame-title