Fix Gnus logo color customization

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)
This commit is contained in:
Trevor Arjeski 2024-11-27 10:12:07 +03:00 committed by Stefan Kangas
parent 481336967c
commit 77d0078a6c

View 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))