~protesilaos/ef-themes

Prefer {if,when}-let* over {if,when}-let v1 APPLIED

Philip Kaludercic: 2
 Prefer {if,when}-let* over {if,when}-let
 Drop the minimum required version of Emacs to 26.1

 2 files changed, 4 insertions(+), 4 deletions(-)
Protesilaos Stavrou <info@protesilaos.com> writes:
Next
Protesilaos Stavrou <info@protesilaos.com> writes:
Next
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~protesilaos/ef-themes/patches/34787/mbox | git am -3
Learn more about email & git

[PATCH 1/2] Prefer {if,when}-let* over {if,when}-let Export this patch

The former do not support the obsolete single-binding syntax, and
make clear that both macros operate more like let* than let by
evaluating and binding variables sequentially.
---
 ef-themes.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ef-themes.el b/ef-themes.el
index c20c958..57b2695 100644
--- a/ef-themes.el
+++ b/ef-themes.el
@@ -280,7 +280,7 @@ sequence given SEQ-PRED, using SEQ-DEFAULT as a fallback."

(defun ef-themes--current-theme ()
  "Return first enabled Ef theme."
  (when-let ((themes (ef-themes--list-enabled-themes)))
  (when-let* ((themes (ef-themes--list-enabled-themes)))
    (car themes)))

(defun ef-themes--palette (theme)
@@ -289,7 +289,7 @@ sequence given SEQ-PRED, using SEQ-DEFAULT as a fallback."

(defun ef-themes--current-theme-palette ()
  "Return palette of active Ef theme, else produce `user-error'."
  (if-let ((palette (ef-themes--palette (ef-themes--current-theme))))
  (if-let* ((palette (ef-themes--palette (ef-themes--current-theme))))
      palette
    (user-error "No enabled Ef theme could be found")))

@@ -328,7 +328,7 @@ When called from Lisp, THEME is a symbol."
(defun ef-themes-toggle ()
  "Toggle between the two `ef-themes-to-toggle'."
  (interactive)
  (when-let ((themes (ef-themes--toggle-theme-p))
  (when-let* ((themes (ef-themes--toggle-theme-p))
             (one (car themes))
             (two (cadr themes)))
    (unless (eq (length themes) 2)
-- 
2.37.2
Hello Philip,

I installed this patch, but not the other about lowering the Emacs
version.  The reason is that there is at least one Emacs 28 face I am
aware of that is inherited in other places: help-key-binding.

It is easy to change this situation by defining our own face, but that
has to be done first.

Also, there may be more cases like this one, though I think it is the
only one.  I took a quick look at all the :inherit attributes and
everything seems okay.

All the best,
Prot

[PATCH 2/2] Drop the minimum required version of Emacs to 26.1 Export this patch

---
 ef-themes.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ef-themes.el b/ef-themes.el
index 57b2695..f770f3d 100644
--- a/ef-themes.el
+++ b/ef-themes.el
@@ -7,7 +7,7 @@
;; URL: https://git.sr.ht/~protesilaos/ef-themes
;; Mailing-List: https://lists.sr.ht/~protesilaos/ef-themes
;; Version: 0.2.1
;; Package-Requires: ((emacs "28.1"))
;; Package-Requires: ((emacs "26.1"))
;; Keywords: faces, theme, accessibility

;; This file is NOT part of GNU Emacs.
-- 
2.37.2