From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: info.el patch to open node in new window [was: generate 3) S-mouse-2: follow link in new window] Date: Tue, 25 Sep 2007 16:39:26 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0008_01C7FF92.A2B9EB70" X-Trace: sea.gmane.org 1190763593 26427 80.91.229.12 (25 Sep 2007 23:39:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 25 Sep 2007 23:39:53 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 26 01:39:49 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IaK0K-0002eO-UA for ged-emacs-devel@m.gmane.org; Wed, 26 Sep 2007 01:39:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IaK0H-0001hk-Ur for ged-emacs-devel@m.gmane.org; Tue, 25 Sep 2007 19:39:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IaK0E-0001ek-9s for emacs-devel@gnu.org; Tue, 25 Sep 2007 19:39:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IaK0D-0001dK-0t for emacs-devel@gnu.org; Tue, 25 Sep 2007 19:39:42 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IaK0C-0001dD-NT for emacs-devel@gnu.org; Tue, 25 Sep 2007 19:39:40 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IaK0C-0002cz-6E for emacs-devel@gnu.org; Tue, 25 Sep 2007 19:39:40 -0400 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id l8PNdblU005554 for ; Tue, 25 Sep 2007 17:39:37 -0600 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id l8PNdabg002257 for ; Tue, 25 Sep 2007 17:39:37 -0600 Original-Received: from dhcp-amer-csvpn-gw2-141-144-76-1.vpn.oracle.com by acsmt350.oracle.com with ESMTP id 3243945641190763540; Tue, 25 Sep 2007 16:39:00 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 In-reply-to: X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-Detected-Kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:79876 Archived-At: This is a multi-part message in MIME format. ------=_NextPart_000_0008_01C7FF92.A2B9EB70 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > > > (defun Info-mouse-follow-nearest-node-new-window (click) > > > "Open the link at the mouse pointer in a new window." > > > (interactive "e") > > > (Info-mouse-follow-nearest-node click t)) ; t no good now > > > > > > But that particular implementation no longer works, because > > > someone over the course of Emacs 22 development removed the > > > optional FORK argument to `Info-follow-nearest-node' and > > > `Info-mouse-follow-nearest-node'. (Why?) > > > > `Info-mouse-follow-nearest-node' never had the FORK argument. > > `Info-follow-nearest-node' still has it, but there were plans to > > remove it. > > You're right, on both counts. I think I left in the above code hoping that > FORK would be added in response to my request for it: 2006-01-08, Subject > "Info-mouse-follow-nearest-node should take prefix arg to fork". I had > forgotten that thread. Richard's response was to wait until after the > release (22). Your response was that FORK was a deprecated feature > (presumably you were referring to the non-mouse command). I was wrong. I had forgotten that I had (trivially) redefined `Info-mouse-follow-nearest-node' to accept the optional FORK arg and pass it to `Info-try-follow-nearest-node'. The reason my code was no longer working was that I had made another, conflicting mouse binding elsewhere - my bad. It works fine now. Attached are patches for info.el and etc/NEWS to add these two commands: * Info-follow-nearest-node-other-window * Info-mouse-follow-nearest-node-other-window It binds the former to `S-RET' and the latter to `S-down-mouse-2'. Change log entry: * info.el (Info-follow-nearest-node) (Info-mouse-follow-nearest-node): New commands, bound to S-RET, S-down-mouse-2. ------=_NextPart_000_0008_01C7FF92.A2B9EB70 Content-Type: application/octet-stream; name="info-2007-09-25.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="info-2007-09-25.patch" *** info-CVS-2007-09-25.el Tue Sep 25 16:07:54 2007=0A= --- info-patched-2007-09-25.el Tue Sep 25 16:14:40 2007=0A= ***************=0A= *** 3079,3094 ****=0A= (t=0A= (error "No %s around position %d" errorstring pos))))))))=0A= =0A= ! (defun Info-mouse-follow-nearest-node (click)=0A= "\\Follow a node reference near point.=0A= ! Like \\[Info-menu], \\[Info-follow-reference], \\[Info-next], = \\[Info-prev] or \\[Info-up] command, depending on where you click.=0A= ! At end of the node's text, moves to the next node, or up if none."=0A= ! (interactive "e")=0A= (mouse-set-point click)=0A= ! (and (not (Info-try-follow-nearest-node))=0A= (save-excursion (forward-line 1) (eobp))=0A= (Info-next-preorder)))=0A= =0A= (defun Info-follow-nearest-node (&optional fork)=0A= "Follow a node reference near point.=0A= If point is on a reference, follow that reference. Otherwise,=0A= --- 3079,3102 ----=0A= (t=0A= (error "No %s around position %d" errorstring pos))))))))=0A= =0A= ! (defun Info-mouse-follow-nearest-node (click &optional fork)=0A= "\\Follow a node reference near point.=0A= ! Like \\[Info-menu], \\[Info-follow-reference], \\[Info-next], = \\[Info-prev] or \\[Info-up] \=0A= ! command, depending on where you click.=0A= ! At end of the node's text, moves to the next node, or up if none.=0A= ! =0A= ! With a prefix argument, open the node in a separate window."=0A= ! (interactive "e\nP")=0A= (mouse-set-point click)=0A= ! (and (not (Info-try-follow-nearest-node fork))=0A= (save-excursion (forward-line 1) (eobp))=0A= (Info-next-preorder)))=0A= =0A= + (defun Info-mouse-follow-nearest-node-new-window (click)=0A= + "Open the link at the mouse pointer in a new window."=0A= + (interactive "e")=0A= + (Info-mouse-follow-nearest-node click t))=0A= + =0A= (defun Info-follow-nearest-node (&optional fork)=0A= "Follow a node reference near point.=0A= If point is on a reference, follow that reference. Otherwise,=0A= ***************=0A= *** 3111,3116 ****=0A= --- 3119,3129 ----=0A= t)))=0A= (error "Point neither on reference nor in menu item = description")))=0A= =0A= + (defun Info-follow-nearest-node-new-window ()=0A= + "Open the link near the text cursor in a new window."=0A= + (interactive)=0A= + (Info-follow-nearest-node t))=0A= + =0A= ;; Common subroutine.=0A= (defun Info-try-follow-nearest-node (&optional fork)=0A= "Follow a node reference near point. Return non-nil if successful.=0A= ***************=0A= *** 3151,3156 ****=0A= --- 3164,3170 ----=0A= (define-key Info-mode-map "." 'beginning-of-buffer)=0A= (define-key Info-mode-map " " 'Info-scroll-up)=0A= (define-key Info-mode-map "\C-m" 'Info-follow-nearest-node)=0A= + (define-key Info-mode-map [S-return] = 'Info-follow-nearest-node-new-window)=0A= (define-key Info-mode-map "\t" 'Info-next-reference)=0A= (define-key Info-mode-map "\e\t" 'Info-prev-reference)=0A= (define-key Info-mode-map [(shift tab)] 'Info-prev-reference)=0A= ***************=0A= *** 3200,3205 ****=0A= --- 3214,3220 ----=0A= (define-key Info-mode-map "," 'Info-index-next)=0A= (define-key Info-mode-map "\177" 'Info-scroll-down)=0A= (define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node)=0A= + (define-key Info-mode-map [S-down-mouse-2] = 'Info-mouse-follow-nearest-node-new-window)=0A= (define-key Info-mode-map [follow-link] 'mouse-face)=0A= )=0A= =0A= =0A= Diff finished. Tue Sep 25 16:17:34 2007=0A= ------=_NextPart_000_0008_01C7FF92.A2B9EB70 Content-Type: application/octet-stream; name="NEWS-23-2007-09-25.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="NEWS-23-2007-09-25.patch" *** NEWS-23-2007-09-25.txt Tue Sep 25 16:30:12 2007=0A= --- NEWS-23-2007-09-25-patched.txt Tue Sep 25 16:35:12 2007=0A= ***************=0A= *** 97,102 ****=0A= --- 97,107 ----=0A= ** The new command `display-time-world' starts an updating time display=0A= using several time zones, in a buffer.=0A= =0A= + ** Info mode has new commands=0A= + Info-follow-nearest-node-other-window and=0A= + Info-mouse-follow-nearest-node-other-window, bound to S-RET and=0A= + S-down-mouse-2, respectively.=0A= + =0C=0A= * Startup Changes in Emacs 23.1=0A= =0A= ** New user option `initial-buffer-choice' specifies what to display=0A= =0A= Diff finished. Tue Sep 25 16:35:43 2007=0A= ------=_NextPart_000_0008_01C7FF92.A2B9EB70 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel ------=_NextPart_000_0008_01C7FF92.A2B9EB70--