]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Gnus logo color customization
authorTrevor Arjeski <tmarjeski@gmail.com>
Wed, 27 Nov 2024 07:12:07 +0000 (10:12 +0300)
committerEshel Yaron <me@eshelyaron.com>
Wed, 12 Feb 2025 10:52:28 +0000 (11:52 +0100)
Fix a bug where customizing `gnus-logo-color-style' from use-package's
:custom keyword did not set `gnus-logo-colors' before Gnus is launched.

This patch does the following:
- Implements a :set keyword on `gnus-logo-color-style' which will
  correctly set `gnus-logo-colors'
- Exposes `gnus-logo-colors' using `defcustom' for more fine-grained
  customization
- Uses :set-after on `gnus-logo-colors' so that it is set after
  `gnus-logo-color-style'

* lisp/gnus/gnus.el (gnus-logo-colors): Convert to defcustom.
(gnus-logo-color-style): Add :set property.  (Bug#74554)

(cherry picked from commit 77d0078a6c50c95b63ac7c3739ee325264deff34)

lisp/gnus/gnus.el

index 1fc1f75d3581061e091733b9b0d60c9d10b72f52..091a389cefbe88159323c0252eaee13016a0cdf0 100644 (file)
@@ -757,16 +757,22 @@ be used directly.")
     (september "#bf9900" "#ffcc00"))
   "Color alist used for the Gnus logo.")
 
+(defcustom gnus-logo-colors nil
+  "Colors used for the Gnus logo."
+  :set-after '(gnus-logo-color-style)
+  :type '(list color color)
+  :group 'gnus-xmas)
+
 (defcustom gnus-logo-color-style 'ma
   "Color styles used for the Gnus logo."
   :type `(choice ,@(mapcar (lambda (elem) (list 'const (car elem)))
                           gnus-logo-color-alist))
+  :set (lambda (sym val)
+         (set-default-toplevel-value sym val)
+         (set-default-toplevel-value 'gnus-logo-colors
+                                     (cdr (assq val gnus-logo-color-alist))))
   :group 'gnus-xmas)
 
-(defvar gnus-logo-colors
-  (cdr (assq gnus-logo-color-style gnus-logo-color-alist))
-  "Colors used for the Gnus logo.")
-
 (defvar image-load-path)
 (declare-function image-size "image.c" (spec &optional pixels frame))