emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/modus-vivendi-theme 4068405 33/35: Define palette as a


From: Stefan Monnier
Subject: [elpa] externals/modus-vivendi-theme 4068405 33/35: Define palette as a constant
Date: Wed, 24 Jun 2020 12:42:51 -0400 (EDT)

branch: externals/modus-vivendi-theme
commit 40684056d626235f83bda13ff36f8ee2ece7f8fd
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Define palette as a constant
    
    I made this switch because I read '(info "(elisp) Defining Variables")',[0]
    and was immediately drawn to the following reference:
    
        One notable difference between the two forms is that defconst
        unconditionally initializes the variable, whereas defvar initializes
        it only if it is originally void.
    
    [0]:
    
https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Variables.html#Defining-Variables
    
    From my part, this fixes an issue that has persisted ever since commit
    d6586a4f1, where a new colour value would not be read until after the
    Emacs session was terminated.  With defconst, new values are read on
    theme re-load.  This, in itself, is a win.  Because of that, I suspect
    that the change may also fix issue 51:
    https://gitlab.com/protesilaos/modus-themes/-/issues/51
---
 modus-operandi-theme.el | 2 +-
 modus-vivendi-theme.el  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modus-operandi-theme.el b/modus-operandi-theme.el
index 0ae7889d..67bff3b 100644
--- a/modus-operandi-theme.el
+++ b/modus-operandi-theme.el
@@ -582,7 +582,7 @@ AMOUNT is a customisation option."
 ;; faces is copied from zenbern-theme.el from commit 7dd7968:
 ;; https://github.com/bbatsov/zenburn-emacs
 (eval-and-compile
-  (defvar modus-operandi-theme-default-colors-alist
+  (defconst modus-operandi-theme-default-colors-alist
     '(;; base values
       ("bg-main" . "#ffffff") ("fg-main" . "#000000")
       ("bg-alt" . "#f0f0f0") ("fg-alt" . "#505050")
diff --git a/modus-vivendi-theme.el b/modus-vivendi-theme.el
index 2c9e3ce..c94c305 100644
--- a/modus-vivendi-theme.el
+++ b/modus-vivendi-theme.el
@@ -582,7 +582,7 @@ AMOUNT is a customisation option."
 ;; faces is copied from zenbern-theme.el from commit 7dd7968:
 ;; https://github.com/bbatsov/zenburn-emacs
 (eval-and-compile
-  (defvar modus-vivendi-theme-default-colors-alist
+  (defconst modus-vivendi-theme-default-colors-alist
     '(;; base values
       ("bg-main" . "#000000") ("fg-main" . "#ffffff")
       ("bg-alt" . "#181a20") ("fg-alt" . "#a8a8a8")



reply via email to

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