Rename my-smt to oni-smt

This commit is contained in:
Tom Willemse 2015-04-27 12:39:53 +02:00
parent 1df8832757
commit c6d4ada60f
3 changed files with 46 additions and 48 deletions

View file

@ -1,5 +1,5 @@
.PHONY: all site-lisp .PHONY: all site-lisp
all: init2.elc init.elc site-lisp/my-smt.elc site-lisp/appt-init.elc \ all: init2.elc init.elc site-lisp/oni-smt.elc site-lisp/appt-init.elc \
site-lisp/jabber-init.elc site-lisp/org-init.elc \ site-lisp/jabber-init.elc site-lisp/org-init.elc \
site-lisp/gnus-init.elc site-lisp/drd.elc site-lisp/gnus-init.elc site-lisp/drd.elc

View file

@ -678,8 +678,8 @@ For `python-mode' I prefer `python-imenu-create-flat-index'."
(load-theme 'yoshi t) (load-theme 'yoshi t)
(require 'svg-mode-line-themes) (require 'svg-mode-line-themes)
(smt/enable) (smt/enable)
(require 'my-smt) (require 'oni-smt)
(smt/set-theme 'my-smt) (smt/set-theme 'oni-smt)
(set-face-attribute 'mode-line nil :box nil) (set-face-attribute 'mode-line nil :box nil)
(set-face-attribute 'mode-line-inactive nil :box nil)))) (set-face-attribute 'mode-line-inactive nil :box nil))))

View file

