emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master edd0c24: * lisp/net/tramp-compat.el (tramp-compat-f


From: Michael Albinus
Subject: [Emacs-diffs] master edd0c24: * lisp/net/tramp-compat.el (tramp-compat-flatten-list): New defun.
Date: Mon, 10 Dec 2018 10:52:32 -0500 (EST)

branch: master
commit edd0c241162ed7242767c16a3737d84be336d4f9
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    * lisp/net/tramp-compat.el (tramp-compat-flatten-list): New defun.
---
 lisp/net/tramp-compat.el | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 0137724..046966e 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -270,6 +270,19 @@ A nil value for either argument stands for the current 
time."
            (unload-feature 'tramp-loaddefs 'force)
            (unload-feature 'tramp-compat 'force)))
 
+;; There does not exist a common `flatten-list' yet, this is discussed
+;; in Bug#33309.  For the time being we implement our own version,
+;; derived from `eshell-flatten-list'.
+(defun tramp-compat-flatten-list (args)
+  "Flatten any lists within ARGS, so that there are no sublists."
+  (let ((new-list (list t)))
+    (dolist (a args)
+      (if (and (listp a)
+              (listp (cdr a)))
+         (nconc new-list (tramp-compat-flatten-list a))
+       (nconc new-list (list a))))
+    (cdr new-list)))
+
 (provide 'tramp-compat)
 
 ;;; TODO:



reply via email to

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