aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorMichael Albinus2022-04-05 17:08:03 +0200
committerMichael Albinus2022-04-05 17:08:03 +0200
commite48ac2e2040cf0dd628b7fee6991a1738ceb2349 (patch)
tree76fe1343cbb9ea73d506982d8b0158f474488cc4 /src/process.c
parent7d504c9acc0c8d75d11c3a2b5e016f39e6156bf8 (diff)
downloademacs-e48ac2e2040cf0dd628b7fee6991a1738ceb2349.tar.gz
emacs-e48ac2e2040cf0dd628b7fee6991a1738ceb2349.zip
Handle remote system processes
* doc/lispref/files.texi (Magic File Names): Add list-system-processes and process-attributes. * doc/lispref/processes.texi (System Processes): Document changes in list-system-processes and process-attributes. * doc/misc/tramp.texi (Customizing Completion): Use @ftable. (Remote processes): Document changes in list-system-processes and process-attributes. * etc/NEWS: Document changes in proced, list-system-processes and process-attributes. * lisp/proced.el (proced-show-remote-processes): New defcustom. (proced-remote-directory): Remove. (proced-filter-alist): Use it. (proced-user-name): New defun. (proced-available): Set it to t. (proced-mode): Adapt docstring. (proced): Adapt docstring. Acknowledge prefix argument. (proced-format): Change initialization of `standard-attributes'. (proced-send-signal, proced-renice): Adapt docstring. Remove special handling of prefix argument. * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): * lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist): * lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist): * lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist): * lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist): Add 'list-system-processes' and `process-attributes'. * lisp/net/tramp-integration.el (files-x): Require `files-x'. (tramp-bsd-process-attributes-ps-args) (tramp-bsd-process-attributes-ps-format) (tramp-connection-local-bsd-ps-variables) (tramp-busybox-process-attributes-ps-args) (tramp-busybox-process-attributes-ps-format) (tramp-connection-local-busybox-ps-variables): * lisp/net/tramp-adb.el (tramp-adb-connection-local-default-ps-variables): New defconsts. Add them to connection-local variables. * lisp/net/tramp.el (tramp-file-name-for-operation): Add 'list-system-processes' and `process-attributes'. (tramp-process-attributes-ps-args) (tramp-process-attributes-ps-format): New defconsts. (tramp-ps-time, tramp-get-process-attributes) (tramp-handle-list-system-processes) (tramp-handle-process-attributes): New defuns. * src/process.c (Flist_system_processes, Fprocess_attributes): Support remote system processes. (Qlist_system_processes, Qprocess_attributes): Declare symbols.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c
index e8aafd02d74..d4a78521ab1 100644
--- a/src/process.c
+++ b/src/process.c
@@ -8203,16 +8203,25 @@ DEFUN ("list-system-processes", Flist_system_processes, Slist_system_processes,
8203 0, 0, 0, 8203 0, 0, 0,
8204 doc: /* Return a list of numerical process IDs of all running processes. 8204 doc: /* Return a list of numerical process IDs of all running processes.
8205If this functionality is unsupported, return nil. 8205If this functionality is unsupported, return nil.
8206If `default-directory' is remote, return process IDs of the respective remote host.
8206 8207
8207See `process-attributes' for getting attributes of a process given its ID. */) 8208See `process-attributes' for getting attributes of a process given its ID. */)
8208 (void) 8209 (void)
8209{ 8210{
8211 Lisp_Object handler
8212 = Ffind_file_name_handler (BVAR (current_buffer, directory),
8213 Qlist_system_processes);
8214 if (!NILP (handler))
8215 return call1 (handler, Qlist_system_processes);
8216
8210 return list_system_processes (); 8217 return list_system_processes ();
8211} 8218}
8212 8219
8213DEFUN ("process-attributes", Fprocess_attributes, 8220DEFUN ("process-attributes", Fprocess_attributes,
8214 Sprocess_attributes, 1, 1, 0, 8221 Sprocess_attributes, 1, 1, 0,
8215 doc: /* Return attributes of the process given by its PID, a number. 8222 doc: /* Return attributes of the process given by its PID, a number.
8223If `default-directory' is remote, PID is regarded as process
8224identifier on the respective remote host.
8216 8225
8217Value is an alist where each element is a cons cell of the form 8226Value is an alist where each element is a cons cell of the form
8218 8227
@@ -8263,6 +8272,12 @@ integer or floating point values.
8263 args -- command line which invoked the process (string). */) 8272 args -- command line which invoked the process (string). */)
8264 ( Lisp_Object pid) 8273 ( Lisp_Object pid)
8265{ 8274{
8275 Lisp_Object handler
8276 = Ffind_file_name_handler (BVAR (current_buffer, directory),
8277 Qprocess_attributes);
8278 if (!NILP (handler))
8279 return call2 (handler, Qprocess_attributes, pid);
8280
8266 return system_process_attributes (pid); 8281 return system_process_attributes (pid);
8267} 8282}
8268 8283
@@ -8438,6 +8453,8 @@ void
8438syms_of_process (void) 8453syms_of_process (void)
8439{ 8454{
8440 DEFSYM (Qmake_process, "make-process"); 8455 DEFSYM (Qmake_process, "make-process");
8456 DEFSYM (Qlist_system_processes, "list-system-processes");
8457 DEFSYM (Qprocess_attributes, "process-attributes");
8441 8458
8442#ifdef subprocesses 8459#ifdef subprocesses
8443 8460