emacs-diffs
[Top][All Lists]
Advanced

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

master 0debadb 2/3: Minor code cleanup in Tramp


From: Michael Albinus
Subject: master 0debadb 2/3: Minor code cleanup in Tramp
Date: Fri, 24 Jan 2020 08:42:34 -0500 (EST)

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

    Minor code cleanup in Tramp
---
 lisp/net/tramp-rclone.el   |  8 ++++----
 lisp/net/tramp-sh.el       | 30 +++++++++++++++---------------
 lisp/net/tramp-sudoedit.el |  8 ++++----
 lisp/net/tramp.el          | 33 ++++++++++++++++-----------------
 4 files changed, 39 insertions(+), 40 deletions(-)

diff --git a/lisp/net/tramp-rclone.el b/lisp/net/tramp-rclone.el
index 3e029e4..445098a 100644
--- a/lisp/net/tramp-rclone.el
+++ b/lisp/net/tramp-rclone.el
@@ -270,8 +270,8 @@ file names."
   (filename newname &optional ok-if-already-exists keep-date
    preserve-uid-gid preserve-extended-attributes)
   "Like `copy-file' for Tramp files."
-  (setq filename (expand-file-name filename))
-  (setq newname (expand-file-name newname))
+  (setq filename (expand-file-name filename)
+       newname (expand-file-name newname))
   ;; At least one file a Tramp file?
   (if (or (tramp-tramp-file-p filename)
          (tramp-tramp-file-p newname))
@@ -428,8 +428,8 @@ file names."
 (defun tramp-rclone-handle-rename-file
   (filename newname &optional ok-if-already-exists)
   "Like `rename-file' for Tramp files."
-  (setq filename (expand-file-name filename))
-  (setq newname (expand-file-name newname))
+  (setq filename (expand-file-name filename)
+       newname (expand-file-name newname))
   ;; At least one file a Tramp file?
   (if (or (tramp-tramp-file-p filename)
           (tramp-tramp-file-p newname))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 5f2c1ad..23ce048 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1199,9 +1199,9 @@ component is used as the target of the symlink."
                   (tramp-error
                    v 'file-error
                    "Maximum number (%d) of symlinks exceeded" numchase-limit))
-                (setq result (reverse result))
-                ;; Combine list to form string.
-                (setq result
+                (setq result (reverse result)
+                      ;; Combine list to form string.
+                      result
                       (if result (string-join (cons "" result) "/") "/"))
                 (when (string-empty-p result) (setq result "/")))))
 
@@ -1987,8 +1987,8 @@ tramp-sh-handle-file-name-all-completions: internal error 
accessing `%s': `%s'"
   "Like `rename-file' for Tramp files."
   ;; Check if both files are local -- invoke normal rename-file.
   ;; Otherwise, use Tramp from local system.
-  (setq filename (expand-file-name filename))
-  (setq newname (expand-file-name newname))
+  (setq filename (expand-file-name filename)
+       newname (expand-file-name newname))
   ;; At least one file a Tramp file?
   (if (or (tramp-tramp-file-p filename)
           (tramp-tramp-file-p newname))
@@ -3976,8 +3976,8 @@ This function expects to be in the right *tramp* buffer."
          ;; Remove all ~/foo directories from dirlist.
          (let (newdl d)
            (while dirlist
-             (setq d (car dirlist))
-             (setq dirlist (cdr dirlist))
+             (setq d (car dirlist)
+                   dirlist (cdr dirlist))
              (unless (char-equal ?~ (aref d 0))
                (setq newdl (cons d newdl))))
            (setq dirlist (nreverse newdl))))
