summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2017-03-23 14:58:04 +0100
committerMichael Albinus <michael.albinus@gmx.de>2017-03-23 14:58:04 +0100
commite1392faae5c5cc7805b52efacbb25a71213afdeb (patch)
treee094f7eeaa13bd26a28f202a51b026e7c9c12017 /lisp/net
parente472cfe8f3b01f29a49614f6207e4128e8b36b8c (diff)
downloademacs-e1392faae5c5cc7805b52efacbb25a71213afdeb.tar.gz
Use lexical-bind in Tramp
* lisp/net/tramp*.el: Add lexical-binding cookie. Move declarations up. * lisp/net/tramp-adb.el (tramp-adb-parse-device-names): Use `push' rather than `add-to-list'. (tramp-adb-get-device): Remove unused variable. * lisp/net/tramp-gvfs.el (tramp-gvfs-parse-device-names): Remove unused variable. * lisp/net/tramp.el (auto-save-file-name-transforms): Declare. (tramp-find-file-name-coding-system-alist): Use `push' rather than `add-to-list'. * test/lisp/net/tramp-tests.el: Add lexical-binding cookie. Require 'dired. Move declarations up. (tramp-test32-make-nearby-temp-file): Wrap `make-nearby-temp-file' and `temporary-file-directory' calls with `with-no-warnings'. (tramp-test35-asynchronous-requests): Mark unused variable.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp-adb.el7
-rw-r--r--lisp/net/tramp-cache.el2
-rw-r--r--lisp/net/tramp-cmds.el2
-rw-r--r--lisp/net/tramp-compat.el2
-rw-r--r--lisp/net/tramp-ftp.el2
-rw-r--r--lisp/net/tramp-gvfs.el5
-rw-r--r--lisp/net/tramp-sh.el8
-rw-r--r--lisp/net/tramp-smb.el2
-rw-r--r--lisp/net/tramp-uu.el2
-rw-r--r--lisp/net/tramp.el20
-rw-r--r--lisp/net/trampver.el2
11 files changed, 24 insertions, 30 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index bf89ab37123..4191c3ec93a 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -1,4 +1,4 @@
-;;; tramp-adb.el --- Functions for calling Android Debug Bridge from Tramp
+;;; tramp-adb.el --- Functions for calling Android Debug Bridge from Tramp -*- lexical-binding:t -*-
;; Copyright (C) 2011-2017 Free Software Foundation, Inc.
@@ -209,7 +209,7 @@ pass to the OPERATION."
(tramp-message v 6 "\n%s" (buffer-string))
(goto-char (point-min))
(while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t)
- (add-to-list 'result (list nil (match-string 1))))
+ (push (list nil (match-string 1)) result))
;; Replace ":" by "#".
(mapc
@@ -1060,8 +1060,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\"
;; unwanted entries first.
(tramp-flush-connection-property nil)
(with-tramp-connection-property (tramp-get-connection-process vec) "device"
- (let* ((method (tramp-file-name-method vec))
- (host (tramp-file-name-host vec))
+ (let* ((host (tramp-file-name-host vec))
(port (tramp-file-name-port vec))
(devices (mapcar 'cadr (tramp-adb-parse-device-names nil))))
(replace-regexp-in-string
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index ce7df02e094..64268cfc25a 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -1,4 +1,4 @@
-;;; tramp-cache.el --- file information caching for Tramp
+;;; tramp-cache.el --- file information caching for Tramp -*- lexical-binding:t -*-
;; Copyright (C) 2000, 2005-2017 Free Software Foundation, Inc.
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 576f9b1eadc..c41b5b5659e 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -1,4 +1,4 @@
-;;; tramp-cmds.el --- Interactive commands for Tramp
+;;; tramp-cmds.el --- Interactive commands for Tramp -*- lexical-binding:t -*-
;; Copyright (C) 2007-2017 Free Software Foundation, Inc.
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 8e5b3e45d13..8f346eb4409 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -1,4 +1,4 @@
-;;; tramp-compat.el --- Tramp compatibility functions
+;;; tramp-compat.el --- Tramp compatibility functions -*- lexical-binding:t -*-
;; Copyright (C) 2007-2017 Free Software Foundation, Inc.
diff --git a/lisp/net/tramp-ftp.el b/lisp/net/tramp-ftp.el
index 85e4f2b0f0c..231383fde3d 100644
--- a/lisp/net/tramp-ftp.el
+++ b/lisp/net/tramp-ftp.el
@@ -1,4 +1,4 @@
-;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP
+;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP -*- lexical-binding:t -*-
;; Copyright (C) 2002-2017 Free Software Foundation, Inc.
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 7725d40f198..561f6c8f79d 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1,4 +1,4 @@
-;;; tramp-gvfs.el --- Tramp access functions for GVFS daemon
+;;; tramp-gvfs.el --- Tramp access functions for GVFS daemon -*- lexical-binding:t -*-
;; Copyright (C) 2009-2017 Free Software Foundation, Inc.
@@ -1874,12 +1874,9 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi."
(lambda (x)
(let* ((list (split-string x ";"))
(host (nth 6 list))
- (port (nth 8 list))
(text (tramp-compat-funcall
'split-string (nth 9 list) "\" \"" 'omit "\""))
user)
-; (when (and port (not (string-equal port "0")))
-; (setq host (format "%s%s%s" host tramp-prefix-port-regexp port)))
;; A user is marked in a TXT field like "u=guest".
(while text
(when (string-match "u=\\(.+\\)$" (car text))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index af27d3e28ec..486e002facf 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1,4 +1,4 @@
-;;; tramp-sh.el --- Tramp access functions for (s)sh-like connections
+;;; tramp-sh.el --- Tramp access functions for (s)sh-like connections -*- lexical-binding:t -*-
;; Copyright (C) 1998-2017 Free Software Foundation, Inc.
@@ -33,6 +33,9 @@
(eval-when-compile
(require 'cl)
(require 'dired))
+
+(declare-function dired-remove-file "dired-aux")
+(defvar dired-compress-file-suffixes)
(defvar vc-handled-backends)
(defvar vc-bzr-program)
(defvar vc-git-program)
@@ -2593,9 +2596,6 @@ The method used must be an out-of-band method."
;; Dired.
-(defvar dired-compress-file-suffixes)
-(declare-function dired-remove-file "dired-aux")
-
(defun tramp-sh-handle-dired-compress-file (file)
"Like `dired-compress-file' for Tramp files."
;; Code stolen mainly from dired-aux.el.
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 91f69567573..eaa8ac655e0 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1,4 +1,4 @@
-;;; tramp-smb.el --- Tramp access functions for SMB servers
+;;; tramp-smb.el --- Tramp access functions for SMB servers -*- lexical-binding:t -*-
;; Copyright (C) 2002-2017 Free Software Foundation, Inc.
diff --git a/lisp/net/tramp-uu.el b/lisp/net/tramp-uu.el
index 0aa2cc09924..5e5f05da4a8 100644
--- a/lisp/net/tramp-uu.el
+++ b/lisp/net/tramp-uu.el
@@ -1,4 +1,4 @@
-;;; tramp-uu.el --- uuencode in Lisp
+;;; tramp-uu.el --- uuencode in Lisp -*- lexical-binding:t -*-
;; Copyright (C) 2002-2017 Free Software Foundation, Inc.
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index fdd4661decb..a9254693adb 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1,4 +1,4 @@
-;;; tramp.el --- Transparent Remote Access, Multiple Protocol
+;;; tramp.el --- Transparent Remote Access, Multiple Protocol -*- lexical-binding:t -*-
;; Copyright (C) 1998-2017 Free Software Foundation, Inc.
@@ -60,7 +60,10 @@
;; Pacify byte-compiler.
(eval-when-compile
(require 'cl))
+(defvar auto-save-file-name-transforms)
(defvar eshell-path-env)
+(defvar ls-lisp-use-insert-directory-program)
+(defvar outline-regexp)
;;; User Customizable Internal Variables:
@@ -1374,8 +1377,6 @@ Point must be at the beginning of a header line.
The outline level is equal to the verbosity of the Tramp message."
(1+ (string-to-number (match-string 1))))
-(defvar outline-regexp)
-
(defun tramp-get-debug-buffer (vec)
"Get the debug buffer for VEC."
(with-current-buffer
@@ -1871,13 +1872,12 @@ temporary file names. If `file-coding-system-alist' contains an
expression, which matches more than the file name suffix, the
coding system might not be determined. This function repairs it."
(let (result)
- (dolist (elt file-coding-system-alist result)
+ (dolist (elt file-coding-system-alist (nreverse result))
(when (and (consp elt) (string-match (car elt) filename))
;; We found a matching entry in `file-coding-system-alist'.
;; So we add a similar entry, but with the temporary file name
;; as regexp.
- (add-to-list
- 'result (cons (regexp-quote tmpname) (cdr elt)) 'append)))))
+ (push (cons (regexp-quote tmpname) (cdr elt)) result)))))
;;;###autoload
(progn (defun tramp-run-real-handler (operation args)
@@ -2328,9 +2328,9 @@ not in completion mode."
(when elt
(string-match tramp-prefix-regexp elt)
(setq elt (replace-match (concat tramp-prefix-format hop) nil nil elt))
- (add-to-list
- 'result1
- (substring elt (length (tramp-drop-volume-letter directory))))))
+ (push
+ (substring elt (length (tramp-drop-volume-letter directory)))
+ result1)))
;; Complete local parts.
(append
@@ -2955,8 +2955,6 @@ User is always nil."
backup-directory-alist)))
(tramp-run-real-handler 'find-backup-file-name (list filename)))))
-(defvar ls-lisp-use-insert-directory-program)
-
(defun tramp-handle-insert-directory
(filename switches &optional wildcard full-directory-p)
"Like `insert-directory' for Tramp files."
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 35ad2f0acff..35b5eb6728a 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -1,4 +1,4 @@
-;;; trampver.el --- Transparent Remote Access, Multiple Protocol
+;;; trampver.el --- Transparent Remote Access, Multiple Protocol -*- lexical-binding:t -*-
;;; lisp/trampver.el. Generated from trampver.el.in by configure.
;; Copyright (C) 2003-2017 Free Software Foundation, Inc.