branch: externals/compat
commit f621f305ba949420bcd75d610f400ab11caeb508
Author: Philip Kaludercic <[email protected]>
Commit: Philip Kaludercic <[email protected]>

    Move and-let* to compat-26
    
    The macro was unintentionally added to compat-25, along with if-let,
    when-let, etc.  Yet as it was added with Emacs 26, it should be moved
    to avoid confusion.
---
 compat-25.el |  8 --------
 compat-26.el | 11 +++++++++++
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/compat-25.el b/compat-25.el
index e90faa5611..707cbb67c2 100644
--- a/compat-25.el
+++ b/compat-25.el
@@ -154,14 +154,6 @@ This is like `when-let' but doesn't handle a VARLIST of 
the form
   (declare (indent 1) (debug if-let*))
   `(compat--if-let* ,varlist ,(macroexp-progn body)))
 
-(compat-defmacro and-let* (varlist &rest body)
-  "Bind variables according to VARLIST and conditionally evaluate BODY.
-Like `when-let*', except if BODY is empty and all the bindings
-are non-nil, then the result is non-nil."
-  :feature 'subr-x
-  (declare (indent 1) (debug if-let*))
-  `(compat--when-let* ,varlist ,@(or body '(t))))
-
 (compat-defmacro if-let (spec then &rest else)
   "Bind variables according to SPEC and evaluate THEN or ELSE.
 Evaluate each binding in turn, as in `let*', stopping if a
diff --git a/compat-26.el b/compat-26.el
index 564ad9c76d..955e188ca9 100644
--- a/compat-26.el
+++ b/compat-26.el
@@ -366,5 +366,16 @@ the variable `temporary-file-directory' is returned."
           default-directory
         temporary-file-directory))))
 
+;;;; Defined in subr-x.el
+
+(declare-function compat--when-let* "compat-25" (varlist &rest body))
+(compat-defmacro and-let* (varlist &rest body)
+  "Bind variables according to VARLIST and conditionally evaluate BODY.
+Like `when-let*', except if BODY is empty and all the bindings
+are non-nil, then the result is non-nil."
+  :feature 'subr-x
+  (declare (indent 1) (debug if-let*))
+  `(compat--when-let* ,varlist ,@(or body '(t))))
+
 (provide 'compat-26)
 ;;; compat-26.el ends here

Reply via email to