From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.bugs Subject: Re: go from *Process List* to each process's buffer easy Date: Mon, 20 Oct 2003 18:06:19 -0600 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3F94787B.9030005@yahoo.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070500040900020500060209" X-Trace: sea.gmane.org 1066694890 14483 80.91.224.253 (21 Oct 2003 00:08:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Oct 2003 00:08:10 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 21 02:08:07 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ABk4F-0001TT-00 for ; Tue, 21 Oct 2003 02:08:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ABk3s-0008QW-PP for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Oct 2003 20:07:44 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ABk36-0008LP-Ro for bug-gnu-emacs@prep.ai.mit.edu; Mon, 20 Oct 2003 20:06:56 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ABk2Z-0007US-4T for bug-gnu-emacs@prep.ai.mit.edu; Mon, 20 Oct 2003 20:06:55 -0400 Original-Received: from [193.4.58.12] (helo=horus.isnic.is) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1ABk2X-0007SY-0o for bug-gnu-emacs@prep.ai.mit.edu; Mon, 20 Oct 2003 20:06:21 -0400 Original-Received: from mail.fu-berlin.de (root@mail.fu-berlin.de [160.45.11.165]) by horus.isnic.is (8.12.9p2/8.12.9/isnic) with ESMTP id h9L06I9j010429 for ; Tue, 21 Oct 2003 00:06:19 GMT (envelope-from ihs_4664@yahoo.com) Original-Received: by mail.fu-berlin.de (Smail3.2.0.98) from Curry.ZEDAT.FU-Berlin.DE (160.45.10.36) with esmtp id ; Tue, 21 Oct 2003 02:06:18 +0200 (MEST) Original-Received: by Curry.ZEDAT.FU-Berlin.DE (Smail3.2.0.98) from news.fu-berlin.de with bsmtp id ; Tue, 21 Oct 2003 02:06:17 +0200 (MEST) Original-To: gnu-emacs-bug@moderators.isc.org Original-Path: 170.207.51.80!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 60 X-Orig-NNTP-Posting-Host: 170.207.51.80 X-Orig-X-Trace: news.uni-berlin.de 1066694777 29767555 170.207.51.80 (16 [82742]) User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 X-Accept-Language: en-us X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:6009 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:6009 This is a multi-part message in MIME format. --------------070500040900020500060209 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Dan Jacobson wrote: > Hitting RET on a line in the *Process List* buffer should take one to > that process's buffer, if any. One way you could do that would be to temporarily bind temp-buffer-show-hook in list-processes. I don't know to do that in C, though, so I experimented by advising it (which works if you call it via `M-x list-processes'). The new hook function has to parse the *Process List* buffer, which is kind of nasty because the Proc and Buffer columns can be arbitrary strings (including spaces) and may be shifted to the right. (The *Completions* buffer used to have the same problem, but now you can use the mouse-face property to find the individual items.) Anyway, here's a hack to get you started: --------------070500040900020500060209 Content-Type: text/plain; name="list-processes-make-xrefs.el" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="list-processes-make-xrefs.el" (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))))) --------------070500040900020500060209 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Bug-gnu-emacs mailing list Bug-gnu-emacs@gnu.org http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs --------------070500040900020500060209--