Rename my-smt to oni-smt
This commit is contained in:
parent
1df8832757
commit
c6d4ada60f
3 changed files with 46 additions and 48 deletions
|
@ -1,5 +1,5 @@
|
|||
.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/gnus-init.elc site-lisp/drd.elc
|
||||
|
||||
|
|
|
@ -678,8 +678,8 @@ For `python-mode' I prefer `python-imenu-create-flat-index'."
|
|||
(load-theme 'yoshi t)
|
||||
(require 'svg-mode-line-themes)
|
||||
(smt/enable)
|
||||
(require 'my-smt)
|
||||
(smt/set-theme 'my-smt)
|
||||
(require 'oni-smt)
|
||||
(smt/set-theme 'oni-smt)
|
||||
(set-face-attribute 'mode-line nil :box nil)
|
||||
(set-face-attribute 'mode-line-inactive nil :box nil))))
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
@ -45,13 +45,15 @@
|
|||
(smt/defwidget oni-smt-flycheck-errors
|
||||
:text #'oni-smt-flycheck-errors-text)
|
||||
|
||||
(smt/defwidget my-smt-jabber-activity
|
||||
:text (lambda (widget)
|
||||
(ignore widget)
|
||||
(defun oni-smt-jabber-activity-text (_)
|
||||
"Show jabber activity indicator."
|
||||
(if (and (smt/window-active-p)
|
||||
(boundp '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:
|
||||
;; #("message: (FORMAT-STRING &rest ARGS)"
|
||||
|
@ -62,37 +64,33 @@
|
|||
;;; " ("
|
||||
;;; (tspan :fill (fg-color highlight-function-argument) "FORMAT-STRING")
|
||||
;;; " &rest ARGS)")
|
||||
(defun my-smt-eldoc-minibuffer-message (format-string &rest args)
|
||||
(defun oni-smt-eldoc-minibuffer-message (format-string &rest args)
|
||||
(if (minibufferp)
|
||||
(progn
|
||||
(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-last-message nil))
|
||||
nil t)
|
||||
(setq my-smt-eldoc-message
|
||||
(setq oni-smt-eldoc-message
|
||||
(when (stringp format-string)
|
||||
(apply 'format format-string args)))
|
||||
(force-mode-line-update t))
|
||||
(apply 'message format-string args)))
|
||||
|
||||
(defvar my-smt-eldoc-message nil)
|
||||
(smt/defwidget my-smt-eldoc-message
|
||||
(defvar oni-smt-eldoc-message nil)
|
||||
(smt/defwidget oni-smt-eldoc-message
|
||||
:text (lambda (widget)
|
||||
(ignore widget)
|
||||
(when my-smt-eldoc-message
|
||||
`(tspan :fill "#bfbfbf" " (" (tspan :fill "#5476a8" ,my-smt-eldoc-message) ")"))))
|
||||
(when oni-smt-eldoc-message
|
||||
`(tspan :fill "#bfbfbf" " (" (tspan :fill "#5476a8" ,oni-smt-eldoc-message) ")"))))
|
||||
|
||||
(defun my-smt-yoshi-title-style (widget)
|
||||
"Fill color for either active or inactive windows.
|
||||
(defun oni-smt-yoshi-title-style (_)
|
||||
"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."
|
||||
(ignore widget)
|
||||
(list :fill (if (smt/window-active-p)
|
||||
"#a85454"
|
||||
"#969696")))
|
||||
|
||||
(smt/defwidget my-smt-po-counters
|
||||
(smt/defwidget oni-smt-po-counters
|
||||
:text (lambda (widget)
|
||||
(ignore widget)
|
||||
(when (eql major-mode 'po-mode)
|
||||
|
@ -100,8 +98,8 @@ WIDGET is ignored."
|
|||
po-fuzzy-counter po-untranslated-counter
|
||||
po-obsolete-counter))))
|
||||
|
||||
(smt/defwidget my-smt-buffer-identification
|
||||
:style 'my-smt-yoshi-title-style
|
||||
(smt/defwidget oni-smt-buffer-identification
|
||||
:style 'oni-smt-yoshi-title-style
|
||||
:text (lambda (widget)
|
||||
(ignore widget)
|
||||
(concat
|
||||
|
@ -113,7 +111,7 @@ WIDGET is ignored."
|
|||
(buffer-modified-p))
|
||||
"*"))))
|
||||
|
||||
(smt/defwidget my-smt-current-dictionary
|
||||
(smt/defwidget oni-smt-current-dictionary
|
||||
:text (lambda (widget)
|
||||
(ignore widget)
|
||||
(if flyspell-mode
|
||||
|
@ -121,12 +119,12 @@ WIDGET is ignored."
|
|||
ispell-local-dictionary
|
||||
flyspell-default-dictionary)))))
|
||||
|
||||
(smt/defwidget my-smt-position
|
||||
(smt/defwidget oni-smt-position
|
||||
:text (lambda (widget)
|
||||
(ignore widget)
|
||||
(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."
|
||||
(if (boundp 'evil-state)
|
||||
(let ((l (capitalize (elt (symbol-name evil-state) 0))))
|
||||
|
@ -136,41 +134,41 @@ WIDGET is ignored."
|
|||
(add-function
|
||||
:filter-return
|
||||
(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
|
||||
:widgets '(my-smt-jabber-activity
|
||||
:widgets '(oni-smt-jabber-activity
|
||||
major-mode
|
||||
my-smt-current-dictionary
|
||||
oni-smt-current-dictionary
|
||||
oni-smt-flycheck-errors
|
||||
version-control minor-modes)
|
||||
:margin 16)
|
||||
|
||||
(smt/defrow my-smt-left
|
||||
(smt/defrow oni-smt-left
|
||||
:prototype 'default-left
|
||||
:widgets '(buffer-info my-smt-buffer-identification my-smt-po-counters
|
||||
which-function my-smt-eldoc-message))
|
||||
:widgets '(buffer-info oni-smt-buffer-identification oni-smt-po-counters
|
||||
which-function oni-smt-eldoc-message))
|
||||
|
||||
(smt/defrow my-smt-position
|
||||
(smt/defrow oni-smt-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)
|
||||
'(:fill "#ccc" :font-family "Fantasque Sans" :filter nil
|
||||
:font-weight "bold" :font-style "italic"))
|
||||
|
||||
(smt/deftheme my-smt
|
||||
(smt/deftheme oni-smt
|
||||
:prototype 'black-crystal
|
||||
:local-widgets (list (cons 'major-mode
|
||||
(smt/make-widget
|
||||
:prototype 'major-mode
|
||||
:style 'my-smt-major-mode-style)))
|
||||
:rows '(my-smt-left my-smt-position my-smt-right))
|
||||
:style 'oni-smt-major-mode-style)))
|
||||
:rows '(oni-smt-left oni-smt-position oni-smt-right))
|
||||
|
||||
(add-function :override (symbol-function 'eldoc-minibuffer-message)
|
||||
#'my-smt-eldoc-minibuffer-message)
|
||||
#'oni-smt-eldoc-minibuffer-message)
|
||||
|
||||
(provide 'my-smt)
|
||||
;;; my-smt.el ends here
|
||||
(provide 'oni-smt)
|
||||
;;; oni-smt.el ends here
|
Loading…
Reference in a new issue