diff options
Diffstat (limited to 'lisp/simple.el')
| -rw-r--r-- | lisp/simple.el | 81 |
1 files changed, 42 insertions, 39 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 8bd32a8db8d..610d4a3be42 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -2713,47 +2713,50 @@ support pty association, if PROGRAM is nil." | |||
| 2713 | (tabulated-list-init-header)) | 2713 | (tabulated-list-init-header)) |
| 2714 | 2714 | ||
| 2715 | (defun list-processes--refresh () | 2715 | (defun list-processes--refresh () |
| 2716 | "Recompute the list of processes for the Process List buffer." | 2716 | "Recompute the list of processes for the Process List buffer. |
| 2717 | Also, delete any process that is exited or signaled." | ||
| 2717 | (setq tabulated-list-entries nil) | 2718 | (setq tabulated-list-entries nil) |
| 2718 | (dolist (p (process-list)) | 2719 | (dolist (p (process-list)) |
| 2719 | (when (or (not process-menu-query-only) | 2720 | (cond ((memq (process-status p) '(exit signal closed)) |
| 2720 | (process-query-on-exit-flag p)) | 2721 | (delete-process p)) |
| 2721 | (let* ((buf (process-buffer p)) | 2722 | ((or (not process-menu-query-only) |
| 2722 | (type (process-type p)) | 2723 | (process-query-on-exit-flag p)) |
| 2723 | (name (process-name p)) | 2724 | (let* ((buf (process-buffer p)) |
| 2724 | (status (symbol-name (process-status p))) | 2725 | (type (process-type p)) |
| 2725 | (buf-label (if (buffer-live-p buf) | 2726 | (name (process-name p)) |
| 2726 | `(,(buffer-name buf) | 2727 | (status (symbol-name (process-status p))) |
| 2727 | face link | 2728 | (buf-label (if (buffer-live-p buf) |
| 2728 | help-echo ,(concat "Visit buffer `" | 2729 | `(,(buffer-name buf) |
| 2729 | (buffer-name buf) "'") | 2730 | face link |
| 2730 | follow-link t | 2731 | help-echo ,(concat "Visit buffer `" |
| 2731 | process-buffer ,buf | 2732 | (buffer-name buf) "'") |
| 2732 | action process-menu-visit-buffer) | 2733 | follow-link t |
| 2733 | "--")) | 2734 | process-buffer ,buf |
| 2734 | (tty (or (process-tty-name p) "--")) | 2735 | action process-menu-visit-buffer) |
| 2735 | (cmd | 2736 | "--")) |
| 2736 | (if (memq type '(network serial)) | 2737 | (tty (or (process-tty-name p) "--")) |
| 2737 | (let ((contact (process-contact p t))) | 2738 | (cmd |
| 2738 | (if (eq type 'network) | 2739 | (if (memq type '(network serial)) |
| 2739 | (format "(%s %s)" | 2740 | (let ((contact (process-contact p t))) |
| 2740 | (if (plist-get contact :type) | 2741 | (if (eq type 'network) |
| 2741 | "datagram" | 2742 | (format "(%s %s)" |
| 2742 | "network") | 2743 | (if (plist-get contact :type) |
| 2743 | (if (plist-get contact :server) | 2744 | "datagram" |
| 2744 | (format "server on %s" | 2745 | "network") |
| 2745 | (plist-get contact :server)) | 2746 | (if (plist-get contact :server) |
| 2746 | (format "connection to %s" | 2747 | (format "server on %s" |
| 2747 | (plist-get contact :host)))) | 2748 | (plist-get contact :server)) |
| 2748 | (format "(serial port %s%s)" | 2749 | (format "connection to %s" |
| 2749 | (or (plist-get contact :port) "?") | 2750 | (plist-get contact :host)))) |
| 2750 | (let ((speed (plist-get contact :speed))) | 2751 | (format "(serial port %s%s)" |
| 2751 | (if speed | 2752 | (or (plist-get contact :port) "?") |
| 2752 | (format " at %s b/s" speed) | 2753 | (let ((speed (plist-get contact :speed))) |
| 2753 | ""))))) | 2754 | (if speed |
| 2754 | (mapconcat 'identity (process-command p) " ")))) | 2755 | (format " at %s b/s" speed) |
| 2755 | (push (list p (vector name status buf-label tty cmd)) | 2756 | ""))))) |
| 2756 | tabulated-list-entries))))) | 2757 | (mapconcat 'identity (process-command p) " ")))) |
| 2758 | (push (list p (vector name status buf-label tty cmd)) | ||
| 2759 | tabulated-list-entries)))))) | ||
| 2757 | 2760 | ||
| 2758 | (defun process-menu-visit-buffer (button) | 2761 | (defun process-menu-visit-buffer (button) |
| 2759 | (display-buffer (button-get button 'process-buffer))) | 2762 | (display-buffer (button-get button 'process-buffer))) |