From: Trevor Arjeski Date: Wed, 27 Nov 2024 07:12:07 +0000 (+0300) Subject: Fix Gnus logo color customization X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f5e712a4369c2e198a051e8b8713f1012f1ccc89;p=emacs.git 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) (cherry picked from commit 77d0078a6c50c95b63ac7c3739ee325264deff34) --- diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 1fc1f75d358..091a389cefb 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -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))