"Parse `file-attributes' for Tramp files using the ls(1) command."
(with-current-buffer (tramp-get-buffer vec)
(goto-char (point-min))
- (let ((file-properties nil))
+ (let (file-properties)
(while (re-search-forward tramp-adb-ls-toolbox-regexp nil t)
(let* ((mod-string (match-string 1))
(is-dir (eq ?d (aref mod-string 0)))
"echo \\\"`getprop ro.product.model` "
"`getprop ro.product.version` "
"`getprop ro.build.version.release`\\\""))
- (let ((old-getprop
- (tramp-get-connection-property vec "getprop" nil))
+ (let ((old-getprop (tramp-get-connection-property vec "getprop"))
(new-getprop
(tramp-set-connection-property
vec "getprop"
hash))))
;;;###tramp-autoload
-(defun tramp-get-file-property (key file property default)
+(defun tramp-get-file-property (key file property &optional default)
"Get the PROPERTY of FILE from the cache context of KEY.
Return DEFAULT if not set."
;; Unify localname. Remove hop from `tramp-file-name' structure.
(defun tramp-flush-file-properties (key file)
"Remove all properties of FILE in the cache context of KEY."
(let* ((file (tramp-run-real-handler #'directory-file-name (list file)))
- (truename (tramp-get-file-property key file "file-truename" nil)))
+ (truename (tramp-get-file-property key file "file-truename")))
;; Unify localname. Remove hop from `tramp-file-name' structure.
(setq file (tramp-compat-file-name-unquote file)
key (copy-tramp-file-name key))
(setq directory (tramp-compat-file-name-unquote directory))
(let* ((directory (tramp-run-real-handler
#'directory-file-name (list directory)))
- (truename (tramp-get-file-property key directory "file-truename" nil)))
+ (truename (tramp-get-file-property key directory "file-truename")))
(tramp-message key 8 "%s" directory)
(dolist (key (hash-table-keys tramp-cache-data))
(when (and (tramp-file-name-p key)
;;; -- Properties --
;;;###tramp-autoload
-(defun tramp-get-connection-property (key property default)
+(defun tramp-get-connection-property (key property &optional default)
"Get the named PROPERTY for the connection.
KEY identifies the connection, it is either a process or a
`tramp-file-name' structure. A special case is nil, which is
(get-buffer (tramp-debug-buffer-name vec)))
(unless keep-debug
(get-buffer (tramp-trace-buffer-name vec)))
- (tramp-get-connection-property vec "process-buffer" nil)))
+ (tramp-get-connection-property vec "process-buffer")))
(when (bufferp buf) (kill-buffer buf)))
;; Flush file cache.
(when (y-or-n-p "Do you want to append the buffer(s)?")
;; OK, let's send. First we delete the buffer list.
- (kill-buffer nil)
+ (kill-buffer)
(switch-to-buffer curbuf)
(goto-char (point-max))
(insert (propertize "\n" 'display "\n\
(require 'auth-source)
(require 'format-spec)
-(require 'ls-lisp) ;; Due to `tramp-handle-insert-directory'.
+(require 'ls-lisp) ;; Due to `tramp-handle-insert-directory'.
(require 'parse-time)
(require 'shell)
(require 'subr-x)
(if (fboundp 'string-replace)
#'string-replace
(lambda (from-string to-string in-string)
- (let ((case-fold-search nil))
+ (let (case-fold-search)
(replace-regexp-in-string
(regexp-quote from-string) to-string in-string t t)))))
(if (fboundp 'string-search)
#'string-search
(lambda (needle haystack &optional start-pos)
- (let ((case-fold-search nil))
+ (let (case-fold-search)
(string-match-p (regexp-quote needle) haystack start-pos)))))
;; Function `make-lock-file-name' is new in Emacs 28.1.
(dolist (dir tramp-crypt-directories)
(and (string-prefix-p
dir (file-name-as-directory (expand-file-name name)))
- (throw 'crypt-file-name-p dir))))))
+ (throw 'crypt-file-name-p dir))))))
\f
;; New handlers should be added here.
;; "ftp" method is used in the Tramp file name. So we unset
;; those values.
(ange-ftp-ftp-name-arg "")
- (ange-ftp-ftp-name-res nil))
+ ange-ftp-ftp-name-res)
(cond
;; If argument is a symlink, `file-directory-p' and
;; `file-exists-p' call the traversed file recursively. So we
(defun tramp-fuse-mount-point (vec)
"Return local mount point of VEC."
- (or (tramp-get-connection-property vec "mount-point" nil)
+ (or (tramp-get-connection-property vec "mount-point")
(expand-file-name
(concat
tramp-temp-name-prefix
;; cannot use `with-tramp-file-property', because we don't want to
;; cache a nil result.
(let ((remote-file-name-inhibit-cache tramp-fuse-mount-timeout))
- (or (tramp-get-file-property vec "/" "mounted" nil)
+ (or (tramp-get-file-property vec "/" "mounted")
(let* ((default-directory tramp-compat-temporary-file-directory)
(command (format "mount -t fuse.%s" (tramp-file-name-method vec)))
(mount (shell-command-to-string command)))
;; We cannot copy or rename directly.
((or (and equal-remote
- (tramp-get-connection-property v "direct-copy-failed" nil))
+ (tramp-get-connection-property v "direct-copy-failed"))
(and t1 (not (tramp-gvfs-file-name-p filename)))
(and t2 (not (tramp-gvfs-file-name-p newname))))
(let ((tmpfile (tramp-compat-make-temp-file filename)))
(if (or (not equal-remote)
(and equal-remote
(tramp-get-connection-property
- v "direct-copy-failed" nil)))
+ v "direct-copy-failed")))
;; Propagate the error.
(with-current-buffer (tramp-get-connection-buffer v)
(goto-char (point-min))
(setq name (tramp-compat-file-name-concat dir name)))
;; If NAME is not a Tramp file, run the real handler.
(if (not (tramp-tramp-file-p name))
- (tramp-run-real-handler #'expand-file-name (list name nil))
+ (tramp-run-real-handler #'expand-file-name (list name))
;; Dissect NAME.
(with-parsed-tramp-file-name name nil
;; If there is a default location, expand tilde.
(or (cdr (assoc "standard::size" attributes)) "0")))
;; ... file mode flags
(setq res-filemodes
- (let ((n (cdr (assoc "unix::mode" attributes))))
- (if n
- (tramp-file-mode-from-int (string-to-number n))
- (format
- "%s%s%s%s------"
- (if dirp "d" (if res-symlink-target "l" "-"))
- (if (equal (cdr (assoc "access::can-read" attributes))
- "FALSE")
- "-" "r")
- (if (equal (cdr (assoc "access::can-write" attributes))
- "FALSE")
- "-" "w")
- (if (equal (cdr (assoc "access::can-execute" attributes))
- "FALSE")
- "-" "x")))))
+ (if-let ((n (cdr (assoc "unix::mode" attributes))))
+ (tramp-file-mode-from-int (string-to-number n))
+ (format
+ "%s%s%s%s------"
+ (if dirp "d" (if res-symlink-target "l" "-"))
+ (if (equal (cdr (assoc "access::can-read" attributes))
+ "FALSE")
+ "-" "r")
+ (if (equal (cdr (assoc "access::can-write" attributes))
+ "FALSE")
+ "-" "w")
+ (if (equal (cdr (assoc "access::can-execute" attributes))
+ "FALSE")
+ "-" "x"))))
;; ... inode and device
(setq res-inode
- (let ((n (cdr (assoc "unix::inode" attributes))))
- (if n
- (string-to-number n)
- (tramp-get-inode (tramp-dissect-file-name filename)))))
+ (if-let ((n (cdr (assoc "unix::inode" attributes))))
+ (string-to-number n)
+ (tramp-get-inode (tramp-dissect-file-name filename))))
(setq res-device
- (let ((n (cdr (assoc "unix::device" attributes))))
- (if n
- (string-to-number n)
- (tramp-get-device (tramp-dissect-file-name filename)))))
+ (if-let ((n (cdr (assoc "unix::device" attributes))))
+ (string-to-number n)
+ (tramp-get-device (tramp-dissect-file-name filename))))
;; Return data gathered.
(list
(with-current-buffer (tramp-get-connection-buffer vec)
(goto-char (point-min))
(when (looking-at-p "gio: Operation not supported")
- (tramp-set-connection-property vec key nil)))
- nil))))
+ (tramp-set-connection-property vec key nil)))))))
(defun tramp-gvfs-handle-set-file-modes (filename mode &optional flag)
"Like `set-file-modes' for Tramp files."
If USER is a string, return its home directory instead of the
user identified by VEC. If there is no user specified in either
VEC or USER, or if there is no home directory, return nil."
- (let ((localname
- (tramp-get-connection-property vec "default-location" nil))
+ (let ((localname (tramp-get-connection-property vec "default-location"))
result)
(cond
((zerop (length localname))
- (tramp-get-connection-property (tramp-get-process vec) "share" nil))
+ (tramp-get-connection-property (tramp-get-process vec) "share"))
;; Google-drive.
((not (string-prefix-p "/" localname))
(dolist (item
(if (equal id-format 'string)
(tramp-file-name-user vec)
(when-let ((localname
- (tramp-get-connection-property
- (tramp-get-process vec) "share" nil)))
+ (tramp-get-connection-property (tramp-get-process vec) "share")))
(file-attribute-user-id
(file-attributes (tramp-make-tramp-file-name vec localname) id-format)))))
"The gid of the remote connection VEC, in ID-FORMAT.
ID-FORMAT valid values are `string' and `integer'."
(when-let ((localname
- (tramp-get-connection-property
- (tramp-get-process vec) "share" nil)))
+ (tramp-get-connection-property (tramp-get-process vec) "share")))
(file-attribute-group-id
(file-attributes (tramp-make-tramp-file-name vec localname) id-format))))
(concat (tramp-gvfs-get-remote-prefix v) localname)))
(when (string-equal "mtp" method)
(when-let
- ((media (tramp-get-connection-property v "media-device" nil)))
+ ((media (tramp-get-connection-property v "media-device")))
(setq method (tramp-media-device-method media)
host (tramp-media-device-host media)
port (tramp-media-device-port media))))
(setq domain (read-string "Domain name: ")))
(tramp-message l 6 "%S %S %S %d" message user domain flags)
- (unless (tramp-get-connection-property l "first-password-request" nil)
+ (unless (tramp-get-connection-property l "first-password-request")
(tramp-clear-passwd l))
(setq password (tramp-read-passwd
(when (member method tramp-media-methods)
;; Ensure that media devices are cached.
(tramp-get-media-devices nil)
- (let ((v (tramp-get-connection-property
- (make-tramp-media-device
- :method method :host host :port port)
- "vector" nil)))
- (when v
- (setq method (tramp-file-name-method v)
- host (tramp-file-name-host v)
- port (tramp-file-name-port v)))))
+ (when-let ((v (tramp-get-connection-property
+ (make-tramp-media-device
+ :method method :host host :port port)
+ "vector" nil)))
+ (setq method (tramp-file-name-method v)
+ host (tramp-file-name-host v)
+ port (tramp-file-name-port v))))
(when (member method tramp-gvfs-methods)
(let ((v (make-tramp-file-name
:method method :user user :domain domain
(defun tramp-gvfs-connection-mounted-p (vec)
"Check, whether the location is already mounted."
(or
- (tramp-get-file-property vec "/" "fuse-mountpoint" nil)
+ (tramp-get-file-property vec "/" "fuse-mountpoint")
(catch 'mounted
(dolist
(elt
(with-tramp-file-property vec "/" "list-mounts"
(with-tramp-dbus-call-method vec t
:session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
- tramp-gvfs-interface-mounttracker tramp-gvfs-listmounts))
- nil)
+ tramp-gvfs-interface-mounttracker tramp-gvfs-listmounts)))
;; Jump over the first elements of the mount info. Since there
;; were changes in the entries, we cannot access dedicated
;; elements.
(when (member method tramp-media-methods)
;; Ensure that media devices are cached.
(tramp-get-media-devices vec)
- (let ((v (tramp-get-connection-property
- (make-tramp-media-device
- :method method :host host :port port)
- "vector" nil)))
- (when v
- (setq method (tramp-file-name-method v)
- host (tramp-file-name-host v)
- port (tramp-file-name-port v)))))
+ (when-let ((v (tramp-get-connection-property
+ (make-tramp-media-device
+ :method method :host host :port port)
+ "vector")))
+ (setq method (tramp-file-name-method v)
+ host (tramp-file-name-host v)
+ port (tramp-file-name-port v))))
(when (and
(string-equal method (tramp-file-name-method vec))
(string-equal user (tramp-file-name-user vec))
(tramp-error
vec 'file-error
"Timeout reached mounting %s@%s using %s" user host method)))
- (while (not (tramp-get-file-property vec "/" "fuse-mountpoint" nil))
+ (while (not (tramp-get-file-property vec "/" "fuse-mountpoint"))
(read-event nil nil 0.1)))
;; If `tramp-gvfs-handler-askquestion' has returned "No", it
(defun tramp-get-media-device (vec)
"Transform VEC into a `tramp-media-device' structure.
Check, that respective cache values do exist."
- (if-let ((media (tramp-get-connection-property vec "media-device" nil))
- (prop (tramp-get-connection-property media "vector" nil)))
+ (if-let ((media (tramp-get-connection-property vec "media-device"))
+ (prop (tramp-get-connection-property media "vector")))
media
(tramp-get-media-devices vec)
- (tramp-get-connection-property vec "media-device" nil)))
+ (tramp-get-connection-property vec "media-device")))
(defun tramp-get-media-devices (vec)
"Retrieve media devices, and cache them.
(lambda (key)
(and (tramp-media-device-p key)
(string-equal service (tramp-media-device-method key))
- (tramp-get-connection-property key "vector" nil)
+ (tramp-get-connection-property key "vector")
(list nil (tramp-file-name-host
- (tramp-get-connection-property key "vector" nil)))))
+ (tramp-get-connection-property key "vector")))))
(hash-table-keys tramp-cache-data)))
\f
end))
(point-max))
(let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
- (rfn-eshadow-update-overlay-hook nil)
+ rfn-eshadow-update-overlay-hook
file-name-handler-alist)
(move-overlay rfn-eshadow-overlay (point-max) (point-max))
(rfn-eshadow-update-overlay))))))))
;; Use Perl implementation.
((and (tramp-get-remote-perl v)
- (tramp-get-connection-property v "perl-file-spec" nil)
- (tramp-get-connection-property v "perl-cwd-realpath" nil))
+ (tramp-get-connection-property v "perl-file-spec")
+ (tramp-get-connection-property v "perl-cwd-realpath"))
(tramp-maybe-send-script
v tramp-perl-file-truename "tramp_perl_file_truename")
(setq result
(with-parsed-tramp-file-name filename nil
(with-tramp-file-property v localname "file-exists-p"
(or (not (null (tramp-get-file-property
- v localname "file-attributes-integer" nil)))
+ v localname "file-attributes-integer")))
(not (null (tramp-get-file-property
- v localname "file-attributes-string" nil)))
+ v localname "file-attributes-string")))
(tramp-send-command-and-check
v
(format
v (format
"env TZ=UTC %s %s %s %s"
(tramp-get-remote-touch v)
- (if (tramp-get-connection-property v "touch-t" nil)
+ (if (tramp-get-connection-property v "touch-t")
(format "-t %s" (format-time-string "%Y%m%d%H%M.%S" time t))
"")
(if (eq flag 'nofollow) "-h" "")
?h (or (tramp-file-name-host v) "")
?u (or (tramp-file-name-user v)
;; There might be an interactive setting.
- (tramp-get-connection-property v "login-as" nil)
+ (tramp-get-connection-property v "login-as")
"")
;; For direct remote copying, the port must be the
;; same for source and target.
(with-parsed-tramp-file-name name nil
;; If connection is not established yet, run the real handler.
(if (not (tramp-connectable-p v))
- (tramp-run-real-handler #'expand-file-name (list name nil))
+ (tramp-run-real-handler #'expand-file-name (list name))
(unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
(setq localname (concat "~/" localname)))
;; Tilde expansion if necessary. This needs a shell which
;; We cannot let-bind (tramp-get-connection-process vec) because it
;; might be nil.
(let ((scripts (tramp-get-connection-property
- (tramp-get-connection-process vec) "scripts" nil)))
+ (tramp-get-connection-process vec) "scripts")))
(unless (member name scripts)
(with-tramp-progress-reporter
vec 5 (format-message "Sending script `%s'" name)
(defun tramp-find-shell (vec)
"Open a shell on the remote host which groks tilde expansion."
;; If we are in `make-process', we don't need another shell.
- (unless (tramp-get-connection-property vec "process-name" nil)
+ (unless (tramp-get-connection-property vec "process-name")
(with-current-buffer (tramp-get-buffer vec)
(let ((default-shell (tramp-get-method-parameter vec 'tramp-remote-shell))
shell)
;; connection properties. We start again with
;; `tramp-maybe-open-connection', it will be caught there.
(tramp-message vec 5 "Checking system information")
- (let* ((old-uname (tramp-get-connection-property vec "uname" nil))
+ (let* ((old-uname (tramp-get-connection-property vec "uname"))
(uname
;; If we are in `make-process', we don't need to recompute.
- (if (and old-uname
- (tramp-get-connection-property vec "process-name" nil))
+ (if (and old-uname (tramp-get-connection-property vec "process-name"))
old-uname
(tramp-set-connection-property
vec "uname"
"Close the connection VEC after a session timeout.
If there is just some editing, retry it after 5 seconds."
(if (and (tramp-get-connection-property
- (tramp-get-connection-process vec) "locked" nil)
+ (tramp-get-connection-process vec) "locked")
(tramp-file-name-equal-p vec (car tramp-current-connection)))
(progn
(tramp-message
(throw 'non-essential 'non-essential))
(let ((p (tramp-get-connection-process vec))
- (process-name (tramp-get-connection-property vec "process-name" nil))
+ (process-name (tramp-get-connection-property vec "process-name"))
(process-environment (copy-sequence process-environment))
(pos (with-current-buffer (tramp-get-connection-buffer vec) (point))))
previous-hop hop)))
;; Activate session timeout.
- (when (tramp-get-connection-property p "session-timeout" nil)
+ (when (tramp-get-connection-property p "session-timeout")
(run-at-time
- (tramp-get-connection-property p "session-timeout" nil) nil
+ (tramp-get-connection-property p "session-timeout") nil
#'tramp-timeout-session vec))
;; Make initial shell settings.
function waits for output unless NOOUTPUT is set."
(unless neveropen (tramp-maybe-open-connection vec))
(let ((p (tramp-get-connection-process vec)))
- (when (tramp-get-connection-property p "remote-echo" nil)
+ (when (tramp-get-connection-property p "remote-echo")
;; We mark the command string that it can be erased in the output buffer.
(tramp-set-connection-property p "check-remote-echo" t)
;; If we put `tramp-echo-mark' after a trailing newline (which
(> size tramp-inline-compress-start-size))
(with-tramp-connection-property (tramp-get-process vec) prop
(tramp-find-inline-compress vec)
- (tramp-get-connection-property (tramp-get-process vec) prop nil))))
+ (tramp-get-connection-property (tramp-get-process vec) prop))))
(defun tramp-get-inline-coding (vec prop size)
"Return the coding command related to PROP.
(let ((coding
(with-tramp-connection-property (tramp-get-process vec) prop
(tramp-find-inline-encoding vec)
- (tramp-get-connection-property (tramp-get-process vec) prop nil)))
+ (tramp-get-connection-property (tramp-get-process vec) prop)))
(prop1 (if (tramp-compat-string-search "encoding" prop)
"inline-compress" "inline-decompress"))
compress)
(setq name (tramp-compat-file-name-concat dir name)))
;; If NAME is not a Tramp file, run the real handler.
(if (not (tramp-tramp-file-p name))
- (tramp-run-real-handler #'expand-file-name (list name nil))
+ (tramp-run-real-handler #'expand-file-name (list name))
;; Dissect NAME.
(with-parsed-tramp-file-name name nil
;; Tilde expansion if necessary.
(when tmpinput (delete-file tmpinput))
;; FIXME: Does connection-property "process-buffer" still exist?
(unless outbuf
- (kill-buffer (tramp-get-connection-property v "process-buffer" nil)))
+ (kill-buffer (tramp-get-connection-property v "process-buffer")))
(when process-file-side-effects
(tramp-flush-directory-properties v ""))
(setq localname (or localname "/"))
(with-tramp-file-property v localname "file-entries"
(let* ((share (tramp-smb-get-share v))
- (cache (tramp-get-connection-property v "share-cache" nil))
+ (cache (tramp-get-connection-property v "share-cache"))
res entry)
(if (and (not share) cache)
(if (not (zerop (length user))) (concat user "@") "")
host (or share ""))
- (let* ((coding-system-for-read nil)
+ (let* (coding-system-for-read
(process-connection-type tramp-process-connection-type)
(p (let ((default-directory
tramp-compat-temporary-file-directory)
(funcall orig-fun)))
(add-function
- :around (symbol-function #'shell-mode) #'tramp-sshfs-tolerate-tilde)
+ :around (symbol-function #'shell-mode) #'tramp-sshfs-tolerate-tilde)
(add-hook 'tramp-sshfs-unload-hook
(lambda ()
(remove-function
means to use always cached values for the directory contents."
:type '(choice (const nil) (const t) integer))
(make-obsolete-variable
- 'tramp-completion-reread-directory-timeout 'remote-file-name-inhibit-cache "27.2")
+ 'tramp-completion-reread-directory-timeout
+ 'remote-file-name-inhibit-cache "27.2")
;;; Internal Variables:
(replace-regexp-in-string "^tramp-" "" (symbol-name param))))
(if (tramp-connection-property-p vec hash-entry)
;; We use the cached property.
- (tramp-get-connection-property vec hash-entry nil)
+ (tramp-get-connection-property vec hash-entry)
;; Use the static value from `tramp-methods'.
(when-let ((methods-entry
(assoc
;; as indication, whether a connection is active.
(tramp-set-connection-property
vec "process-buffer"
- (tramp-get-connection-property vec "process-buffer" nil))
+ (tramp-get-connection-property vec "process-buffer"))
(setq buffer-undo-list t
default-directory
(tramp-make-tramp-file-name vec 'noloc))
Unless DONT-CREATE, the buffer is created when it doesn't exist yet.
In case a second asynchronous communication has been started, it is different
from `tramp-get-buffer'."
- (or (tramp-get-connection-property vec "process-buffer" nil)
+ (or (tramp-get-connection-property vec "process-buffer")
(tramp-get-buffer vec dont-create)))
(defun tramp-get-connection-name (vec)
"Get the connection name to be used for VEC.
In case a second asynchronous communication has been started, it is different
from the default one."
- (or (tramp-get-connection-property vec "process-name" nil)
+ (or (tramp-get-connection-property vec "process-name")
(tramp-buffer-name vec)))
(defun tramp-get-process (vec-or-proc)
;; running, and when there is a minimum level.
(when-let ((pr (and (null tramp-inhibit-progress-reporter)
(<= ,level (min tramp-verbose 3))
- (make-progress-reporter ,message nil nil))))
+ (make-progress-reporter ,message))))
(run-at-time 3 0.1 #'tramp-progress-reporter-update pr))))
(unwind-protect
;; Execute the body.
;; home directory.
(tramp-get-home-directory vec)
;; Otherwise, just use the cached value.
- (tramp-get-connection-property vec "~" nil))))
+ (tramp-get-connection-property vec "~"))))
(when home-dir
(setq home-dir
(tramp-compat-funcall
(setq name (tramp-compat-file-name-concat dir name)))
;; If NAME is not a Tramp file, run the real handler.
(if (not (tramp-tramp-file-p name))
- (tramp-run-real-handler #'expand-file-name (list name nil))
+ (tramp-run-real-handler #'expand-file-name (list name))
;; Dissect NAME.
(with-parsed-tramp-file-name name nil
(unless (tramp-run-real-handler #'file-name-absolute-p (list localname))
(let* ((o (tramp-dissect-file-name filename))
(p (tramp-get-connection-process o))
(c (and (process-live-p p)
- (tramp-get-connection-property p "connected" nil))))
+ (tramp-get-connection-property p "connected"))))
;; We expand the file name only, if there is already a connection.
(with-parsed-tramp-file-name
(if c (expand-file-name filename) filename) nil
(and ;; The method supports it.
(tramp-get-method-parameter v 'tramp-direct-async)
;; It has been indicated.
- (tramp-get-connection-property v "direct-async-process" nil)
+ (tramp-get-connection-property v "direct-async-process")
;; There's no multi-hop.
(or (not (tramp-multi-hop-p v))
(= (length (tramp-compute-multi-hops v)) 1))
(prog1
;; Run the process.
- (process-file-shell-command command nil buffer nil)
+ (process-file-shell-command command nil buffer)
;; Insert error messages if they were separated.
(when error-file
(with-current-buffer error-buffer
;; Sometimes, the process returns a new password request
;; immediately after rejecting the previous (wrong) one.
(unless (or tramp-password-prompt-not-unique
- (tramp-get-connection-property
- vec "first-password-request" nil))
+ (tramp-get-connection-property vec "first-password-request"))
(tramp-clear-passwd vec))
(goto-char (point-min))
(tramp-check-for-regexp proc tramp-process-action-regexp)
"Lock PROC for other communication, and run BODY.
Mostly useful to protect BODY from being interrupted by timers."
(declare (indent 1) (debug t))
- `(if (tramp-get-connection-property ,proc "locked" nil)
+ `(if (tramp-get-connection-property ,proc "locked")
;; Be kind for older Emacsen.
(if (member 'remote-file-error debug-ignored-errors)
(throw 'non-essential 'non-essential)
;; Check whether we need to remove echo output. The max length of
;; the echo mark regexp is taken for search. We restrict the
;; search for the second echo mark to PIPE_BUF characters.
- (when (and (tramp-get-connection-property proc "check-remote-echo" nil)
+ (when (and (tramp-get-connection-property proc "check-remote-echo")
(re-search-forward
tramp-echoed-echo-mark-regexp
(+ (point) (* 5 tramp-echo-mark-marker-length)) t))
(delete-region begin (point))
(goto-char (point-min)))))
- (when (or (not (tramp-get-connection-property proc "check-remote-echo" nil))
+ (when (or (not (tramp-get-connection-property proc "check-remote-echo"))
;; Sometimes, the echo string is suppressed on the remote side.
(not (string-equal
(substring-no-properties
the remote host use line-endings as defined in the variable
`tramp-rsh-end-of-line'. The communication buffer is erased before sending."
(let* ((p (tramp-get-connection-process vec))
- (chunksize (tramp-get-connection-property p "chunksize" nil)))
+ (chunksize (tramp-get-connection-property p "chunksize")))
(unless p
(tramp-error
vec 'file-error "Can't send string to remote host -- not logged in"))
(unless (process-live-p proc)
(let ((vec (process-get proc 'vector))
(buf (process-buffer proc))
- (prompt (tramp-get-connection-property proc "prompt" nil)))
+ (prompt (tramp-get-connection-property proc "prompt")))
(when vec
(tramp-message vec 5 "Sentinel called: `%S' `%s'" proc event)
(tramp-flush-connection-properties proc)
"Check `file-attributes' caches for VEC.
Return t if according to the cache access type ACCESS is known to
be granted."
- (let ((result nil)
+ (let (result
(offset (cond
((eq ?r access) 1)
((eq ?w access) 2)
(key (tramp-make-tramp-file-name vec 'noloc))
(method (tramp-file-name-method vec))
(user (or (tramp-file-name-user-domain vec)
- (tramp-get-connection-property key "login-as" nil)))
+ (tramp-get-connection-property key "login-as")))
(host (tramp-file-name-host-port vec))
(pw-prompt
(or prompt
(setq tramp-password-save-function nil)
;; See if auth-sources contains something useful.
(ignore-errors
- (and (tramp-get-connection-property
- vec "first-password-request" nil)
+ (and (tramp-get-connection-property vec "first-password-request")
;; Try with Tramp's current method. If there is no
;; user name, `:create' triggers to ask for. We
;; suppress it.
;; Suppress message from `emacs-repository-get-branch'. We must
;; also handle out-of-tree builds.
(let ((inhibit-message t)
- (debug-on-error nil)
(dir (or (locate-dominating-file (locate-library "tramp") ".git")
- source-directory)))
+ source-directory))
+ debug-on-error)
;; `emacs-repository-get-branch' has been introduced with Emacs 27.1.
(with-no-warnings
(and (stringp dir) (file-directory-p dir)
;; Suppress message from `emacs-repository-get-version'. We must
;; also handle out-of-tree builds.
(let ((inhibit-message t)
- (debug-on-error nil)
(dir (or (locate-dominating-file (locate-library "tramp") ".git")
- source-directory)))
+ source-directory))
+ debug-on-error)
(and (stringp dir) (file-directory-p dir)
(executable-find "git")
(emacs-repository-get-version dir))))
;; This fails for tramp-crypt.el, so we ignore that.
(ignore-errors
(insert-directory ert-remote-temporary-file-directory "-al"))
- (not (tramp-get-connection-property tramp-test-vec "ls--dired" nil)))))
+ (not (tramp-get-connection-property tramp-test-vec "ls--dired")))))
(defun tramp--test-share-p ()
"Check, whether the method needs a share."
This is needed in timer functions as well as process filters and sentinels."
;; FIXME: For tramp-sshfs.el, `processp' does not work.
(declare (indent 1) (debug (processp body)))
- `(let* ((v (tramp-get-connection-property ,proc "vector" nil))
- (pname (tramp-get-connection-property v "process-name" nil))
- (pbuffer (tramp-get-connection-property v "process-buffer" nil)))
+ `(let* ((v (tramp-get-connection-property ,proc "vector"))
+ (pname (tramp-get-connection-property v "process-name"))
+ (pbuffer (tramp-get-connection-property v "process-buffer")))
(tramp--test-message
"tramp--test-with-proper-process-name-and-buffer before %s %s"
- (tramp-get-connection-property v "process-name" nil)
- (tramp-get-connection-property v "process-buffer" nil))
+ (tramp-get-connection-property v "process-name")
+ (tramp-get-connection-property v "process-buffer"))
(if (process-name ,proc)
(tramp-set-connection-property v "process-name" (process-name ,proc))
(tramp-flush-connection-property v "process-name"))
(tramp-flush-connection-property v "process-buffer"))
(tramp--test-message
"tramp--test-with-proper-process-name-and-buffer changed %s %s"
- (tramp-get-connection-property v "process-name" nil)
- (tramp-get-connection-property v "process-buffer" nil))
+ (tramp-get-connection-property v "process-name")
+ (tramp-get-connection-property v "process-buffer"))
(unwind-protect
(progn ,@body)
(if pname