[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/moe-theme 73eaa37f89 309/352: change color by current fram
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/moe-theme 73eaa37f89 309/352: change color by current frame id |
Date: |
Fri, 7 Jan 2022 04:00:00 -0500 (EST) |
branch: elpa/moe-theme
commit 73eaa37f89667f189512d97e7c9b1634ac8d360d
Author: kuanyui <azazabc123@gmail.com>
Commit: ono hiroko <azazabc123@gmail.com>
change color by current frame id
---
moe-theme.el | 43 ++++++++++++++++++++++++++++++++-----------
1 file changed, 32 insertions(+), 11 deletions(-)
diff --git a/moe-theme.el b/moe-theme.el
index 7acd8841ef..14c0bd35a5 100644
--- a/moe-theme.el
+++ b/moe-theme.el
@@ -136,10 +136,12 @@
"If t, highlight buffer-id on mode-line.
If nil, just bold buffer-id without highlight")
+(defconst moe-theme-available-modeline-colors-set '(blue green orange magenta
yellow purple red cyan w/b))
+
(defvar moe-theme-mode-line-color 'blue
"Default is 'blue.
If nil, no background color.
-Available choices: 'blue, 'green, 'magenta, 'red, 'orange, 'yellow, 'purple,
'b/w")
+Available choices: 'blue, 'cyan', 'green, 'magenta, 'red, 'orange, 'yellow,
'purple, 'b/w")
(defvar moe-light-pure-white-background-in-terminal nil
"With 256-colors, default yellow background of moe-light may be 'too yellow'
@@ -187,6 +189,12 @@ Avoid unnecessary load-theme")
(defvar moe-theme-enable-powerline-supporting nil
"Don't setq this manually.")
+(setq moe-theme-colorize-modeline-by-frame-id t)
+(setq moe-theme-colorize-modeline-color-set '(cyan green orange blue yellow
magenta b/w purple))
+
+
+
+
@@ -244,7 +252,7 @@ Avoid unnecessary load-theme")
(if (functionp 'moe-theme--resize-font-markdown)
(moe-theme--resize-font-markdown))
(if (functionp 'moe-theme--resize-font-org) (moe-theme--resize-font-org))
(if (functionp 'moe-theme--resize-font-rst) (moe-theme--resize-font-rst))
-)
+ )
(defun moe-light ()
"Load moe-light-theme with your customizations."
@@ -348,9 +356,6 @@ programmly (e.g. in init.el), not interactively."
(if moe-theme-enable-powerline-supporting
(powerline-load-moe-theme-color-scheme)))
-(defun moe-theme-toggle-powerline-supporting ()
- (interactive)
- )
(defun moe-theme-select-color ()
"Interactively select the color of mode-line you like and set
@@ -358,7 +363,7 @@ it. Also see `moe-theme-random-color'"
(interactive)
(moe-theme-set-color (intern (completing-read
"Select a color: "
- '((blue) (green) (orange) (magenta) (yellow)
(purple) (red) (cyan) (w/b))
+ (mapcar #'list
moe-theme-available-modeline-colors-set)
nil t "" nil nil t))))
(defun moe-theme-random-color ()
@@ -366,14 +371,30 @@ it. Also see `moe-theme-random-color'"
This function can be called both programmly and interactively."
(interactive)
(let* ((n (abs (% (random) 9)))
- (current-color moe-theme-mode-line-color)
- (color-list '(blue green orange magenta yellow purple red cyan w/b)))
- (if (eq (elt color-list n) current-color) ;If gotten color eq
current-color, random again.
+ (current-color moe-theme-mode-line-color))
+ (if (eq (elt moe-theme-available-modeline-colors-set n) current-color) ;If
gotten color eq current-color, random again.
(moe-theme-random-color)
- (moe-theme-set-color (elt color-list n)))))
-
+ (moe-theme-set-color (elt moe-theme-available-modeline-colors-set n)))))
+
+(defun moe-theme-get-color-by-frame-name ()
+ (if moe-theme-colorize-modeline-by-frame-id
+ (let* ((obj-name (format "%s" (selected-frame)))
+ (name (progn (string-match "#<frame \\(.+?\\) 0x[0-9a-f]+>"
obj-name)
+ (match-string-no-properties 1 obj-name)))
+ (int (if (string-match "F\\([0-9]+\\)" name)
+ (string-to-int (match-string-no-properties 1 name))
+ (string-to-int (substring (md5 name) 0 1) 16)))
+ (enabled-colors-len (length
moe-theme-colorize-modeline-color-set)))
+ (nth (% int enabled-colors-len)
moe-theme-colorize-modeline-color-set))))
+
+(defadvice other-frame (after change-mode-line-color-by-frame-id activate)
+ (moe-theme-set-color (moe-theme-get-color-by-frame-name)))
(with-eval-after-load "powerline"
+ (defun moe-theme-toggle-powerline-supporting ()
+ (interactive)
+ )
+
(defalias 'moe-theme-load-powerline 'powerline-load-moe-theme-color-scheme)
(defun powerline-load-moe-theme-color-scheme ()
"Powerline theme powered by moe-theme.el
- [nongnu] elpa/moe-theme 623becd9da 282/352: Fixed string-to-int warning, (continued)
- [nongnu] elpa/moe-theme 623becd9da 282/352: Fixed string-to-int warning, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme ba3800a999 290/352: Merge pull request #77 from tanzoniteblack/cider-deprecated, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme ab6d75d549 291/352: notmuch: add default setting for light and dark, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme 392a7854bc 292/352: volatile-highlights: add same color as used for 'region', ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme 01274c8538 299/352: Merge pull request #80 from fszymanski/master, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme 70e71ef740 302/352: issue #81, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme b8f0206614 303/352: Add eldoc-highlight-function-argument, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme 1267092290 306/352: Fix wrongly used with-eval-after-load, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme cf953ff7d7 305/352: defalias moe-theme-powerline powerline-moe-theme, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme e35b1bb883 307/352: Adjust mechanism for powerline, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme 73eaa37f89 309/352: change color by current frame id,
ELPA Syncer <=
- [nongnu] elpa/moe-theme 6ca4f84f3c 308/352: wtf, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme 420c122295 312/352: Lots of shit, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme c36fbacfe5 334/352: [faces] improve for semantic-mode, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme 962f836801 340/352: Remove background from tuareg mode operators, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme 0cc3f1143c 341/352: Cherrypick README from master, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme b135f24d5a 344/352: undelete moe-theme-switcher, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme b23975ba57 348/352: Turn off aggressive-indent-mode only if it's actually on. (#115), ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme 76116f6eeb 345/352: fix: double loading of moe-theme (#109), ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme 9c40f856fc 351/352: Fix package file header for `package-buffer-info`, ELPA Syncer, 2022/01/07
- [nongnu] elpa/moe-theme 47c6cf35f7 186/352: Change color of linum-highlight to green-0., ELPA Syncer, 2022/01/07