[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/rcirc-color 8bb2d6d630 1/6: rcirc-color: Select a rando
From: |
Philip Kaludercic |
Subject: |
[elpa] externals/rcirc-color 8bb2d6d630 1/6: rcirc-color: Select a random color on `/color nick' |
Date: |
Fri, 30 Sep 2022 08:37:46 -0400 (EDT) |
branch: externals/rcirc-color
commit 8bb2d6d6306af32010301b3894aa738bc62306d7
Author: Thuna <thuna.cing@gmail.com>
Commit: Philip Kaludercic <philipk@posteo.net>
rcirc-color: Select a random color on `/color nick'
* rcirc-color.el: When `/color' is called with a nick but no color,
choose a random color from `rcirc-colors' instead of signalling an
error.
---
rcirc-color.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/rcirc-color.el b/rcirc-color.el
index 2eff965267..02bcd3f616 100644
--- a/rcirc-color.el
+++ b/rcirc-color.el
@@ -134,7 +134,9 @@ NICK is the nick for which the new color ist set; if nil,
all the
nicks in `rcirc-color-mapping' are shown with their corresponding
faces.
-COLOR is the color to use as the new foreground-color.
+COLOR is the color to use as the new foreground-color. If COLOR
+is not supplied, a random color from `rcirc-colors' is used
+instead.
PROCESS and TARGET are the standard arguments for rcirc
commands."
@@ -149,9 +151,11 @@ commands."
rcirc-color-mapping)
(rcirc-print process (rcirc-nick process) "NOTICE" target
(mapconcat 'identity names " ")))
- (unless color
- (error "Use what color?"))
- (puthash nick (cons 'foreground-color color) rcirc-color-mapping)))
+ (puthash nick
+ (cons 'foreground-color
+ (elt rcirc-colors
+ (random (length rcirc-colors))))
+ rcirc-color-mapping)))
(advice-add 'rcirc-handler-NICK :before #'rcirc-color--handler-NICK)
(defun rcirc-color--handler-NICK (_process sender args _text)
- [elpa] externals/rcirc-color updated (c50cfdf02e -> e40b6d1ba0), Philip Kaludercic, 2022/09/30
- [elpa] externals/rcirc-color 8bb2d6d630 1/6: rcirc-color: Select a random color on `/color nick',
Philip Kaludercic <=
- [elpa] externals/rcirc-color ad61546d52 2/6: * rcirc-color.el (rcirc-color-mode): Add minor mode, Philip Kaludercic, 2022/09/30
- [elpa] externals/rcirc-color 2c3dd9fd10 3/6: Revert "* rcirc-color.el (color): Use `rcirc-define-command'", Philip Kaludercic, 2022/09/30
- [elpa] externals/rcirc-color e40b6d1ba0 6/6: * rcirc-color.el (rcirc-do-color): Respect color-other-attributes, Philip Kaludercic, 2022/09/30
- [elpa] externals/rcirc-color 6c69994cb8 5/6: * rcirc-color.el (rcirc-do-color): Use a let* to make random choice, Philip Kaludercic, 2022/09/30
- [elpa] externals/rcirc-color a6edf362fa 4/6: Add group information to rcirc-color, Philip Kaludercic, 2022/09/30