aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2024-03-04 15:44:24 +0100
committerMichael Albinus2024-03-04 15:44:24 +0100
commit5b49a38d1b37707bbbc8c069ed20ce7cd18fb2ac (patch)
treefe548efa376f7f15867890875101470f2c8058dc
parent11ffb4656d768b09e1f7dfacc091d85eef4a403a (diff)
downloademacs-5b49a38d1b37707bbbc8c069ed20ce7cd18fb2ac.tar.gz
emacs-5b49a38d1b37707bbbc8c069ed20ce7cd18fb2ac.zip
tramp-androidsu.el code cleanup
* lisp/net/tramp-androidsu.el (tramp-androidsu-generate-wrapper): Prefer #' notation for function names. (tramp-androidsu-handle-copy-file) (tramp-androidsu-handle-file-local-copy) (tramp-androidsu-handle-make-symbolic-link) (tramp-androidsu-handle-rename-file) (tramp-androidsu-handle-write-region): Don't use a wrapper. (tramp-adb-connection-local-default-ps-profile): Don't initialize, this happens in tramp-db.el.
-rw-r--r--lisp/net/tramp-androidsu.el36
1 files changed, 16 insertions, 20 deletions
diff --git a/lisp/net/tramp-androidsu.el b/lisp/net/tramp-androidsu.el
index 12453d40acd..c7fb67d4081 100644
--- a/lisp/net/tramp-androidsu.el
+++ b/lisp/net/tramp-androidsu.el
@@ -232,19 +232,19 @@ FUNCTION."
232 ;; tramp-adb-wait-for-output addresses problems introduced 232 ;; tramp-adb-wait-for-output addresses problems introduced
233 ;; by the adb utility itself, not Android utilities, so 233 ;; by the adb utility itself, not Android utilities, so
234 ;; replace it with the regular TRAMP function. 234 ;; replace it with the regular TRAMP function.
235 (fset 'tramp-adb-wait-for-output #'tramp-wait-for-output) 235 (fset #'tramp-adb-wait-for-output #'tramp-wait-for-output)
236 ;; Likewise, except some special treatment is necessary on 236 ;; Likewise, except some special treatment is necessary on
237 ;; account of flaws in Android's su implementation. 237 ;; account of flaws in Android's su implementation.
238 (fset 'tramp-adb-maybe-open-connection 238 (fset #'tramp-adb-maybe-open-connection
239 #'tramp-androidsu-maybe-open-connection) 239 #'tramp-androidsu-maybe-open-connection)
240 (apply function args)) 240 (apply function args))
241 ;; Restore the original definitions of the functions overridden 241 ;; Restore the original definitions of the functions overridden
242 ;; above. 242 ;; above.
243 (fset 'tramp-adb-wait-for-output tramp-adb-wait-for-output) 243 (fset #'tramp-adb-wait-for-output tramp-adb-wait-for-output)
244 (fset 'tramp-adb-maybe-open-connection tramp-adb-maybe-open-connection))))) 244 (fset #'tramp-adb-maybe-open-connection
245 tramp-adb-maybe-open-connection)))))
245 246
246(defalias 'tramp-androidsu-handle-copy-file 247(defalias 'tramp-androidsu-handle-copy-file #'tramp-sh-handle-copy-file)
247 (tramp-androidsu-generate-wrapper #'tramp-sh-handle-copy-file))
248 248
249(defalias 'tramp-androidsu-handle-delete-directory 249(defalias 'tramp-androidsu-handle-delete-directory
250 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-delete-directory)) 250 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-delete-directory))
@@ -253,7 +253,8 @@ FUNCTION."
253 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-delete-file)) 253 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-delete-file))
254 254
255(defalias 'tramp-androidsu-handle-directory-files-and-attributes 255(defalias 'tramp-androidsu-handle-directory-files-and-attributes
256 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-directory-files-and-attributes)) 256 (tramp-androidsu-generate-wrapper
257 #'tramp-adb-handle-directory-files-and-attributes))
257 258
258(defalias 'tramp-androidsu-handle-exec-path 259(defalias 'tramp-androidsu-handle-exec-path
259 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-exec-path)) 260 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-exec-path))
@@ -268,10 +269,11 @@ FUNCTION."
268 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-file-exists-p)) 269 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-file-exists-p))
269 270
270(defalias 'tramp-androidsu-handle-file-local-copy 271(defalias 'tramp-androidsu-handle-file-local-copy
271 (tramp-androidsu-generate-wrapper #'tramp-sh-handle-file-local-copy)) 272 #'tramp-sh-handle-file-local-copy)
272 273
273(defalias 'tramp-androidsu-handle-file-name-all-completions 274(defalias 'tramp-androidsu-handle-file-name-all-completions
274 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-file-name-all-completions)) 275 (tramp-androidsu-generate-wrapper
276 #'tramp-adb-handle-file-name-all-completions))
275 277
276(defalias 'tramp-androidsu-handle-file-readable-p 278(defalias 'tramp-androidsu-handle-file-readable-p
277 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-file-readable-p)) 279 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-file-readable-p))
@@ -400,14 +402,12 @@ FUNCTION."
400 p))))) 402 p)))))
401 403
402(defalias 'tramp-androidsu-handle-make-symbolic-link 404(defalias 'tramp-androidsu-handle-make-symbolic-link
403 (tramp-androidsu-generate-wrapper 405 #'tramp-sh-handle-make-symbolic-link)
404 #'tramp-sh-handle-make-symbolic-link))
405 406
406(defalias 'tramp-androidsu-handle-process-file 407(defalias 'tramp-androidsu-handle-process-file
407 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-process-file)) 408 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-process-file))
408 409
409(defalias 'tramp-androidsu-handle-rename-file 410(defalias 'tramp-androidsu-handle-rename-file #'tramp-sh-handle-rename-file)
410 (tramp-androidsu-generate-wrapper #'tramp-sh-handle-rename-file))
411 411
412(defalias 'tramp-androidsu-handle-set-file-modes 412(defalias 'tramp-androidsu-handle-set-file-modes
413 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-set-file-modes)) 413 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-set-file-modes))
@@ -424,8 +424,7 @@ FUNCTION."
424(defalias 'tramp-androidsu-handle-get-remote-uid 424(defalias 'tramp-androidsu-handle-get-remote-uid
425 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-get-remote-uid)) 425 (tramp-androidsu-generate-wrapper #'tramp-adb-handle-get-remote-uid))
426 426
427(defalias 'tramp-androidsu-handle-write-region 427(defalias 'tramp-androidsu-handle-write-region #'tramp-sh-handle-write-region)
428 (tramp-androidsu-generate-wrapper #'tramp-sh-handle-write-region))
429 428
430;;;###tramp-autoload 429;;;###tramp-autoload
431(defconst tramp-androidsu-file-name-handler-alist 430(defconst tramp-androidsu-file-name-handler-alist
@@ -458,7 +457,8 @@ FUNCTION."
458 (file-local-copy . tramp-androidsu-handle-file-local-copy) 457 (file-local-copy . tramp-androidsu-handle-file-local-copy)
459 (file-locked-p . tramp-handle-file-locked-p) 458 (file-locked-p . tramp-handle-file-locked-p)
460 (file-modes . tramp-handle-file-modes) 459 (file-modes . tramp-handle-file-modes)
461 (file-name-all-completions . tramp-androidsu-handle-file-name-all-completions) 460 (file-name-all-completions
461 . tramp-androidsu-handle-file-name-all-completions)
462 (file-name-as-directory . tramp-handle-file-name-as-directory) 462 (file-name-as-directory . tramp-handle-file-name-as-directory)
463 (file-name-case-insensitive-p . tramp-handle-file-name-case-insensitive-p) 463 (file-name-case-insensitive-p . tramp-handle-file-name-case-insensitive-p)
464 (file-name-completion . tramp-handle-file-name-completion) 464 (file-name-completion . tramp-handle-file-name-completion)
@@ -542,10 +542,6 @@ arguments to pass to the OPERATION."
542 (tramp-register-foreign-file-name-handler 542 (tramp-register-foreign-file-name-handler
543 #'tramp-androidsu-file-name-p #'tramp-androidsu-file-name-handler)) 543 #'tramp-androidsu-file-name-p #'tramp-androidsu-file-name-handler))
544 544
545(connection-local-set-profile-variables
546 'tramp-adb-connection-local-default-ps-profile
547 tramp-adb-connection-local-default-ps-variables)
548
549(with-eval-after-load 'shell 545(with-eval-after-load 'shell
550 (connection-local-set-profiles 546 (connection-local-set-profiles
551 `(:application tramp :protocol ,tramp-androidsu-method) 547 `(:application tramp :protocol ,tramp-androidsu-method)