Update.
[elisp.git] / emacs.el
index aea32d6..47b66f3 100644 (file)
--- a/emacs.el
+++ b/emacs.el
 ;; Xft.antialias: true
 ;; Xft.rgba: rgb
 
+(set-default-font "Inconsolata 15")
+
 ;; (set-default-font "Bitstream vera sans mono-12")
 ;; (set-default-font "Liberation Mono-13")
-(set-default-font "Inconsolata 15")
-;; (set-default-font "DejaVu sans mono 11")
+;; (set-default-font "DejaVu sans mono 15")
 ;; (set-default-font "Droid sans mono 13")
 ;; (set-default-font "Opensans 10")
 
@@ -407,68 +408,6 @@ load-warning buffer in case of failure."
 ;; Not the same in xterm (which is gray in my case) and in
 ;; X-window
 
-(unless window-system
-  ;;     (xterm-mouse-mode 1)
-  (ff/configure-faces
-   '((italic :underline nil)
-     (info-title-2 :foreground "green")
-     (font-lock-comment-delimiter-face :foreground "green")
-     (font-lock-comment-face :foreground "green")
-     (cperl-array-face :background "gray90" :foreground "blue" :weight 'bold)
-     (cperl-hash-face :background "gray90" :foreground "purple" :weight 'bold)
-     (diff-added :background "gray90" :foreground "green4" :weight 'bold)
-     (diff-removed :background "gray90" :foreground "red2" :weight 'bold)
-     (diff-changed :background "gray90" :foreground "blue" :weight 'bold)
-     (diff-file-header-face :background "white" :foreground "black"
-                            :weight 'bold)
-     (diff-header-face :background "white" :foreground "black")
-     (diff-hunk-header-face :background "white" :foreground "black")
-     (diff-indicator-removed :foreground "red" :weight 'bold)
-     (diff-removed :foreground "red" :weight 'bold)
-     (diff-indicator-added :foreground "blue" :weight 'bold)
-     (diff-added :foreground "blue" :weight 'bold)
-     (font-lock-string-face :foreground "green")
-     (font-lock-variable-name-face :foreground "blue")
-     (font-lock-constant-face :foreground "blue")
-     (font-lock-preprocessor-face :foreground "green")
-     (font-lock-function-name-face :foreground "cyan")
-     (flyspell-incorrect :foreground "red2")
-     (flyspell-duplicate :foreground "OrangeRed2")
-     (hl-line :background "white")
-     (sh-heredoc :foreground "black" :background "#fff0f0")
-     (sh-heredoc-face :foreground "black" :background "#fff0f0")
-     (font-lock-keyword-face :foreground "blue")
-     (highlight :background "darkseagreen3")
-     (isearch :background "orange" :foreground "black")
-     (isearch-lazy-highlight-face' :background "yellow" :foreground "black")
-     ;; (display-time-mail-face :background "white")
-     (show-paren-match-face :background "gold" :foreground "black")
-     (show-paren-mismatch-face :background "red" :foreground "black")
-     (trailing-whitespace :background "white")
-     (mode-line :background "cornflowerblue" :foreground "black" :box nil
-                :inverse-video nil)
-     (header-line :background "cornflowerblue" :foreground "black" :box nil
-                  :inverse-video nil)
-     (mode-line-inactive :background "gray60" :foreground "black" :box nil
-                         :inverse-video nil)
-     (region :background "white" :foreground "black")
-     (ff/date-info-face :foreground "white" :weight 'bold)
-     (ff/mail-alarm-face :foreground "red" :weight 'bold)
-     (selector/selection :background "yellow")
-     (gui-button-face :background "green" :foreground "white")
-     (enotes/information-face :foreground "cyan")
-
-     (file-name-shadow :foreground "black")
-     (shadow :foreground "black")
-     (warning :foreground "black" :background "red")
-     ))
-  )
-
-;; (list-colors-display (mapcar 'car color-name-rgb-alist))
-
-;; (ff/configure-faces '((default :background "black" :foreground "gray80")))
-;; (ff/configure-faces '((default :background "gray80" :foreground "black")))
-
 (when window-system
   ;; (setq
   ;; display-time-use-mail-icon t)
@@ -476,7 +415,6 @@ load-warning buffer in case of failure."
   (ff/configure-faces
    '(
      ;; (escape-glyph :foreground "#c0c0c0" :weight 'bold)
-
      (escape-glyph :foreground "green3" :weight 'bold)
      (default :background "gray90" :foreground "black")
      (cperl-array-face :background "gray90" :foreground "blue" :weight 'bold)
@@ -522,13 +460,72 @@ load-warning buffer in case of failure."
                          :inverse-video nil)
      ;; (fringe :background "black" :foreground "gray90")
      (fringe :background "gray80")
-     (ff/date-info-face :foreground "white" :weight 'bold)
+     (ff/date-info-face :foreground "white")
+     (ff/battery-info-face :foreground "white")
      (ff/mail-alarm-face :foreground "white" :background "red2")
      ;; (alarm-vc-face :foreground "black" :background "yellow" :weight 'normal)
      (gui-button-face :background "green" :foreground "black")
      ))
   )
 
+(unless window-system
+  ;; (xterm-mouse-mode 1)
+  (ff/configure-faces
+   '((italic :underline nil)
+     (info-title-2 :foreground "green")
+     (font-lock-comment-delimiter-face :foreground "green")
+     (font-lock-comment-face :foreground "green")
+     (cperl-array-face :background "gray90" :foreground "blue" :weight 'bold)
+     (cperl-hash-face :background "gray90" :foreground "purple" :weight 'bold)
+     (diff-added :background "gray90" :foreground "green4" :weight 'bold)
+     (diff-removed :background "gray90" :foreground "red2" :weight 'bold)
+     (diff-changed :background "gray90" :foreground "blue" :weight 'bold)
+     (diff-file-header-face :background "white" :foreground "black"
+                            :weight 'bold)
+     (diff-header-face :background "white" :foreground "black")
+     (diff-hunk-header-face :background "white" :foreground "black")
+     (diff-indicator-removed :foreground "red" :weight 'bold)
+     (diff-removed :foreground "red" :weight 'bold)
+     (diff-indicator-added :foreground "blue" :weight 'bold)
+     (diff-added :foreground "blue" :weight 'bold)
+     (font-lock-string-face :foreground "green")
+     (font-lock-variable-name-face :foreground "blue")
+     (font-lock-constant-face :foreground "blue")
+     (font-lock-preprocessor-face :foreground "green")
+     (font-lock-function-name-face :foreground "cyan")
+     (flyspell-incorrect :foreground "red2")
+     (flyspell-duplicate :foreground "OrangeRed2")
+     (hl-line :background "white")
+     (sh-heredoc :foreground "black" :background "#fff0f0")
+     (sh-heredoc-face :foreground "black" :background "#fff0f0")
+     (font-lock-keyword-face :foreground "blue")
+     (highlight :background "darkseagreen3")
+     (isearch :background "orange" :foreground "black")
+     (isearch-lazy-highlight-face' :background "yellow" :foreground "black")
+     ;; (display-time-mail-face :background "white")
+     (show-paren-match-face :background "gold" :foreground "black")
+     (show-paren-mismatch-face :background "red" :foreground "black")
+     (trailing-whitespace :background "white")
+     (mode-line :background "cornflowerblue" :foreground "black" :box nil
+                :inverse-video nil)
+     (header-line :background "cornflowerblue" :foreground "black" :box nil
+                  :inverse-video nil)
+     (mode-line-inactive :background "gray60" :foreground "black" :box nil
+                         :inverse-video nil)
+     (region :background "white" :foreground "black")
+     (ff/date-info-face :foreground "white" :weight 'bold)
+     (ff/battery-info-face :foreground "white")
+     (ff/mail-alarm-face :foreground "red" :weight 'bold)
+     (selector/selection :background "yellow")
+     (gui-button-face :background "green" :foreground "white")
+     (enotes/information-face :foreground "cyan")
+
+     (file-name-shadow :foreground "black")
+     (shadow :foreground "black")
+     (warning :foreground "black" :background "red")
+     ))
+  )
+
 ;; When we are root, put the modeline in red
 
 (when (string= (user-real-login-name) "root")
@@ -893,10 +890,14 @@ printer."
 
             ;; The battery
 
-            (pcase (ff/battery-state ff/battery-dirs)
-              (`charging (format "c%d%%" (ff/battery-percent)))
-              (`discharging (format "d%d%%" (ff/battery-percent)))
-              (_ "f"))
+             (pcase (ff/battery-state ff/battery-dirs)
+               ;; (`charging (format "c%d%%" (ff/battery-percent)))
+               ;; (`discharging (format "d%d%%" (ff/battery-percent)))
+               ;; (`unknown "f")
+               (`charging (format "↑%d%%" (ff/battery-percent)))
+               (`discharging (format "↓%d%%" (ff/battery-percent)))
+               (`unknown "✱")
+               (_ "?"))
 
             )
 
@@ -924,7 +925,7 @@ printer."
                         (propertize
                          (with-temp-buffer (apply 'call-process x)
                                            (buffer-string))
-                         'face '(:background "#c0c0ff"))
+                         'face '(:background "#d0d0ff"))
                       (with-temp-buffer (apply 'call-process x)
                                         (buffer-string))
                       ))
@@ -975,24 +976,20 @@ printer."
 
  display-time-string-forms `(
 
-                             ;; (if mail
-                             ;;     (concat " "
-                             ;;             (propertize " mail "
-                             ;;                         'face 'ff/mail-alarm-face)
-                             ;;             " ")
-                             ;;   )
-
-                             ,(if (ff/temp-and-battery-info-string)
-                                  '(concat (ff/temp-and-battery-info-string) " "))
+                             load " "
 
-                             (propertize (concat 24-hours ":" minutes
-                                                 " "
-                                                 dayname " "
-                                                 monthname " "
-                                                 day)
-                                         'face 'ff/date-info-face)
+                             (propertize
+                              (ff/temp-and-battery-info-string)
+                              'face 'ff/battery-info-face)
 
-                             load
+                             (propertize
+                              (concat " <"
+                                      24-hours ":" minutes
+                                      " "
+                                      ;; dayname " "
+                                      monthname " " day
+                                      ">")
+                              'face 'ff/date-info-face)
 
                              )
 
@@ -2213,7 +2210,7 @@ This may be a useful alternative binding for \\[delete-other-windows]
 
 ;; (load "winner")
 (winner-mode 1)
-(define-key global-map [(shift backspace)] 'winner-undo)
+;; (define-key global-map [(shift backspace)] 'winner-undo)
 
 ;; (define-key global-map [(shift home)] 'delete-other-windows-vertically)
 ;; (define-key global-map [(control +)] 'enlarge-window)