(defadvice list-processes (around make-xrefs activate) "Add hyperlinks to select each process buffer." (let ((temp-buffer-show-hook 'list-processes-make-xrefs)) ad-do-it)) (defun list-processes-make-xrefs (&optional buffer) "Add bindings to select each process buffer via `local-keymap' overlay properties." (save-excursion (set-buffer (or buffer (current-buffer))) (goto-char (point-min)) ;; See src/process.c:list_processes_1(): (or (re-search-forward "^-+ +-+ +-+ +-+ +-+$" nil t) (error "*Process List* header not found")) (forward-line 1) (let* ((proc-regexp "\\([a-zA-Z0-9---]+\\)") (status-regexp "\\(run\\|stop\\|exit\\|signal\\|open\\|closed\\|nil\\)") (buffer-regexp "\\([a-zA-Z0-9---<>*()]+ ?[a-zA-Z0-9---<>*()]+\\)") (proc-status-buffer-regexp (format "\\=%s +%s +%s +" proc-regexp status-regexp buffer-regexp)) (help-echo (substitute-command-keys "\\\\[help-follow-mouse]: Select this buffer")) process-buffer) (while (re-search-forward proc-status-buffer-regexp nil t) (setq process-buffer (get-buffer (match-string 3))) (if process-buffer ; not "(none)" or "(Killed)" (help-xref-button 3 'switch-to-buffer process-buffer help-echo)) (forward-line 1)))))