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

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

[nongnu] elpa/helm 0acbce6e5d: Check if cdr of special *acase clauses is


From: ELPA Syncer
Subject: [nongnu] elpa/helm 0acbce6e5d: Check if cdr of special *acase clauses is really a sexp
Date: Wed, 18 Dec 2024 01:00:21 -0500 (EST)

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

    Check if cdr of special *acase clauses is really a sexp
    
    This allow matching special *acase symbols in lists e.g.
    
    (let ((foo 1))
      (helm-acase foo
        ((dst* 1 2) it)))
    => 1
---
 helm-lib.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/helm-lib.el b/helm-lib.el
index 84a73b0164..52ae166bc9 100644
--- a/helm-lib.el
+++ b/helm-lib.el
@@ -581,8 +581,7 @@ this expression e.g.
 
 If KEYLIST is a list, it is compared with EXPR, also each
 elements of the list are checked with `member' to see if one
-matches EXPR, as a special case, the special symbols `guard*' and
-`dst*' have to NOT be at start of such list.
+matches EXPR.
 
 The last clause can use `t' or \\='otherwise as KEYLIST to specify a
 fallback clause when previous clauses didn't match, if such a clause
@@ -599,8 +598,9 @@ usable in all clauses to refer to EXPR.
   (unless (null clauses)
     (let* ((clause1  (car clauses))
            (key      (car clause1))
-           (isguard  (eq 'guard* (car-safe key)))
-           (isdst    (eq 'dst* (car-safe key)))
+           (issexp   (listp (car-safe (cdr-safe key))))
+           (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))))



reply via email to

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