`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-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>
* frameset.el (frameset--prop-setter): New function.
(tramp-run-real-handler operation args))))
;;;###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."
(with-timeout (10)
(with-temp-buffer
;; This is derived from `tramp-sh-handle-file-truename'. Maybe the
;; 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."
(with-parsed-tramp-file-name (expand-file-name filename) nil
(with-tramp-file-property v localname "file-truename"
switches))))))
(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."
(when (stringp switches)
(setq switches (tramp-adb--gnu-switches-to-ash (split-string switches))))
(tramp-shell-quote-argument localname))
"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."
(setq filename (expand-file-name filename))
(with-parsed-tramp-file-name filename nil
(defun tramp-adb-handle-copy-file
(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.
PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(setq filename (expand-file-name filename)
'directory-file-name (list directory))))
(tramp-message key 8 "%s" directory)
(maphash
- (lambda (key value)
+ (lambda (key _value)
(when (and (stringp (tramp-file-name-localname key))
(string-match directory (tramp-file-name-localname key)))
(remhash key tramp-cache-data)))
(let ((hash (gethash key tramp-cache-data))
properties)
(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))
(setq tramp-cache-data-changed t)
(remhash key tramp-cache-data))
"Return a list of all known connection vectors according to `tramp-cache'."
(let (result)
(maphash
- (lambda (key value)
+ (lambda (key _value)
(when (and (vectorp key) (null (aref key 3)))
(add-to-list 'result key)))
tramp-cache-data)
for all methods. Resulting data are derived from connection history."
(let (res)
(maphash
- (lambda (key value)
+ (lambda (key _value)
(if (and (vectorp key)
(string-equal method (tramp-file-name-method key))
(not (tramp-file-name-localname key)))
;; `make-temp-file' exists in Emacs only. On XEmacs, we use our own
;; implementation with `make-temp-name', creating the temporary file
;; 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).
-Add the extension of FILENAME, if existing."
+Add the extension of F, if existing."
(let* (file-name-handler-alist
(prefix (expand-file-name
(symbol-value 'tramp-temp-name-prefix)
(tramp-compat-temporary-file-directory)))
- (extension (file-name-extension filename t))
+ (extension (file-name-extension f t))
result)
(condition-case nil
(setq result
v (concat localname filename)
"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."
(setq file-name (expand-file-name file-name))
(with-parsed-tramp-file-name file-name nil
(tramp-flush-file-property v localname))))))
(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."
(with-parsed-tramp-file-name filename nil
;; XEmacs takes a coding system as the seventh argument, not `confirm'.
:system nil nil tramp-bluez-interface-adapter "DeviceFound"
'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."
(mapcar
(lambda (x) (list nil (car x)))
\f
;; 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."
(mapcar
(lambda (x)
(list nil (zeroconf-service-host x)))
(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."
(mapcar
(lambda (x)
(tramp-message tramp-gvfs-dbus-event-vector 10 "%s" 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."
(mapcar
(lambda (x) (list nil x))
(defvar tramp-gw-aux-proc nil
"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."
(unless (memq (process-status proc) '(run open))
(tramp-message
(p (tramp-get-connection-property proc "process" nil)))
(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."
(when (memq (process-status proc) '(run open))
;; A new process has been spawned from `tramp-gw-aux-proc'.
(tramp-shell-quote-argument l-localname))
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."
(with-parsed-tramp-file-name (expand-file-name filename) nil
(tramp-make-tramp-file-name method user host
'copy-file (list filename newname ok-if-already-exists keep-date)))))
(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."
(let ((t1 (tramp-tramp-file-p dirname))
(t2 (tramp-tramp-file-p newname)))
(t2 (tramp-tramp-file-p newname))
(length (nth 7 (file-attributes (file-truename filename))))
(attributes (and preserve-extended-attributes
- (apply 'file-extended-attributes (list filename))))
- pr tm)
+ (apply 'file-extended-attributes (list filename)))))
(with-parsed-tramp-file-name (if t1 filename newname) nil
(when (and (not ok-if-already-exists) (file-exists-p newname))
(tramp-error
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."
;; OK-FLAG is valid for XEmacs only, but not implemented.
;; Code stolen mainly from dired-aux.el.
(inhibit-file-name-operation 'insert-file-contents))
(unwind-protect
(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))
;; Save exit.
(if find-buffer-file-type-function
;; Default file name handlers, we don't care.
(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."
(setq file-name (expand-file-name file-name))
(with-parsed-tramp-file-name file-name nil
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."
(let ((vec (tramp-get-connection-property proc "vector" nil)))
- (condition-case err
+ (condition-case nil
(tramp-wait-for-regexp
proc timeout
(format
(throw 'tramp-action 'ok)))))
(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."
(setq dirname (expand-file-name dirname)
newname (expand-file-name newname))
(defun tramp-smb-handle-copy-file
(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.
KEEP-DATE has no effect in case NEWNAME resides on an SMB server.
PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(tramp-error
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."
(setq filename (expand-file-name filename))
(when (file-exists-p filename)
"%s%s"
(if (string-match "D" mode) "d" "-")
(mapconcat
- (lambda (x) "") " "
+ (lambda (_x) "") " "
(concat "r" (if (string-match "R" mode) "-" "w") "x"))))
line (substring line 0 -6))
(return))
;;; Code:
-(defvar tramp-uu-b64-alphabet
+(defconst tramp-uu-b64-alphabet
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
"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))
(mapcar (lambda (c)
(prog1
;; First we base64 encode the region, then we transmogrify that into
;; uu encoding.
(let ((len (base64-encode-region beg end t))
- (padding 0)
i c)
(save-excursion
(goto-char beg)
(set (make-local-variable 'outline-level) 'tramp-debug-outline-level))
(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.
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))
(with-current-buffer (tramp-get-debug-buffer vec)
(goto-char (point-max))
; (1+ (count-lines (point-min) (cdr ffn)))))))
(insert (format "%s " fn)))
;; The message.
- (insert (apply 'format fmt-string args)))))
+ (insert (apply 'format fmt-string arguments)))))
(defvar tramp-message-show-message t
"Show Tramp message in the minibuffer.
This variable is used to disable messages from `tramp-error'.
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.
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
is greater than or equal 4.
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)."
(ignore-errors
(when (<= level tramp-verbose)
((= level 2) "Warning: ")
(t "Tramp: "))
fmt-string)
- args))
+ arguments))
;; Log only when there is a minimum level.
(when (>= tramp-verbose 4)
(when (and vec-or-proc
(apply 'tramp-debug-message
vec-or-proc
(concat (format "(%d) # " level) fmt-string)
- args)))))))
+ arguments)))))))
(defsubst tramp-backtrace (vec-or-proc)
"Dump a backtrace into the debug buffer.
This function is meant for debugging purposes."
(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.
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."
(let (tramp-message-show-message)
(tramp-backtrace vec-or-proc)
(error-message-string
(list signal
(get signal 'error-message)
- (apply 'format fmt-string args))))
- (signal signal (list (apply 'format fmt-string args)))))
+ (apply 'format fmt-string arguments))))
+ (signal signal (list (apply 'format fmt-string arguments)))))
(defsubst tramp-error-with-buffer
- (buffer vec-or-proc signal fmt-string &rest args)
- "Emit an error, and show BUFFER.
-If BUFFER is nil, show the connection buffer. Wait for 30\", or until
+ (buf vec-or-proc signal fmt-string &rest arguments)
+ "Emit an error, and show BUF.
+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'."
(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 (vectorp vec-or-proc)
(tramp-get-connection-buffer vec-or-proc))))
(and buf (with-current-buffer buf
(tramp-dissect-file-name default-directory))))))
(unwind-protect
- (apply 'tramp-error vec-or-proc signal fmt-string args)
+ (apply 'tramp-error vec-or-proc signal fmt-string arguments)
;; Save exit.
(when (and buf
tramp-message-show-message
(let ((enable-recursive-minibuffers t))
;; `tramp-error' does not show messages. So we must do it
;; ourselves.
- (message fmt-string args)
+ (message fmt-string arguments)
;; Show buffer.
(pop-to-buffer buf)
(discard-input)
(setq filename (concat 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."
;; With Emacs 23, we could simply return `nil'. But we must keep it
;; for backward compatibility.
;; only if that agrees with the buffer's record.
(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."
;; This is the default handler. tramp-gvfs.el and tramp-sh.el have
;; its own one.
;; prompts from the remote host. See the variable
;; `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."
(when (not (stringp tramp-current-user))
(setq tramp-current-user
;; Hide password prompt.
(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."
(throw 'tramp-action 'ok))
-(defun tramp-action-permission-denied (proc vec)
+(defun tramp-action-permission-denied (proc _vec)
"Signal permission denied."
(kill-process proc)
(throw 'tramp-action 'permission-denied))
(tramp-message vec 6 "\n%s" (buffer-string)))
(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.
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 6 "\n%s" (buffer-string)))
(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."
(unless (memq (process-status proc) '(run open))
(throw 'tramp-action 'process-died)))