Subject: [PATCH] Avoid cl-caaar etc. compatibility aliases in Tramp
From: Stefan Kangas <[email-masked]>
To: [email-masked]
Date: Wed, 12 Feb 2025 22:52:48 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Severity: wishlist

Hi Michael,

IIUC, Tramp now requires Emacs 28.1 to run (based on the check in
trampver.el).  If that is correct, could we stop relying on the
compatibility aliases cl-cXXXXr now?  These functions are built-in
since Emacs 26.1.  Please see the attached.
From 97ae005b83eef6f9ac6aa69747516668f3820194 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Thu, 13 Feb 2025 07:48:07 +0100
Subject: [PATCH] Avoid cl-caaar etc. compatibility aliases in Tramp

* lisp/net/tramp-gvfs.el (tramp-gvfs-handler-askquestion):
(tramp-gvfs-handler-mounted-unmounted):
(tramp-gvfs-connection-mounted-p):
* lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter):
(tramp-sh-inotifywait-process-filter): Don't use cl-caaar
etc. compatibility aliases.
---
 lisp/net/tramp-gvfs.el | 10 +++++-----
 lisp/net/tramp-sh.el   |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 53a6ffc48aa..2f0593b0a93 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1891,7 +1891,7 @@ tramp-gvfs-handler-askquestion
 
 	;; When the choice is "no", we set a dummy fuse-mountpoint in
 	;; order to leave the timeout.
-	(unless (zerop (cl-caddr result))
+	(unless (zerop (caddr result))
 	  (tramp-set-file-property v "/" "fuse-mountpoint" "/"))
 
 	result))))
@@ -1908,10 +1908,10 @@ tramp-gvfs-handler-mounted-unmounted
       ;; elements.
       (while (stringp (car elt)) (setq elt (cdr elt)))
       (let* ((fuse-mountpoint (tramp-gvfs-dbus-byte-array-to-string (cadr elt)))
-	     (mount-spec (cl-caddr elt))
+	     (mount-spec (caddr elt))
 	     (prefix (tramp-gvfs-dbus-byte-array-to-string (car mount-spec)))
 	     (default-location (tramp-gvfs-dbus-byte-array-to-string
-				(cl-cadddr elt)))
+				(cadddr elt)))
 	     (method (tramp-gvfs-dbus-byte-array-to-string
 		      (cadr (assoc "type" (cadr mount-spec)))))
 	     (user (tramp-gvfs-dbus-byte-array-to-string
@@ -2004,10 +2004,10 @@ tramp-gvfs-connection-mounted-p
        (while (stringp (car elt)) (setq elt (cdr elt)))
        (let* ((fuse-mountpoint (tramp-gvfs-dbus-byte-array-to-string
 				(cadr elt)))
-	      (mount-spec (cl-caddr elt))
+	      (mount-spec (caddr elt))
 	      (prefix (tramp-gvfs-dbus-byte-array-to-string (car mount-spec)))
 	      (default-location (tramp-gvfs-dbus-byte-array-to-string
-				 (cl-cadddr elt)))
+				 (cadddr elt)))
 	      (method (tramp-gvfs-dbus-byte-array-to-string
 		       (cadr (assoc "type" (cadr mount-spec)))))
 	      (user (tramp-gvfs-dbus-byte-array-to-string
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index e268489b7c8..a21af990e0e 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -3900,7 +3900,7 @@ tramp-sh-gio-monitor-process-filter
 	  (setq string (replace-match "" nil nil string))
           ;; Add an Emacs event now.
 	  ;; `insert-special-event' exists since Emacs 31.
-	  (when (member (cl-caadr object) events)
+	  (when (member (caadr object) events)
 	    (tramp-compat-funcall
                 (if (fboundp 'insert-special-event)
                     'insert-special-event
@@ -3937,7 +3937,7 @@ tramp-sh-inotifywait-process-filter
 		   (process-get proc 'tramp-watch-name))))))
         ;; Add an Emacs event now.
 	;; `insert-special-event' exists since Emacs 31.
-	(when (member (cl-caadr object) events)
+	(when (member (caadr object) events)
 	  (tramp-compat-funcall
               (if (fboundp 'insert-special-event)
                   'insert-special-event
-- 
2.48.1