[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 4b71133: rcirc-color: add rcirc-color-other-attributes

From: Alex Schroeder
Subject: [elpa] master 4b71133: rcirc-color: add rcirc-color-other-attributes
Date: Mon, 30 Jul 2018 17:04:20 -0400 (EDT)

branch: master
commit 4b71133214b9a2d67be42f91b5a8631d52c259fe
Author: Alex Schroeder <address@hidden>
Commit: Alex Schroeder <address@hidden>

    rcirc-color: add rcirc-color-other-attributes
    This allows users to specify more attributes to use for other nicks
    in addition to foreground color.
 packages/rcirc-color/rcirc-color.el | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/packages/rcirc-color/rcirc-color.el 
index 27950be..134b6c5 100644
--- a/packages/rcirc-color/rcirc-color.el
+++ b/packages/rcirc-color/rcirc-color.el
@@ -1,10 +1,10 @@
 ;;; rcirc-color.el --- color nicks
-;; Copyright (C) 2005-2017  Free Software Foundation, Inc.
+;; Copyright (C) 2005-2018  Free Software Foundation, Inc.
 ;; Author: Alex Schroeder <address@hidden>
 ;; Maintainer: Alex Schroeder <address@hidden>
-;; Version: 0.3
+;; Version: 0.4
 ;; Keywords: comm
 ;; This file is part of GNU Emacs.
@@ -86,16 +86,21 @@ If you set this variable to a non-nil value, an md5 hash is
 computed based on the nickname and the first twelve bytes are
 used to determine the color: #rrrrggggbbbb.")
+(defvar rcirc-color-other-attributes nil
+  "Other attributes to use for nicks.
+Example: (setq rcirc-color-other-attributes '(:weight bold))")
 (defadvice rcirc-facify (before rcirc-facify-colors last activate)
   "Add colors to other nicks based on `rcirc-colors'."
   (when (and (eq face 'rcirc-other-nick)
              (not (string= string "")))
     (let ((cell (gethash string rcirc-color-mapping)))
       (unless cell
-       (setq cell (cons 'foreground-color
-                        (if rcirc-color-is-deterministic
-                            (concat "#" (substring (md5 string) 0 12))
-                          (elt rcirc-colors (random (length rcirc-colors))))))
+       (setq cell (nconc (list :foreground
+                               (if rcirc-color-is-deterministic
+                                   (concat "#" (substring (md5 string) 0 12))
+                                 (elt rcirc-colors (random (length 
+                          rcirc-color-other-attributes))
         (puthash (substring-no-properties string) cell rcirc-color-mapping))
       (setq face (list cell)))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]