aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus2017-03-23 14:58:04 +0100
committerMichael Albinus2017-03-23 14:58:04 +0100
commite1392faae5c5cc7805b52efacbb25a71213afdeb (patch)
treee094f7eeaa13bd26a28f202a51b026e7c9c12017 /lisp
parente472cfe8f3b01f29a49614f6207e4128e8b36b8c (diff)
downloademacs-e1392faae5c5cc7805b52efacbb25a71213afdeb.tar.gz
emacs-e1392faae5c5cc7805b52efacbb25a71213afdeb.zip
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')
-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 @@
1;;; tramp-adb.el --- Functions for calling Android Debug Bridge from Tramp 1;;; tramp-adb.el --- Functions for calling Android Debug Bridge from Tramp -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2011-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2011-2017 Free Software Foundation, Inc.
4 4
@@ -209,7 +209,7 @@ pass to the OPERATION."
209 (tramp-message v 6 "\n%s" (buffer-string)) 209 (tramp-message v 6 "\n%s" (buffer-string))
210 (goto-char (point-min)) 210 (goto-char (point-min))
211 (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t) 211 (while (search-forward-regexp "^\\(\\S-+\\)[[:space:]]+device$" nil t)
212 (add-to-list 'result (list nil (match-string 1)))) 212 (push (list nil (match-string 1)) result))
213 213
214 ;; Replace ":" by "#". 214 ;; Replace ":" by "#".
215 (mapc 215 (mapc
@@ -1060,8 +1060,7 @@ E.g. a host name \"192.168.1.1#5555\" returns \"192.168.1.1:5555\"
1060 ;; unwanted entries first. 1060 ;; unwanted entries first.
1061 (tramp-flush-connection-property nil) 1061 (tramp-flush-connection-property nil)
1062 (with-tramp-connection-property (tramp-get-connection-process vec) "device" 1062 (with-tramp-connection-property (tramp-get-connection-process vec) "device"
1063 (let* ((method (tramp-file-name-method vec)) 1063 (let* ((host (tramp-file-name-host vec))
1064 (host (tramp-file-name-host vec))
1065 (port (tramp-file-name-port vec)) 1064 (port (tramp-file-name-port vec))
1066 (devices (mapcar 'cadr (tramp-adb-parse-device-names nil)))) 1065 (devices (mapcar 'cadr (tramp-adb-parse-device-names nil))))
1067 (replace-regexp-in-string 1066 (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 @@
1;;; tramp-cache.el --- file information caching for Tramp 1;;; tramp-cache.el --- file information caching for Tramp -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2000, 2005-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2000, 2005-2017 Free Software Foundation, Inc.
4 4
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 @@
1;;; tramp-cmds.el --- Interactive commands for Tramp 1;;; tramp-cmds.el --- Interactive commands for Tramp -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2007-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2007-2017 Free Software Foundation, Inc.
4 4
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 @@
1;;; tramp-compat.el --- Tramp compatibility functions 1;;; tramp-compat.el --- Tramp compatibility functions -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2007-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2007-2017 Free Software Foundation, Inc.
4 4
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 @@
1;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP 1;;; tramp-ftp.el --- Tramp convenience functions for Ange-FTP -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2002-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2002-2017 Free Software Foundation, Inc.
4 4
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 @@
1;;; tramp-gvfs.el --- Tramp access functions for GVFS daemon 1;;; tramp-gvfs.el --- Tramp access functions for GVFS daemon -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2009-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2009-2017 Free Software Foundation, Inc.
4 4
@@ -1874,12 +1874,9 @@ This uses \"avahi-browse\" in case D-Bus is not enabled in Avahi."
1874 (lambda (x) 1874 (lambda (x)
1875 (let* ((list (split-string x ";")) 1875 (let* ((list (split-string x ";"))
1876 (host (nth 6 list)) 1876 (host (nth 6 list))
1877 (port (nth 8 list))
1878 (text (tramp-compat-funcall 1877 (text (tramp-compat-funcall
1879 'split-string (nth 9 list) "\" \"" 'omit "\"")) 1878 'split-string (nth 9 list) "\" \"" 'omit "\""))
1880 user) 1879 user)
1881; (when (and port (not (string-equal port "0")))
1882; (setq host (format "%s%s%s" host tramp-prefix-port-regexp port)))
1883 ;; A user is marked in a TXT field like "u=guest". 1880 ;; A user is marked in a TXT field like "u=guest".
1884 (while text 1881 (while text
1885 (when (string-match "u=\\(.+\\)$" (car text)) 1882 (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 @@
1;;; tramp-sh.el --- Tramp access functions for (s)sh-like connections 1;;; tramp-sh.el --- Tramp access functions for (s)sh-like connections -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1998-2017 Free Software Foundation, Inc. 3;; Copyright (C) 1998-2017 Free Software Foundation, Inc.
4 4
@@ -33,6 +33,9 @@
33(eval-when-compile 33(eval-when-compile
34 (require 'cl) 34 (require 'cl)
35 (require 'dired)) 35 (require 'dired))
36
37(declare-function dired-remove-file "dired-aux")
38(defvar dired-compress-file-suffixes)
36(defvar vc-handled-backends) 39(defvar vc-handled-backends)
37(defvar vc-bzr-program) 40(defvar vc-bzr-program)
38(defvar vc-git-program) 41(defvar vc-git-program)
@@ -2593,9 +2596,6 @@ The method used must be an out-of-band method."
2593 2596
2594;; Dired. 2597;; Dired.
2595 2598
2596(defvar dired-compress-file-suffixes)
2597(declare-function dired-remove-file "dired-aux")
2598
2599(defun tramp-sh-handle-dired-compress-file (file) 2599(defun tramp-sh-handle-dired-compress-file (file)
2600 "Like `dired-compress-file' for Tramp files." 2600 "Like `dired-compress-file' for Tramp files."
2601 ;; Code stolen mainly from dired-aux.el. 2601 ;; 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 @@
1;;; tramp-smb.el --- Tramp access functions for SMB servers 1;;; tramp-smb.el --- Tramp access functions for SMB servers -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2002-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2002-2017 Free Software Foundation, Inc.
4 4
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 @@
1;;; tramp-uu.el --- uuencode in Lisp 1;;; tramp-uu.el --- uuencode in Lisp -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2002-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2002-2017 Free Software Foundation, Inc.
4 4
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 @@
1;;; tramp.el --- Transparent Remote Access, Multiple Protocol 1;;; tramp.el --- Transparent Remote Access, Multiple Protocol -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1998-2017 Free Software Foundation, Inc. 3;; Copyright (C) 1998-2017 Free Software Foundation, Inc.
4 4
@@ -60,7 +60,10 @@
60;; Pacify byte-compiler. 60;; Pacify byte-compiler.
61(eval-when-compile 61(eval-when-compile
62 (require 'cl)) 62 (require 'cl))
63(defvar auto-save-file-name-transforms)
63(defvar eshell-path-env) 64(defvar eshell-path-env)
65(defvar ls-lisp-use-insert-directory-program)
66(defvar outline-regexp)
64 67
65;;; User Customizable Internal Variables: 68;;; User Customizable Internal Variables:
66 69
@@ -1374,8 +1377,6 @@ Point must be at the beginning of a header line.
1374The outline level is equal to the verbosity of the Tramp message." 1377The outline level is equal to the verbosity of the Tramp message."
1375 (1+ (string-to-number (match-string 1)))) 1378 (1+ (string-to-number (match-string 1))))
1376 1379
1377(defvar outline-regexp)
1378
1379(defun tramp-get-debug-buffer (vec) 1380(defun tramp-get-debug-buffer (vec)
1380 "Get the debug buffer for VEC." 1381 "Get the debug buffer for VEC."
1381 (with-current-buffer 1382 (with-current-buffer
@@ -1871,13 +1872,12 @@ temporary file names. If `file-coding-system-alist' contains an
1871expression, which matches more than the file name suffix, the 1872expression, which matches more than the file name suffix, the
1872coding system might not be determined. This function repairs it." 1873coding system might not be determined. This function repairs it."
1873 (let (result) 1874 (let (result)
1874 (dolist (elt file-coding-system-alist result) 1875 (dolist (elt file-coding-system-alist (nreverse result))
1875 (when (and (consp elt) (string-match (car elt) filename)) 1876 (when (and (consp elt) (string-match (car elt) filename))
1876 ;; We found a matching entry in `file-coding-system-alist'. 1877 ;; We found a matching entry in `file-coding-system-alist'.
1877 ;; So we add a similar entry, but with the temporary file name 1878 ;; So we add a similar entry, but with the temporary file name
1878 ;; as regexp. 1879 ;; as regexp.
1879 (add-to-list 1880 (push (cons (regexp-quote tmpname) (cdr elt)) result)))))
1880 'result (cons (regexp-quote tmpname) (cdr elt)) 'append)))))
1881 1881
1882;;;###autoload 1882;;;###autoload
1883(progn (defun tramp-run-real-handler (operation args) 1883(progn (defun tramp-run-real-handler (operation args)
@@ -2328,9 +2328,9 @@ not in completion mode."
2328 (when elt 2328 (when elt
2329 (string-match tramp-prefix-regexp elt) 2329 (string-match tramp-prefix-regexp elt)
2330 (setq elt (replace-match (concat tramp-prefix-format hop) nil nil elt)) 2330 (setq elt (replace-match (concat tramp-prefix-format hop) nil nil elt))
2331 (add-to-list 2331 (push
2332 'result1 2332 (substring elt (length (tramp-drop-volume-letter directory)))
2333 (substring elt (length (tramp-drop-volume-letter directory)))))) 2333 result1)))
2334 2334
2335 ;; Complete local parts. 2335 ;; Complete local parts.
2336 (append 2336 (append
@@ -2955,8 +2955,6 @@ User is always nil."
2955 backup-directory-alist))) 2955 backup-directory-alist)))
2956 (tramp-run-real-handler 'find-backup-file-name (list filename))))) 2956 (tramp-run-real-handler 'find-backup-file-name (list filename)))))
2957 2957
2958(defvar ls-lisp-use-insert-directory-program)
2959
2960(defun tramp-handle-insert-directory 2958(defun tramp-handle-insert-directory
2961 (filename switches &optional wildcard full-directory-p) 2959 (filename switches &optional wildcard full-directory-p)
2962 "Like `insert-directory' for Tramp files." 2960 "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 @@
1;;; trampver.el --- Transparent Remote Access, Multiple Protocol 1;;; trampver.el --- Transparent Remote Access, Multiple Protocol -*- lexical-binding:t -*-
2;;; lisp/trampver.el. Generated from trampver.el.in by configure. 2;;; lisp/trampver.el. Generated from trampver.el.in by configure.
3 3
4;; Copyright (C) 2003-2017 Free Software Foundation, Inc. 4;; Copyright (C) 2003-2017 Free Software Foundation, Inc.