@ -1,4 +1,4 @@
;;; my-smt.el --- My SVG mode-line theme -*- lexical-binding: t; -*- ;;; oni-smt.el --- My SVG mode-line theme -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Tom Willemse ;; Copyright (C) 2014 Tom Willemse
@ -45,13 +45,15 @@
(smt/defwidget oni-smt-flycheck-errors (smt/defwidget oni-smt-flycheck-errors
:text #'oni-smt-flycheck-errors-text) :text #'oni-smt-flycheck-errors-text)
(smt/defwidget my-smt-jabber-activity (defun oni-smt-jabber-activity-text (_)
:text (lambda (widget) "Show jabber activity indicator."
(ignore widget)
(if (and (smt/window-active-p) (if (and (smt/window-active-p)
(boundp 'jabber-activity-mode-string) (boundp 'jabber-activity-mode-string)
(not (equal jabber-activity-mode-string ""))) (not (equal jabber-activity-mode-string "")))
(concat jabber-activity-mode-string " ")))) (concat jabber-activity-mode-string " ")))
(smt/defwidget oni-smt-jabber-activity
:text #'oni-smt-jabber-activity-text)
;;; TODO Turn: ;;; TODO Turn:
;; #("message: (FORMAT-STRING &rest ARGS)" ;; #("message: (FORMAT-STRING &rest ARGS)"
@ -62,37 +64,33 @@
;;; " (" ;;; " ("
;;; (tspan :fill (fg-color highlight-function-argument) "FORMAT-STRING") ;;; (tspan :fill (fg-color highlight-function-argument) "FORMAT-STRING")
;;; " &rest ARGS)") ;;; " &rest ARGS)")
(defun my-smt-eldoc-minibuffer-message (format-string &rest args) (defun oni-smt-eldoc-minibuffer-message (format-string &rest args)
(if (minibufferp) (if (minibufferp)
(progn (progn
(add-hook 'minibuffer-exit-hook (add-hook 'minibuffer-exit-hook
(lambda () (setq my-smt-eldoc-message nil (lambda () (setq oni-smt-eldoc-message nil
eldoc-mode-line-string nil eldoc-mode-line-string nil
eldoc-last-message nil)) eldoc-last-message nil))
nil t) nil t)
(setq my-smt-eldoc-message (setq oni-smt-eldoc-message
(when (stringp format-string) (when (stringp format-string)
(apply 'format format-string args))) (apply 'format format-string args)))
(force-mode-line-update t)) (force-mode-line-update t))
(apply 'message format-string args))) (apply 'message format-string args)))
(defvar my-smt-eldoc-message nil) (defvar oni-smt-eldoc-message nil)
(smt/defwidget my-smt-eldoc-message (smt/defwidget oni-smt-eldoc-message
:text (lambda (widget) :text (lambda (widget)
(ignore widget) (ignore widget)
(when my-smt-eldoc-message (when oni-smt-eldoc-message
`(tspan :fill "#bfbfbf" " (" (tspan :fill "#5476a8" ,my-smt-eldoc-message) ")")))) `(tspan :fill "#bfbfbf" " (" (tspan :fill "#5476a8" ,oni-smt-eldoc-message) ")"))))
(defun my-smt-yoshi-title-style (widget) (defun oni-smt-yoshi-title-style (_)
"Fill color for either active or inactive windows. "Fill color for either active or inactive windows."
(list :fill (if (smt/window-active-p) "#65a854" "#969696")
:font-weight (if (smt/window-active-p) "bold" "normal")))
WIDGET is ignored." (smt/defwidget oni-smt-po-counters
(ignore widget)
(list :fill (if (smt/window-active-p)
"#a85454"
"#969696")))
(smt/defwidget my-smt-po-counters
:text (lambda (widget) :text (lambda (widget)
(ignore widget) (ignore widget)
(when (eql major-mode 'po-mode) (when (eql major-mode 'po-mode)
@ -100,8 +98,8 @@ WIDGET is ignored."
po-fuzzy-counter po-untranslated-counter po-fuzzy-counter po-untranslated-counter
po-obsolete-counter)))) po-obsolete-counter))))
(smt/defwidget my-smt-buffer-identification (smt/defwidget oni-smt-buffer-identification
:style 'my-smt-yoshi-title-style :style 'oni-smt-yoshi-title-style
:text (lambda (widget) :text (lambda (widget)
(ignore widget) (ignore widget)
(concat (concat
@ -113,7 +111,7 @@ WIDGET is ignored."
(buffer-modified-p)) (buffer-modified-p))
"*")))) "*"))))
(smt/defwidget my-smt-current-dictionary (smt/defwidget oni-smt-current-dictionary
:text (lambda (widget) :text (lambda (widget)
(ignore widget) (ignore widget)
(if flyspell-mode (if flyspell-mode
@ -121,12 +119,12 @@ WIDGET is ignored."
ispell-local-dictionary ispell-local-dictionary
flyspell-default-dictionary))))) flyspell-default-dictionary)))))
(smt/defwidget my-smt-position (smt/defwidget oni-smt-position
:text (lambda (widget) :text (lambda (widget)
(ignore widget) (ignore widget)
(format-mode-line "%l/%c:%p"))) (format-mode-line "%l/%c:%p")))
(defun my-smt-extra-minor-modes (minor-modes) (defun oni-smt-extra-minor-modes (minor-modes)
"Add some more info to MINOR-MODES." "Add some more info to MINOR-MODES."
(if (boundp 'evil-state) (if (boundp 'evil-state)
(let ((l (capitalize (elt (symbol-name evil-state) 0)))) (let ((l (capitalize (elt (symbol-name evil-state) 0))))
@ -136,41 +134,41 @@ WIDGET is ignored."
(add-function (add-function
:filter-return :filter-return
(symbol-function 'smt/minor-mode-indicator-text) (symbol-function 'smt/minor-mode-indicator-text)
#'my-smt-extra-minor-modes) #'oni-smt-extra-minor-modes)
(smt/defrow my-smt-right (smt/defrow oni-smt-right
:prototype 'default-right :prototype 'default-right
:widgets '(my-smt-jabber-activity :widgets '(oni-smt-jabber-activity
major-mode major-mode
my-smt-current-dictionary oni-smt-current-dictionary
oni-smt-flycheck-errors oni-smt-flycheck-errors
version-control minor-modes) version-control minor-modes)
:margin 16) :margin 16)
(smt/defrow my-smt-left (smt/defrow oni-smt-left
:prototype 'default-left :prototype 'default-left
:widgets '(buffer-info my-smt-buffer-identification my-smt-po-counters :widgets '(buffer-info oni-smt-buffer-identification oni-smt-po-counters
which-function my-smt-eldoc-message)) which-function oni-smt-eldoc-message))
(smt/defrow my-smt-position (smt/defrow oni-smt-position
:prototype 'default-position :prototype 'default-position
:widgets '(my-smt-position)) :widgets '(oni-smt-position))
(defun my-smt-major-mode-style (widget) (defun oni-smt-major-mode-style (widget)
(ignore widget) (ignore widget)
'(:fill "#ccc" :font-family "Fantasque Sans" :filter nil '(:fill "#ccc" :font-family "Fantasque Sans" :filter nil
:font-weight "bold" :font-style "italic")) :font-weight "bold" :font-style "italic"))
(smt/deftheme my-smt (smt/deftheme oni-smt
:prototype 'black-crystal :prototype 'black-crystal
:local-widgets (list (cons 'major-mode :local-widgets (list (cons 'major-mode
(smt/make-widget (smt/make-widget
:prototype 'major-mode :prototype 'major-mode
:style 'my-smt-major-mode-style))) :style 'oni-smt-major-mode-style)))
:rows '(my-smt-left my-smt-position my-smt-right)) :rows '(oni-smt-left oni-smt-position oni-smt-right))
(add-function :override (symbol-function 'eldoc-minibuffer-message) (add-function :override (symbol-function 'eldoc-minibuffer-message)
#'my-smt-eldoc-minibuffer-message) #'oni-smt-eldoc-minibuffer-message)
(provide 'my-smt) (provide 'oni-smt)
;;; my-smt.el ends here ;;; oni-smt.el ends here