1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Tramp code cleanup

* lisp/net/tramp-cache.el (tramp-get-file-property)
(tramp-get-connection-property): Make DEFAULT optional.  Adapt callees.

* lisp/net/tramp.el:
* lisp/net/tramp-adb.el:
* lisp/net/tramp-cmds.el:
* lisp/net/tramp-compat.el:
* lisp/net/tramp-crypt.el:
* lisp/net/tramp-ftp.el:
* lisp/net/tramp-fuse.el:
* lisp/net/tramp-gvfs.el:
* lisp/net/tramp-integration.el:
* lisp/net/tramp-sh.el:
* lisp/net/tramp-smb.el:
* lisp/net/tramp-sshfs.el:
* lisp/net/trampver.el: Code cleanup.

* test/lisp/net/tramp-tests.el (tramp--test-sh-no-ls--dired-p)
(tramp--test-with-proper-process-name-and-buffer): Code cleanup.
This commit is contained in:
Michael Albinus 2022-07-03 18:23:55 +02:00
parent 676d38cfc3
commit c8da2a991e
15 changed files with 124 additions and 137 deletions

View file

@ -6570,7 +6570,7 @@ Additionally, ls does not support \"--dired\"."
;; 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."
@ -7141,13 +7141,13 @@ The values are derived from PROC. Run BODY.
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"))
@ -7157,8 +7157,8 @@ This is needed in timer functions as well as process filters and sentinels."
(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