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

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

[elpa] externals/compat f57791877f 4/8: Use nth/nthcdr instead of cad+r/


From: ELPA Syncer
Subject: [elpa] externals/compat f57791877f 4/8: Use nth/nthcdr instead of cad+r/cdd+r if possible
Date: Sat, 5 Feb 2022 11:57:23 -0500 (EST)

branch: externals/compat
commit f57791877f5d787d7097412b2c11a3d31e643cbf
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Use nth/nthcdr instead of cad+r/cdd+r if possible
    
    This avoids byte compilation issues on versions of Emacs where
    c[ad]{3,}r functions are not defined.
---
 compat-28.1.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/compat-28.1.el b/compat-28.1.el
index df6c8e276b..f37f8c8025 100644
--- a/compat-28.1.el
+++ b/compat-28.1.el
@@ -443,8 +443,8 @@ as the new values of the bound variables in the recursive 
invocation."
                  ((eq (car-safe expr) 'if)
                   (append (list 'if
                                 (cadr expr)
-                                (funcall tco (caddr expr)))
-                          (funcall tco-progn (cdddr expr))))
+                                (funcall tco (nth 2 expr)))
+                          (funcall tco-progn (nthcdr 3 expr))))
                  ((eq (car-safe expr) 'cond)
                   (let ((conds (cdr expr)) body)
                     (while conds
@@ -466,12 +466,12 @@ as the new values of the bound variables in the recursive 
invocation."
                              ,(funcall tco (cons 'or (cddr expr))))))
                     (funcall tco (cadr expr))))
                  ((eq (car-safe expr) 'condition-case)
-                  (append (list 'condition-case (cadr expr) (caddr expr))
+                  (append (list 'condition-case (cadr expr) (nth 2 expr))
                           (mapcar
                            (lambda (handler)
                              (cons (car handler)
                                    (funcall tco-progn (cdr handler))))
-                           (cdddr expr))))
+                           (nthcdr 3 expr))))
                  ((memq (car-safe expr) '(and progn))
                   (cons (car expr) (funcall tco-progn (cdr expr))))
                  ((memq (car-safe expr) '(let let*))



reply via email to

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