1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-16 02:50:26 -08:00

Remove byte compiler warnings, visible when compiling with

`byte-compile-force-lexical-warnings' set to t.

* net/tramp.el (tramp-debug-message, tramp-message, tramp-error)
(tramp-error-with-buffer): Rename ARGS to ARGUMENTS and BUFFER to BUF.
(tramp-handle-unhandled-file-name-directory)
(tramp-handle-file-notify-add-watch, tramp-action-login)
(tramp-action-succeed, tramp-action-permission-denied)
(tramp-action-terminal, tramp-action-process-alive): Prefix unused
arguments with "_".

* net/tramp-adb.el (tramp-adb-parse-device-names)
(tramp-adb-handle-insert-directory, tramp-adb-handle-delete-file)
(tramp-adb-handle-copy-file): Prefix unused arguments with "_".
(tramp-adb-handle-file-truename): Remove unused arguments.

* net/tramp-cache.el (tramp-flush-directory-property)
(tramp-flush-connection-property, tramp-list-connections)
(tramp-parse-connection-properties): Prefix unused arguments with "_".

* net/tramp-compat.el (tramp-compat-make-temp-file): Rename
FILENAME to F.

* net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch)
(tramp-gvfs-handle-write-region, tramp-bluez-parse-device-names)
(tramp-zeroconf-parse-workstation-device-names)
(tramp-zeroconf-parse-webdav-device-names)
(tramp-synce-parse-device-names): Prefix unused arguments with "_".

* net/tramp-gw.el (tramp-gw-gw-proc-sentinel)
(tramp-gw-aux-proc-sentinel): Prefix unused arguments with "_".

* net/tramp-sh.el (tramp-sh-handle-file-truename): Remove unused
arguments.
(tramp-sh-handle-copy-file, tramp-sh-handle-dired-compress-file)
(tramp-sh-handle-insert-file-contents-literally)
(tramp-sh-handle-file-notify-add-watch): Prefix unused arguments
with "_".
(tramp-do-copy-or-rename-file, tramp-barf-if-no-shell-prompt):
Remove unused variables.

* net/tramp-smb.el (tramp-smb-handle-copy-directory)
(tramp-smb-handle-copy-file, tramp-smb-handle-delete-file)
(tramp-smb-read-file-entry): Prefix unused arguments with "_".

* net/tramp-uu.el (tramp-uu-b64-alphabet, tramp-uu-b64-char-to-byte):
Make them a defconst.
(tramp-uuencode-region): Remove unused variable.
This commit is contained in:
Michael Albinus 2013-08-15 16:29:08 +02:00
parent 7cbbcaa0dd
commit 5d89d9d256
10 changed files with 108 additions and 59 deletions

View file

@ -1,3 +1,54 @@
2013-08-15 Michael Albinus <michael.albinus@gmx.de>
Remove byte compiler warnings, visible when compiling with
`byte-compile-force-lexical-warnings' set to t.
* net/tramp.el (tramp-debug-message, tramp-message, tramp-error)
(tramp-error-with-buffer): Rename ARGS to ARGUMENTS and BUFFER to BUF.
(tramp-handle-unhandled-file-name-directory)
(tramp-handle-file-notify-add-watch, tramp-action-login)
(tramp-action-succeed, tramp-action-permission-denied)
(tramp-action-terminal, tramp-action-process-alive): Prefix unused
arguments with "_".
* net/tramp-adb.el (tramp-adb-parse-device-names)
(tramp-adb-handle-insert-directory, tramp-adb-handle-delete-file)
(tramp-adb-handle-copy-file): Prefix unused arguments with "_".
(tramp-adb-handle-file-truename): Remove unused arguments.
* net/tramp-cache.el (tramp-flush-directory-property)
(tramp-flush-connection-property, tramp-list-connections)
(tramp-parse-connection-properties): Prefix unused arguments with "_".
* net/tramp-compat.el (tramp-compat-make-temp-file): Rename
FILENAME to F.
* net/tramp-gvfs.el (tramp-gvfs-handle-file-notify-add-watch)
(tramp-gvfs-handle-write-region, tramp-bluez-parse-device-names)
(tramp-zeroconf-parse-workstation-device-names)
(tramp-zeroconf-parse-webdav-device-names)
(tramp-synce-parse-device-names): Prefix unused arguments with "_".
* net/tramp-gw.el (tramp-gw-gw-proc-sentinel)
(tramp-gw-aux-proc-sentinel): Prefix unused arguments with "_".
* net/tramp-sh.el (tramp-sh-handle-file-truename): Remove unused
arguments.
(tramp-sh-handle-copy-file, tramp-sh-handle-dired-compress-file)
(tramp-sh-handle-insert-file-contents-literally)
(tramp-sh-handle-file-notify-add-watch): Prefix unused arguments
with "_".
(tramp-do-copy-or-rename-file, tramp-barf-if-no-shell-prompt):
Remove unused variables.
* net/tramp-smb.el (tramp-smb-handle-copy-directory)
(tramp-smb-handle-copy-file, tramp-smb-handle-delete-file)
(tramp-smb-read-file-entry): Prefix unused arguments with "_".
* net/tramp-uu.el (tramp-uu-b64-alphabet, tramp-uu-b64-char-to-byte):
Make them a defconst.
(tramp-uuencode-region): Remove unused variable.
2013-08-14 Juanma Barranquero <lekktu@gmail.com> 2013-08-14 Juanma Barranquero <lekktu@gmail.com>
* frameset.el (frameset--prop-setter): New function. * frameset.el (frameset--prop-setter): New function.

