diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2022-04-12 09:41:11 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2022-04-12 09:41:11 +0200 |
commit | 17f0900d7bd783375e07f642cf8740c3e1dbaa8f (patch) | |
tree | c9895f9fe46477e4f8cb8a97ba4bc97fa5bf1361 /lisp/net/tramp-integration.el | |
parent | e258e582768a6f974ab1da198e894408d9933cd1 (diff) | |
download | emacs-17f0900d7bd783375e07f642cf8740c3e1dbaa8f.tar.gz |
Adapt macOS defaults in Tramp's process-attributes implementation
* doc/misc/tramp.texi (Remote processes):
Mention tramp-connection-local-darwin-ps-* constants.
* lisp/net/tramp-integration.el
(tramp-connection-local-darwin-ps-variables): Fix docstring.
(top): Simplify setting local profiles.
* test/lisp/net/tramp-tests.el (tramp-test31-list-system-processes)
(tramp-test31-process-attributes): New tests.
Diffstat (limited to 'lisp/net/tramp-integration.el')
-rw-r--r-- | lisp/net/tramp-integration.el | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el index 901826bfc18..b7f82770c40 100644 --- a/lisp/net/tramp-integration.el +++ b/lisp/net/tramp-integration.el @@ -430,8 +430,7 @@ See `tramp-process-attributes-ps-format'.") 'tramp-connection-local-busybox-ps-profile tramp-connection-local-busybox-ps-variables) - -;; Darwin (macOS) +;; Darwin (macOS). (defconst tramp-darwin-process-attributes-ps-args `("-acxww" "-o" @@ -498,31 +497,25 @@ See `tramp-process-attributes-ps-format'.") . ,tramp-darwin-process-attributes-ps-args) (tramp-process-attributes-ps-format . ,tramp-darwin-process-attributes-ps-format)) - "Default connection-local ps variables for remote Darwin -connections.") + "Default connection-local ps variables for remote Darwin connections.") (connection-local-set-profile-variables 'tramp-connection-local-darwin-ps-profile tramp-connection-local-darwin-ps-variables) +;; Preset default "ps" profile for local hosts, based on system type. - -;; Preset default "ps" profile for the case of local sudo, based on -;; system type. - -(let ((local-sudo-profile - (cond ((eq system-type 'darwin) - 'tramp-connection-local-darwin-ps-profile) - ;; ...add other system types here - ))) - (when local-sudo-profile - (connection-local-set-profiles - `(:application tramp :protocol "sudo" :user "root" :machine ,(system-name)) - local-sudo-profile) - (connection-local-set-profiles - '(:application tramp :protocol "sudo" :user "root" :machine "localhost") - local-sudo-profile))) - +(when-let ((local-profile + (cond ((eq system-type 'darwin) + 'tramp-connection-local-darwin-ps-profile) + ;; ... Add other system types here. + ))) + (connection-local-set-profiles + `(:application tramp :machine ,(system-name)) + local-profile) + (connection-local-set-profiles + '(:application tramp :machine "localhost") + local-profile)) (add-hook 'tramp-unload-hook (lambda () (unload-feature 'tramp-integration 'force))) |