From a77c430dbee1952a5fc8eb853b120c5ef6b10a53 Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Tue, 12 Dec 2017 16:54:37 -0500 Subject: [PATCH] Move modeline stuff in its own section --- global.org | 75 +++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/global.org b/global.org index 34a0ada..1ff88d7 100644 --- a/global.org +++ b/global.org @@ -130,6 +130,44 @@ (setq-default display-buffer-reuse-frames t) #+END_SRC +** Modeline + #+BEGIN_SRC emacs-lisp + (setq-default mode-line-modified '(:eval (if (buffer-modified-p) " " ""))) ;still needs some improvements, + ;does not report Readonly state + (setq-default mode-line-remote '(:eval (let ((s (format-mode-line "%@"))) + (cond + ((equal s "-") "") ((equal s "@") "@") (t s))))) + + (defvar wilder-buffer-vc-mode-line + '("%b" (vc-mode (:propertize + ;; Strip the backend name from the VC status information + (:eval (let* ((backend (downcase (symbol-name (vc-backend (buffer-file-name))))) + (branch (substring vc-mode (+ (length backend) 2))) + (s (substring vc-mode (+ (length backend) 1) (+ (length backend) 2))) + (status (cond ((equal s "-") "") ((equal s ":") "!") (t s)))) + (concat "" branch status))) + face font-lock-comment-face)))) + (put 'wilder-buffer-vc-mode-line 'risky-local-variable t) + + (defvar wilder-position + '("[%p,%I] " )) + + (put 'wilder-position 'risky-local-variable t) + + (setq-default mode-line-format + '("%e" + mode-line-front-space + mode-line-mule-info + mode-line-client + mode-line-modified + mode-line-remote + mode-line-frame-identification + wilder-buffer-vc-mode-line " " + wilder-position " " + mode-line-modes + mode-line-misc-info + mode-line-end-spaces)) + #+END_SRC ** Whitespace Trailing whitespace is evil; get rid of it *** TODO Have a look at ws-trim.el @@ -417,43 +455,6 @@ This is the same as using \\[set-mark-command] with the prefix argument." ;; (ibuffer-switch-to-saved-filter-groups "default"))) -;; * mode-line setup -(setq-default mode-line-modified '(:eval (if (buffer-modified-p) "●" "·"))) ;still needs some improvements, does not report Readonly state -(setq-default mode-line-remote '(:eval (let ((s (format-mode-line "%@"))) - (cond - ((equal s "-") "·") ((equal s "@") "@") (t s))))) - -(defvar wilder-buffer-vc-mode-line - '("%b" (vc-mode (:propertize - ;; Strip the backend name from the VC status information - (:eval (let* ((backend (downcase (symbol-name (vc-backend (buffer-file-name))))) - (branch (substring vc-mode (+ (length backend) 2))) - (s (substring vc-mode (+ (length backend) 1) (+ (length backend) 2))) - (status (cond ((equal s "-") "") ((equal s ":") "!") (t s)))) - (concat "·" branch status))) - face font-lock-comment-face)))) -(put 'wilder-buffer-vc-mode-line 'risky-local-variable t) - -(defvar wilder-position - '("[%p,%I] " )) - -(put 'wilder-position 'risky-local-variable t) - -(setq-default mode-line-format - '("%e" - mode-line-front-space - mode-line-mule-info - mode-line-client - mode-line-modified - mode-line-remote - mode-line-frame-identification - wilder-buffer-vc-mode-line " " - wilder-position " " - mode-line-modes - mode-line-misc-info - mode-line-end-spaces)) - -;; * toorg (require 'outshine) (add-hook 'outline-minor-mode-hook 'outshine-hook-function) (setq outshine-use-speed-commands t)