View file

@ -174,7 +174,7 @@ pass to the OPERATION."
(tramp-run-real-handler operation args)))) (tramp-run-real-handler operation args))))
;;;###tramp-autoload ;;;###tramp-autoload
(defun tramp-adb-parse-device-names (ignore) (defun tramp-adb-parse-device-names (_ignore)
"Return a list of (nil host) tuples allowed to access." "Return a list of (nil host) tuples allowed to access."
(with-timeout (10) (with-timeout (10)
(with-temp-buffer (with-temp-buffer
@ -224,7 +224,7 @@ pass to the OPERATION."
;; This is derived from `tramp-sh-handle-file-truename'. Maybe the ;; This is derived from `tramp-sh-handle-file-truename'. Maybe the
;; code could be shared? ;; code could be shared?
(defun tramp-adb-handle-file-truename (filename &optional counter prev-dirs) (defun tramp-adb-handle-file-truename (filename)
"Like `file-truename' for Tramp files." "Like `file-truename' for Tramp files."
(with-parsed-tramp-file-name (expand-file-name filename) nil (with-parsed-tramp-file-name (expand-file-name filename) nil
(with-tramp-file-property v localname "file-truename" (with-tramp-file-property v localname "file-truename"
@ -416,7 +416,7 @@ Convert (\"-al\") to (\"-a\" \"-l\"). Remove arguments like \"--dired\"."
switches)))))) switches))))))
(defun tramp-adb-handle-insert-directory (defun tramp-adb-handle-insert-directory
(filename switches &optional wildcard full-directory-p) (filename switches &optional _wildcard _full-directory-p)
"Like `insert-directory' for Tramp files." "Like `insert-directory' for Tramp files."
(when (stringp switches) (when (stringp switches)
(setq switches (tramp-adb--gnu-switches-to-ash (split-string switches)))) (setq switches (tramp-adb--gnu-switches-to-ash (split-string switches))))
@ -518,7 +518,7 @@ Emacs dired can't find files."
(tramp-shell-quote-argument localname)) (tramp-shell-quote-argument localname))
"Couldn't delete %s" directory))) "Couldn't delete %s" directory)))
(defun tramp-adb-handle-delete-file (filename &optional trash) (defun tramp-adb-handle-delete-file (filename &optional _trash)
"Like `delete-file' for Tramp files." "Like `delete-file' for Tramp files."
(setq filename (expand-file-name filename)) (setq filename (expand-file-name filename))
(with-parsed-tramp-file-name filename nil (with-parsed-tramp-file-name filename nil
@ -651,7 +651,7 @@ But handle the case, if the \"test\" command is not available."
(defun tramp-adb-handle-copy-file (defun tramp-adb-handle-copy-file
(filename newname &optional ok-if-already-exists keep-date (filename newname &optional ok-if-already-exists keep-date
preserve-uid-gid preserve-extended-attributes) _preserve-uid-gid _preserve-extended-attributes)
"Like `copy-file' for Tramp files. "Like `copy-file' for Tramp files.
PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(setq filename (expand-file-name filename) (setq filename (expand-file-name filename)

View file

@ -187,7 +187,7 @@ Remove also properties of all files in subdirectories."
'directory-file-name (list directory)))) 'directory-file-name (list directory))))
(tramp-message key 8 "%s" directory) (tramp-message key 8 "%s" directory)
(maphash (maphash
(lambda (key value) (lambda (key _value)
(when (and (stringp (tramp-file-name-localname key)) (when (and (stringp (tramp-file-name-localname key))
(string-match directory (tramp-file-name-localname key))) (string-match directory (tramp-file-name-localname key)))
(remhash key tramp-cache-data))) (remhash key tramp-cache-data)))
@ -273,7 +273,7 @@ KEY identifies the connection, it is either a process or a vector."
(let ((hash (gethash key tramp-cache-data)) (let ((hash (gethash key tramp-cache-data))
properties) properties)
(when (hash-table-p hash) (when (hash-table-p hash)
(maphash (lambda (x y) (add-to-list 'properties x 'append)) hash)) (maphash (lambda (x _y) (add-to-list 'properties x 'append)) hash))
properties)) properties))
(setq tramp-cache-data-changed t) (setq tramp-cache-data-changed t)
(remhash key tramp-cache-data)) (remhash key tramp-cache-data))
@ -304,7 +304,7 @@ KEY identifies the connection, it is either a process or a vector."
"Return a list of all known connection vectors according to `tramp-cache'." "Return a list of all known connection vectors according to `tramp-cache'."
(let (result) (let (result)
(maphash (maphash
(lambda (key value) (lambda (key _value)
(when (and (vectorp key) (null (aref key 3))) (when (and (vectorp key) (null (aref key 3)))
(add-to-list 'result key))) (add-to-list 'result key)))
tramp-cache-data) tramp-cache-data)
@ -368,7 +368,7 @@ This function is added always in `tramp-get-completion-function'
for all methods. Resulting data are derived from connection history." for all methods. Resulting data are derived from connection history."
(let (res) (let (res)
(maphash (maphash
(lambda (key value) (lambda (key _value)
(if (and (vectorp key) (if (and (vectorp key)
(string-equal method (tramp-file-name-method key)) (string-equal method (tramp-file-name-method key))
(not (tramp-file-name-localname key))) (not (tramp-file-name-localname key)))

View file

@ -238,14 +238,14 @@ this is the function `temp-directory'."
;; `make-temp-file' exists in Emacs only. On XEmacs, we use our own ;; `make-temp-file' exists in Emacs only. On XEmacs, we use our own
;; implementation with `make-temp-name', creating the temporary file ;; implementation with `make-temp-name', creating the temporary file
;; immediately in order to avoid a security hole. ;; immediately in order to avoid a security hole.
(defsubst tramp-compat-make-temp-file (filename &optional dir-flag) (defsubst tramp-compat-make-temp-file (f &optional dir-flag)
"Create a temporary file (compat function). "Create a temporary file (compat function).
Add the extension of FILENAME, if existing." Add the extension of F, if existing."
(let* (file-name-handler-alist (let* (file-name-handler-alist
(prefix (expand-file-name (prefix (expand-file-name
(symbol-value 'tramp-temp-name-prefix) (symbol-value 'tramp-temp-name-prefix)
(tramp-compat-temporary-file-directory))) (tramp-compat-temporary-file-directory)))
(extension (file-name-extension filename t)) (extension (file-name-extension f t))
result) result)
(condition-case nil (condition-case nil
(setq result (setq result

View file

@ -923,7 +923,7 @@ is no information where to trace the message.")
v (concat localname filename) v (concat localname filename)
"file-name-all-completions" result)))))))) "file-name-all-completions" result))))))))
(defun tramp-gvfs-handle-file-notify-add-watch (file-name flags callback) (defun tramp-gvfs-handle-file-notify-add-watch (file-name _flags _callback)
"Like `file-notify-add-watch' for Tramp files." "Like `file-notify-add-watch' for Tramp files."
(setq file-name (expand-file-name file-name)) (setq file-name (expand-file-name file-name))
(with-parsed-tramp-file-name file-name nil (with-parsed-tramp-file-name file-name nil
@ -1093,7 +1093,7 @@ is no information where to trace the message.")
(tramp-flush-file-property v localname)))))) (tramp-flush-file-property v localname))))))
(defun tramp-gvfs-handle-write-region (defun tramp-gvfs-handle-write-region
(start end filename &optional append visit lockname confirm) (start end filename &optional _append visit _lockname confirm)
"Like `write-region' for Tramp files." "Like `write-region' for Tramp files."
(with-parsed-tramp-file-name filename nil (with-parsed-tramp-file-name filename nil
;; XEmacs takes a coding system as the seventh argument, not `confirm'. ;; XEmacs takes a coding system as the seventh argument, not `confirm'.
@ -1653,7 +1653,7 @@ be used."
:system nil nil tramp-bluez-interface-adapter "DeviceFound" :system nil nil tramp-bluez-interface-adapter "DeviceFound"
'tramp-bluez-device-found) 'tramp-bluez-device-found)
(defun tramp-bluez-parse-device-names (ignore) (defun tramp-bluez-parse-device-names (_ignore)
"Return a list of (nil host) tuples allowed to access." "Return a list of (nil host) tuples allowed to access."
(mapcar (mapcar
(lambda (x) (list nil (car x))) (lambda (x) (list nil (car x)))
@ -1667,14 +1667,14 @@ be used."
;; D-Bus zeroconf functions. ;; D-Bus zeroconf functions.
(defun tramp-zeroconf-parse-workstation-device-names (ignore) (defun tramp-zeroconf-parse-workstation-device-names (_ignore)
"Return a list of (user host) tuples allowed to access." "Return a list of (user host) tuples allowed to access."
(mapcar (mapcar
(lambda (x) (lambda (x)
(list nil (zeroconf-service-host x))) (list nil (zeroconf-service-host x)))
(zeroconf-list-services "_workstation._tcp"))) (zeroconf-list-services "_workstation._tcp")))
(defun tramp-zeroconf-parse-webdav-device-names (ignore) (defun tramp-zeroconf-parse-webdav-device-names (_ignore)
"Return a list of (user host) tuples allowed to access." "Return a list of (user host) tuples allowed to access."
(mapcar (mapcar
(lambda (x) (lambda (x)
@ -1724,7 +1724,7 @@ They are retrieved from the hal daemon."
(tramp-message tramp-gvfs-dbus-event-vector 10 "%s" tramp-synce-devices) (tramp-message tramp-gvfs-dbus-event-vector 10 "%s" tramp-synce-devices)
tramp-synce-devices)) tramp-synce-devices))
(defun tramp-synce-parse-device-names (ignore) (defun tramp-synce-parse-device-names (_ignore)
"Return a list of (nil host) tuples allowed to access." "Return a list of (nil host) tuples allowed to access."
(mapcar (mapcar
(lambda (x) (list nil x)) (lambda (x) (list nil x))

View file

@ -96,7 +96,7 @@
(defvar tramp-gw-aux-proc nil (defvar tramp-gw-aux-proc nil
"Process listening on local port, as mediation between SSH and the gateway.") "Process listening on local port, as mediation between SSH and the gateway.")
(defun tramp-gw-gw-proc-sentinel (proc event) (defun tramp-gw-gw-proc-sentinel (proc _event)
"Delete auxiliary process when we are deleted." "Delete auxiliary process when we are deleted."
(unless (memq (process-status proc) '(run open)) (unless (memq (process-status proc) '(run open))
(tramp-message (tramp-message
@ -105,7 +105,7 @@
(p (tramp-get-connection-property proc "process" nil))) (p (tramp-get-connection-property proc "process" nil)))
(when (processp p) (delete-process p))))) (when (processp p) (delete-process p)))))
(defun tramp-gw-aux-proc-sentinel (proc event) (defun tramp-gw-aux-proc-sentinel (proc _event)
"Activate the different filters for involved gateway and auxiliary processes." "Activate the different filters for involved gateway and auxiliary processes."
(when (memq (process-status proc) '(run open)) (when (memq (process-status proc) '(run open))
;; A new process has been spawned from `tramp-gw-aux-proc'. ;; A new process has been spawned from `tramp-gw-aux-proc'.

View file

@ -938,7 +938,7 @@ target of the symlink differ."
(tramp-shell-quote-argument l-localname)) (tramp-shell-quote-argument l-localname))
t)))) t))))
(defun tramp-sh-handle-file-truename (filename &optional counter prev-dirs) (defun tramp-sh-handle-file-truename (filename)
"Like `file-truename' for Tramp files." "Like `file-truename' for Tramp files."
(with-parsed-tramp-file-name (expand-file-name filename) nil (with-parsed-tramp-file-name (expand-file-name filename) nil
(tramp-make-tramp-file-name method user host (tramp-make-tramp-file-name method user host
@ -1837,7 +1837,7 @@ tramp-sh-handle-file-name-all-completions: internal error accessing `%s': `%s'"
'copy-file (list filename newname ok-if-already-exists keep-date))))) 'copy-file (list filename newname ok-if-already-exists keep-date)))))
(defun tramp-sh-handle-copy-directory (defun tramp-sh-handle-copy-directory
(dirname newname &optional keep-date parents copy-contents) (dirname newname &optional keep-date parents _copy-contents)
"Like `copy-directory' for Tramp files." "Like `copy-directory' for Tramp files."
(let ((t1 (tramp-tramp-file-p dirname)) (let ((t1 (tramp-tramp-file-p dirname))
(t2 (tramp-tramp-file-p newname))) (t2 (tramp-tramp-file-p newname)))
@ -1911,8 +1911,7 @@ file names."
(t2 (tramp-tramp-file-p newname)) (t2 (tramp-tramp-file-p newname))
(length (nth 7 (file-attributes (file-truename filename)))) (length (nth 7 (file-attributes (file-truename filename))))
(attributes (and preserve-extended-attributes (attributes (and preserve-extended-attributes
(apply 'file-extended-attributes (list filename)))) (apply 'file-extended-attributes (list filename)))))
pr tm)
(with-parsed-tramp-file-name (if t1 filename newname) nil (with-parsed-tramp-file-name (if t1 filename newname) nil
(when (and (not ok-if-already-exists) (file-exists-p newname)) (when (and (not ok-if-already-exists) (file-exists-p newname))
@ -2433,7 +2432,7 @@ This is like `dired-recursive-delete-directory' for Tramp files."
(tramp-error (tramp-error
v 'file-error "Failed to recursively delete %s" filename)))) v 'file-error "Failed to recursively delete %s" filename))))
(defun tramp-sh-handle-dired-compress-file (file &rest ok-flag) (defun tramp-sh-handle-dired-compress-file (file &rest _ok-flag)
"Like `dired-compress-file' for Tramp files." "Like `dired-compress-file' for Tramp files."
;; OK-FLAG is valid for XEmacs only, but not implemented. ;; OK-FLAG is valid for XEmacs only, but not implemented.
;; Code stolen mainly from dired-aux.el. ;; Code stolen mainly from dired-aux.el.
@ -2978,7 +2977,7 @@ the result will be a local, non-Tramp, filename."
(inhibit-file-name-operation 'insert-file-contents)) (inhibit-file-name-operation 'insert-file-contents))
(unwind-protect (unwind-protect
(progn (progn
(fset 'find-buffer-file-type (lambda (filename) t)) (fset 'find-buffer-file-type (lambda (_filename) t))
(insert-file-contents filename visit beg end replace)) (insert-file-contents filename visit beg end replace))
;; Save exit. ;; Save exit.
(if find-buffer-file-type-function (if find-buffer-file-type-function
@ -3383,7 +3382,7 @@ Fall back to normal file name handler if no Tramp handler exists."
;; Default file name handlers, we don't care. ;; Default file name handlers, we don't care.
(t (tramp-run-real-handler operation args))))))) (t (tramp-run-real-handler operation args)))))))
(defun tramp-sh-handle-file-notify-add-watch (file-name flags callback) (defun tramp-sh-handle-file-notify-add-watch (file-name flags _callback)
"Like `file-notify-add-watch' for Tramp files." "Like `file-notify-add-watch' for Tramp files."
(setq file-name (expand-file-name file-name)) (setq file-name (expand-file-name file-name))
(with-parsed-tramp-file-name file-name nil (with-parsed-tramp-file-name file-name nil
@ -3749,7 +3748,7 @@ file exists and nonzero exit status otherwise."
Looks at process PROC to see if a shell prompt appears in TIMEOUT Looks at process PROC to see if a shell prompt appears in TIMEOUT
seconds. If not, it produces an error message with the given ERROR-ARGS." seconds. If not, it produces an error message with the given ERROR-ARGS."
(let ((vec (tramp-get-connection-property proc "vector" nil))) (let ((vec (tramp-get-connection-property proc "vector" nil)))
(condition-case err (condition-case nil
(tramp-wait-for-regexp (tramp-wait-for-regexp
proc timeout proc timeout
(format (format

View file

@ -355,7 +355,7 @@ pass to the OPERATION."
(throw 'tramp-action 'ok))))) (throw 'tramp-action 'ok)))))
(defun tramp-smb-handle-copy-directory (defun tramp-smb-handle-copy-directory
(dirname newname &optional keep-date parents copy-contents) (dirname newname &optional keep-date parents _copy-contents)
"Like `copy-directory' for Tramp files." "Like `copy-directory' for Tramp files."
(setq dirname (expand-file-name dirname) (setq dirname (expand-file-name dirname)
newname (expand-file-name newname)) newname (expand-file-name newname))
@ -492,7 +492,7 @@ pass to the OPERATION."
(defun tramp-smb-handle-copy-file (defun tramp-smb-handle-copy-file
(filename newname &optional ok-if-already-exists keep-date (filename newname &optional ok-if-already-exists keep-date
preserve-uid-gid preserve-extended-attributes) _preserve-uid-gid _preserve-extended-attributes)
"Like `copy-file' for Tramp files. "Like `copy-file' for Tramp files.
KEEP-DATE has no effect in case NEWNAME resides on an SMB server. KEEP-DATE has no effect in case NEWNAME resides on an SMB server.
PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored." PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
@ -571,7 +571,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(tramp-error (tramp-error
v 'file-error "%s `%s'" (match-string 0) directory)))))) v 'file-error "%s `%s'" (match-string 0) directory))))))
(defun tramp-smb-handle-delete-file (filename &optional trash) (defun tramp-smb-handle-delete-file (filename &optional _trash)
"Like `delete-file' for Tramp files." "Like `delete-file' for Tramp files."
(setq filename (expand-file-name filename)) (setq filename (expand-file-name filename))
(when (file-exists-p filename) (when (file-exists-p filename)
@ -1497,7 +1497,7 @@ Result is the list (LOCALNAME MODE SIZE MTIME)."
"%s%s" "%s%s"
(if (string-match "D" mode) "d" "-") (if (string-match "D" mode) "d" "-")
(mapconcat (mapconcat
(lambda (x) "") " " (lambda (_x) "") " "
(concat "r" (if (string-match "R" mode) "-" "w") "x")))) (concat "r" (if (string-match "R" mode) "-" "w") "x"))))
line (substring line 0 -6)) line (substring line 0 -6))
(return)) (return))

View file

@ -28,11 +28,11 @@
;;; Code: ;;; Code:
(defvar tramp-uu-b64-alphabet (defconst tramp-uu-b64-alphabet
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
"Mapping from base64-encoded character to the byte it represents.") "Mapping from base64-encoded character to the byte it represents.")
(defvar tramp-uu-b64-char-to-byte (defconst tramp-uu-b64-char-to-byte
(let ((i 0)) (let ((i 0))
(mapcar (lambda (c) (mapcar (lambda (c)
(prog1 (prog1
@ -55,7 +55,6 @@
;; First we base64 encode the region, then we transmogrify that into ;; First we base64 encode the region, then we transmogrify that into
;; uu encoding. ;; uu encoding.
(let ((len (base64-encode-region beg end t)) (let ((len (base64-encode-region beg end t))
(padding 0)
i c) i c)
(save-excursion (save-excursion
(goto-char beg) (goto-char beg)

View file

@ -1417,10 +1417,10 @@ The outline level is equal to the verbosity of the Tramp message."
(set (make-local-variable 'outline-level) 'tramp-debug-outline-level)) (set (make-local-variable 'outline-level) 'tramp-debug-outline-level))
(current-buffer))) (current-buffer)))
(defsubst tramp-debug-message (vec fmt-string &rest args) (defsubst tramp-debug-message (vec fmt-string &rest arguments)
"Append message to debug buffer. "Append message to debug buffer.
Message is formatted with FMT-STRING as control string and the remaining Message is formatted with FMT-STRING as control string and the remaining
ARGS to actually emit the message (if applicable)." ARGUMENTS to actually emit the message (if applicable)."
(when (get-buffer (tramp-buffer-name vec)) (when (get-buffer (tramp-buffer-name vec))
(with-current-buffer (tramp-get-debug-buffer vec) (with-current-buffer (tramp-get-debug-buffer vec)
(goto-char (point-max)) (goto-char (point-max))
@ -1480,14 +1480,14 @@ ARGS to actually emit the message (if applicable)."
; (1+ (count-lines (point-min) (cdr ffn))))))) ; (1+ (count-lines (point-min) (cdr ffn)))))))
(insert (format "%s " fn))) (insert (format "%s " fn)))
;; The message. ;; The message.
(insert (apply 'format fmt-string args))))) (insert (apply 'format fmt-string arguments)))))
(defvar tramp-message-show-message t (defvar tramp-message-show-message t
"Show Tramp message in the minibuffer. "Show Tramp message in the minibuffer.
This variable is used to disable messages from `tramp-error'. This variable is used to disable messages from `tramp-error'.
The messages are visible anyway, because an error is raised.") The messages are visible anyway, because an error is raised.")
(defsubst tramp-message (vec-or-proc level fmt-string &rest args) (defsubst tramp-message (vec-or-proc level fmt-string &rest arguments)
"Emit a message depending on verbosity level. "Emit a message depending on verbosity level.
VEC-OR-PROC identifies the Tramp buffer to use. It can be either a VEC-OR-PROC identifies the Tramp buffer to use. It can be either a
vector or a process. LEVEL says to be quiet if `tramp-verbose' is vector or a process. LEVEL says to be quiet if `tramp-verbose' is
@ -1498,7 +1498,7 @@ The message is also logged into the debug buffer when `tramp-verbose'
is greater than or equal 4. is greater than or equal 4.
Calls functions `message' and `tramp-debug-message' with FMT-STRING as Calls functions `message' and `tramp-debug-message' with FMT-STRING as
control string and the remaining ARGS to actually emit the message (if control string and the remaining ARGUMENTS to actually emit the message (if
applicable)." applicable)."
(ignore-errors (ignore-errors
(when (<= level tramp-verbose) (when (<= level tramp-verbose)
@ -1514,7 +1514,7 @@ applicable)."
((= level 2) "Warning: ") ((= level 2) "Warning: ")
(t "Tramp: ")) (t "Tramp: "))
fmt-string) fmt-string)
args)) arguments))
;; Log only when there is a minimum level. ;; Log only when there is a minimum level.
(when (>= tramp-verbose 4) (when (>= tramp-verbose 4)
(when (and vec-or-proc (when (and vec-or-proc
@ -1527,17 +1527,17 @@ applicable)."
(apply 'tramp-debug-message (apply 'tramp-debug-message
vec-or-proc vec-or-proc
(concat (format "(%d) # " level) fmt-string) (concat (format "(%d) # " level) fmt-string)
args))))))) arguments)))))))
(defsubst tramp-backtrace (vec-or-proc) (defsubst tramp-backtrace (vec-or-proc)
"Dump a backtrace into the debug buffer. "Dump a backtrace into the debug buffer.
This function is meant for debugging purposes." This function is meant for debugging purposes."
(tramp-message vec-or-proc 10 "\n%s" (with-output-to-string (backtrace)))) (tramp-message vec-or-proc 10 "\n%s" (with-output-to-string (backtrace))))
(defsubst tramp-error (vec-or-proc signal fmt-string &rest args) (defsubst tramp-error (vec-or-proc signal fmt-string &rest arguments)
"Emit an error. "Emit an error.
VEC-OR-PROC identifies the connection to use, SIGNAL is the VEC-OR-PROC identifies the connection to use, SIGNAL is the
signal identifier to be raised, remaining args passed to signal identifier to be raised, remaining arguments passed to
`tramp-message'. Finally, signal SIGNAL is raised." `tramp-message'. Finally, signal SIGNAL is raised."
(let (tramp-message-show-message) (let (tramp-message-show-message)
(tramp-backtrace vec-or-proc) (tramp-backtrace vec-or-proc)
@ -1546,16 +1546,16 @@ signal identifier to be raised, remaining args passed to
(error-message-string (error-message-string
(list signal (list signal
(get signal 'error-message) (get signal 'error-message)
(apply 'format fmt-string args)))) (apply 'format fmt-string arguments))))
(signal signal (list (apply 'format fmt-string args))))) (signal signal (list (apply 'format fmt-string arguments)))))
(defsubst tramp-error-with-buffer (defsubst tramp-error-with-buffer
(buffer vec-or-proc signal fmt-string &rest args) (buf vec-or-proc signal fmt-string &rest arguments)
"Emit an error, and show BUFFER. "Emit an error, and show BUF.
If BUFFER is nil, show the connection buffer. Wait for 30\", or until If BUF is nil, show the connection buf. Wait for 30\", or until
an input event arrives. The other arguments are passed to `tramp-error'." an input event arrives. The other arguments are passed to `tramp-error'."
(save-window-excursion (save-window-excursion
(let* ((buf (or (and (bufferp buffer) buffer) (let* ((buf (or (and (bufferp buf) buf)
(and (processp vec-or-proc) (process-buffer vec-or-proc)) (and (processp vec-or-proc) (process-buffer vec-or-proc))
(and (vectorp vec-or-proc) (and (vectorp vec-or-proc)
(tramp-get-connection-buffer vec-or-proc)))) (tramp-get-connection-buffer vec-or-proc))))
@ -1563,7 +1563,7 @@ an input event arrives. The other arguments are passed to `tramp-error'."
(and buf (with-current-buffer buf (and buf (with-current-buffer buf
(tramp-dissect-file-name default-directory)))))) (tramp-dissect-file-name default-directory))))))
(unwind-protect (unwind-protect
(apply 'tramp-error vec-or-proc signal fmt-string args) (apply 'tramp-error vec-or-proc signal fmt-string arguments)
;; Save exit. ;; Save exit.
(when (and buf (when (and buf
tramp-message-show-message tramp-message-show-message
@ -1572,7 +1572,7 @@ an input event arrives. The other arguments are passed to `tramp-error'."
(let ((enable-recursive-minibuffers t)) (let ((enable-recursive-minibuffers t))
;; `tramp-error' does not show messages. So we must do it ;; `tramp-error' does not show messages. So we must do it
;; ourselves. ;; ourselves.
(message fmt-string args) (message fmt-string arguments)
;; Show buffer. ;; Show buffer.
(pop-to-buffer buf) (pop-to-buffer buf)
(discard-input) (discard-input)
@ -3281,7 +3281,7 @@ beginning of local filename are not substituted."
(setq filename (concat filename "/")))) (setq filename (concat filename "/"))))
(tramp-run-real-handler 'substitute-in-file-name (list filename))))) (tramp-run-real-handler 'substitute-in-file-name (list filename)))))
(defun tramp-handle-unhandled-file-name-directory (filename) (defun tramp-handle-unhandled-file-name-directory (_filename)
"Like `unhandled-file-name-directory' for Tramp files." "Like `unhandled-file-name-directory' for Tramp files."
;; With Emacs 23, we could simply return `nil'. But we must keep it ;; With Emacs 23, we could simply return `nil'. But we must keep it
;; for backward compatibility. ;; for backward compatibility.
@ -3341,7 +3341,7 @@ of."
;; only if that agrees with the buffer's record. ;; only if that agrees with the buffer's record.
(t (equal mt '(-1 65535)))))))))) (t (equal mt '(-1 65535))))))))))
(defun tramp-handle-file-notify-add-watch (filename flags callback) (defun tramp-handle-file-notify-add-watch (filename _flags _callback)
"Like `file-notify-add-watch' for Tramp files." "Like `file-notify-add-watch' for Tramp files."
;; This is the default handler. tramp-gvfs.el and tramp-sh.el have ;; This is the default handler. tramp-gvfs.el and tramp-sh.el have
;; its own one. ;; its own one.
@ -3365,7 +3365,7 @@ of."
;; prompts from the remote host. See the variable ;; prompts from the remote host. See the variable
;; `tramp-actions-before-shell' for usage of these functions. ;; `tramp-actions-before-shell' for usage of these functions.
(defun tramp-action-login (proc vec) (defun tramp-action-login (_proc vec)
"Send the login name." "Send the login name."
(when (not (stringp tramp-current-user)) (when (not (stringp tramp-current-user))
(setq tramp-current-user (setq tramp-current-user
@ -3392,11 +3392,11 @@ of."
;; Hide password prompt. ;; Hide password prompt.
(narrow-to-region (point-max) (point-max))))) (narrow-to-region (point-max) (point-max)))))
(defun tramp-action-succeed (proc vec) (defun tramp-action-succeed (_proc _vec)
"Signal success in finding shell prompt." "Signal success in finding shell prompt."
(throw 'tramp-action 'ok)) (throw 'tramp-action 'ok))
(defun tramp-action-permission-denied (proc vec) (defun tramp-action-permission-denied (proc _vec)
"Signal permission denied." "Signal permission denied."
(kill-process proc) (kill-process proc)
(throw 'tramp-action 'permission-denied)) (throw 'tramp-action 'permission-denied))
@ -3429,7 +3429,7 @@ See also `tramp-action-yesno'."
(tramp-message vec 6 "\n%s" (buffer-string))) (tramp-message vec 6 "\n%s" (buffer-string)))
(tramp-send-string vec (concat "y" tramp-local-end-of-line))))) (tramp-send-string vec (concat "y" tramp-local-end-of-line)))))
(defun tramp-action-terminal (proc vec) (defun tramp-action-terminal (_proc vec)
"Tell the remote host which terminal type to use. "Tell the remote host which terminal type to use.
The terminal type can be configured with `tramp-terminal-type'." The terminal type can be configured with `tramp-terminal-type'."
(tramp-message vec 5 "Setting `%s' as terminal type." tramp-terminal-type) (tramp-message vec 5 "Setting `%s' as terminal type." tramp-terminal-type)
@ -3437,7 +3437,7 @@ The terminal type can be configured with `tramp-terminal-type'."
(tramp-message vec 6 "\n%s" (buffer-string))) (tramp-message vec 6 "\n%s" (buffer-string)))
(tramp-send-string vec (concat tramp-terminal-type tramp-local-end-of-line))) (tramp-send-string vec (concat tramp-terminal-type tramp-local-end-of-line)))
(defun tramp-action-process-alive (proc vec) (defun tramp-action-process-alive (proc _vec)
"Check, whether a process has finished." "Check, whether a process has finished."
(unless (memq (process-status proc) '(run open)) (unless (memq (process-status proc) '(run open))
(throw 'tramp-action 'process-died))) (throw 'tramp-action 'process-died)))