@@ -4470,8 +4470,8 @@ Goes through the list `tramp-local-coding-commands' and
        (catch 'wont-work-local
          (let ((format (nth 0 litem))
                (remote-commands tramp-remote-coding-commands))
-           (setq loc-enc (nth 1 litem))
-           (setq loc-dec (nth 2 litem))
+           (setq loc-enc (nth 1 litem)
+                 loc-dec (nth 2 litem))
            ;; If the local encoder or decoder is a string, the
            ;; corresponding command has to work locally.
            (if (not (stringp loc-enc))
@@ -4493,9 +4493,9 @@ Goes through the list `tramp-local-coding-commands' and
              (setq ritem (pop remote-commands))
              (catch 'wont-work-remote
                (when (equal format (nth 0 ritem))
-                 (setq rem-enc (nth 1 ritem))
-                 (setq rem-dec (nth 2 ritem))
-                 (setq rem-test (nth 3 ritem))
+                 (setq rem-enc (nth 1 ritem)
+                       rem-dec (nth 2 ritem)
+                       rem-test (nth 3 ritem))
                  ;; Check the remote test command if exists.
                  (when (stringp rem-test)
                    (tramp-message
@@ -4592,9 +4592,9 @@ Goes through the list `tramp-local-coding-commands' and
                      (throw 'wont-work-remote nil)))
 
                  ;; `rem-enc' and `rem-dec' could be a string meanwhile.
-                 (setq rem-enc (nth 1 ritem))
-                 (setq rem-dec (nth 2 ritem))
-                 (setq found t)))))))
+                 (setq rem-enc (nth 1 ritem)
+                       rem-dec (nth 2 ritem)
+                       found t)))))))
 
       (when found
        ;; Set connection properties.  Since the commands are risky
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el
index 9f08d5f..f258ad6 100644
--- a/lisp/net/tramp-sudoedit.el
+++ b/lisp/net/tramp-sudoedit.el
@@ -302,8 +302,8 @@ absolute file names."
   (filename newname &optional ok-if-already-exists keep-date
    preserve-uid-gid preserve-extended-attributes)
   "Like `copy-file' for Tramp files."
-  (setq filename (expand-file-name filename))
-  (setq newname (expand-file-name newname))
+  (setq filename (expand-file-name filename)
+       newname (expand-file-name newname))
   ;; At least one file a Tramp file?
   (if (or (tramp-tramp-file-p filename)
          (tramp-tramp-file-p newname))
@@ -640,8 +640,8 @@ component is used as the target of the symlink."
 (defun tramp-sudoedit-handle-rename-file
   (filename newname &optional ok-if-already-exists)
   "Like `rename-file' for Tramp files."
-  (setq filename (expand-file-name filename))
-  (setq newname (expand-file-name newname))
+  (setq filename (expand-file-name filename)
+       newname (expand-file-name newname))
   ;; At least one file a Tramp file?
   (if (or (tramp-tramp-file-p filename)
           (tramp-tramp-file-p newname))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 324b2a2..81c79bf 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1369,8 +1369,8 @@ This is METHOD, if non-nil.  Otherwise, do a lookup in
                 (setq item (pop choices))
                 (when (and (string-match-p (or (nth 0 item) "") (or host ""))
                            (string-match-p (or (nth 1 item) "") (or user "")))
-                  (setq lmethod (nth 2 item))
-                  (setq choices nil)))
+                  (setq lmethod (nth 2 item)
+                        choices nil)))
               lmethod)
             tramp-default-method)))
     ;; We must mark, whether a default value has been used.
@@ -1390,8 +1390,8 @@ This is USER, if non-nil.  Otherwise, do a lookup in
                 (setq item (pop choices))
                 (when (and (string-match-p (or (nth 0 item) "") (or method ""))
                            (string-match-p (or (nth 1 item) "") (or host "")))
-                  (setq luser (nth 2 item))
-                  (setq choices nil)))
+                  (setq luser (nth 2 item)
+                        choices nil)))
               luser)
             tramp-default-user)))
     ;; We must mark, whether a default value has been used.
@@ -1411,8 +1411,8 @@ This is HOST, if non-nil.  Otherwise, do a lookup in
                 (setq item (pop choices))
                 (when (and (string-match-p (or (nth 0 item) "") (or method ""))
                            (string-match-p (or (nth 1 item) "") (or user "")))
-                  (setq lhost (nth 2 item))
-                  (setq choices nil)))
+                  (setq lhost (nth 2 item)
+                        choices nil)))
               lhost)
             tramp-default-host)))
     ;; We must mark, whether a default value has been used.
@@ -3554,8 +3554,8 @@ User is always nil."
        ;; Save exit.
        (progn
          (when visit
-           (setq buffer-file-name filename)
-           (setq buffer-read-only (not (file-writable-p filename)))
+           (setq buffer-file-name filename
+                 buffer-read-only (not (file-writable-p filename)))
            (set-visited-file-modtime)
            (set-buffer-modified-p nil))
          (when (and (stringp local-copy)
@@ -4069,9 +4069,9 @@ See `tramp-process-actions' for the format of ACTIONS."
       (while (tramp-accept-process-output proc 0))
       (setq todo actions)
       (while todo
-       (setq item (pop todo))
-       (setq pattern (format "\\(%s\\)\\'" (symbol-value (nth 0 item))))
-       (setq action (nth 1 item))
+       (setq item (pop todo)
+             pattern (format "\\(%s\\)\\'" (symbol-value (nth 0 item)))
+             action (nth 1 item))
        (tramp-message
         vec 5 "Looking for regexp \"%s\" from remote shell" pattern)
        (when (tramp-check-for-regexp proc pattern)
@@ -4121,9 +4121,8 @@ performed successfully.  Any other value means an error."
                      (catch 'tramp-action
                        (tramp-process-one-action proc vec actions)))))
          (while (not exit)
-           (setq exit
-                 (catch 'tramp-action
-                   (tramp-process-one-action proc vec actions)))))
+           (setq exit (catch 'tramp-action
+                        (tramp-process-one-action proc vec actions)))))
        (with-current-buffer (tramp-get-connection-buffer vec)
          (widen)
          (tramp-message vec 6 "\n%s" (buffer-string)))
@@ -4441,9 +4440,9 @@ This is used to map a mode number to a permission 
string.")
        (suid   (> (logand (ash mode -9) 4) 0))
        (sgid   (> (logand (ash mode -9) 2) 0))
        (sticky (> (logand (ash mode -9) 1) 0)))
-    (setq user  (tramp-file-mode-permissions user  suid "s"))
-    (setq group (tramp-file-mode-permissions group sgid "s"))
-    (setq other (tramp-file-mode-permissions other sticky "t"))
+    (setq user  (tramp-file-mode-permissions user  suid "s")
+         group (tramp-file-mode-permissions group sgid "s")
+         other (tramp-file-mode-permissions other sticky "t"))
     (concat type user group other)))
 
 (defun tramp-file-mode-permissions (perm suid suid-text)



reply via email to

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