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

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

[nongnu] elpa/helm 2565ace037: DRY in *acase


From: ELPA Syncer
Subject: [nongnu] elpa/helm 2565ace037: DRY in *acase
Date: Fri, 20 Dec 2024 04:00:36 -0500 (EST)

branch: elpa/helm
commit 2565ace0375ead528fb5f55db1fa7f24df403924
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    DRY in *acase
---
 helm-lib.el | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/helm-lib.el b/helm-lib.el
index 194977b0cf..c6b7983433 100644
--- a/helm-lib.el
+++ b/helm-lib.el
@@ -598,21 +598,22 @@ usable in all clauses to refer to EXPR.
 \(fn EXPR (KEYLIST BODY...)...)"
   (declare (indent 1) (debug (form &rest ([&or (symbolp form) sexp] body))))
   (unless (null clauses)
-    (let* ((clause1  (car clauses))
-           (key      (car clause1))
+    (let* ((clause1    (car clauses))
+           (key        (car clause1))
+           (sexp       (car-safe (cdr-safe key)))
+           (sp-sym     (car-safe key))
            ;; Ensure dst* and guard* are not treated as special symbols when
            ;; they are not followed by one sexp and nothing else, however if 
the
            ;; following sexp is not meant to be evaluated but just compared we
            ;; fail miserably, is it worth fixing it?
-           (issexp   (and (consp (car-safe (cdr-safe key)))
-                          (= (length key) 2)))
-           (isguard  (and (eq 'guard* (car-safe key)) issexp))
-           (isdst    (and (eq 'dst* (car-safe key)) issexp))
-           (special  (or isguard isdst))
-           (sexp     (and isguard (cadr key)))
-           (dst-sexp (and isdst (cadr key))))
+           (issexp     (and (consp sexp) (= (length key) 2)))
+           (isguard    (and (eq 'guard* sp-sym) issexp))
+           (isdst      (and (eq 'dst* sp-sym) issexp))
+           (special    (or isguard isdst))
+           (guard-sexp (and isguard sexp))
+           (dst-sexp   (and isdst sexp)))
       `(let* ((it    ,expr)
-              (guard ,sexp)
+              (guard ,guard-sexp)
               (dst   (and (consp it) ',dst-sexp)))
          (cond ((or guard
                     (and ,(not special)



reply via email to

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