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: RE: minor enhancements for links: open Info link in new window; mouse-3 menu for buffers with links Date: Sat, 17 Jun 2006 13:52:43 -0700 Message-ID: References: <17547.32507.113910.797001@rgrjr.dyndns.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1150577603 11091 80.91.229.2 (17 Jun 2006 20:53:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 17 Jun 2006 20:53:23 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 17 22:53:20 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Frhn6-0003Bf-Js for ged-emacs-devel@m.gmane.org; Sat, 17 Jun 2006 22:53:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Frhn6-0005bD-Fp for ged-emacs-devel@m.gmane.org; Sat, 17 Jun 2006 16:53:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Frhmt-0005Z6-Ap for emacs-devel@gnu.org; Sat, 17 Jun 2006 16:52:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Frhmp-0005WN-Gp for emacs-devel@gnu.org; Sat, 17 Jun 2006 16:52:58 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Frhmp-0005WK-DZ for emacs-devel@gnu.org; Sat, 17 Jun 2006 16:52:55 -0400 Original-Received: from [148.87.113.118] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1Frhwk-00043m-5q for emacs-devel@gnu.org; Sat, 17 Jun 2006 17:03:10 -0400 Original-Received: from rgmsgw300.us.oracle.com (rgmsgw300.us.oracle.com [138.1.186.49]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id k5HKqqRT020533 for ; Sat, 17 Jun 2006 14:52:52 -0600 Original-Received: from dradamslap (dhcp-amer-csvpn-gw1-141-144-65-77.vpn.oracle.com [141.144.65.77]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id k5HKqpxN028475 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Sat, 17 Jun 2006 14:52:52 -0600 Original-To: "Emacs-Devel" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <17547.32507.113910.797001@rgrjr.dyndns.org> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE 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:55967 Archived-At: 1. Define commands `Info-follow-nearest-node-new-window' and `Info-mouse-follow-nearest-node-new-window'. These just follow a link in a new Info window (clone). I bind these to `S-RET' and `S-mouse-2'. Both are handy. 2. These could be generalized to follow any link whose destination Emacs understood (e.g. URL). In buffers with links, the same key bindings (`S-RET', `S-mouse-2') might be appropriate. Is there such a generic follow-link command already (one for RET at point and one for mouse click)? Wouldn't that be useful? In Info, it would follow an Info link. It would recognize a URL and follow that. And so on, recognizing as many types of links as possible, depending, for instance, on the buffer mode. Sounds more or less like find-file-at-point to me. Well, it's true that ffap does try to do something similar, but I find ffap intrusive and not very useful. I was thinking more along the lines of something that recognizes (only) well-defined Emacs links. Ffap doesn't even recognize Info links, AFAICT, and it tries to interpret string of text as a link. Not what I had in mind. There is no single way to specify that some text in Emacs represents a link, but there are some almost conventional ways - e.g. `follow-link' text property or event binding. These could perhaps be exploited for such a feature. Some of the existing ffap code might then be reused (adapted) to figure out how to follow a given kind of link. Another possibility would be to use the `follow-link' property (or another) to specify the link-following method to use. The particular non-nil value of `follow-link' might indicate whether the link was Info, a URL, a file, or whatever. The value could be a link-handler function, for instance, or a link-type argument for a general link handler. That would eliminate most of the ffap-like guesswork. When a programmer creates a well-defined link in Emacs s?he knows what kind of link it is. In sum, instead of the ffap approach of guessing all the time what any arbitrary section of text could potentially "link" to, rely upon well-defined link areas, with well-defined link-interpretation handlers. 3. In buffers that have links, provide a mouse-3 context menu for a link. Any interest in such enhancements for after the release? #1 is trivial. Together, 1-3 give you what you already have in most Web browsers: use Shift to open a link in a new window, and use mouse-3 for a link context menu. [I mention `follow-link' only because it provides a way to tell that some linked text (but not all) is a link. IIUC, `follow-link' is really intended to specify that mouse-1 can act like mouse-2 for the text in question. AFAIK, there is no conventional way to define a link for, say, just `mouse-2'. That's too bad, I think. It would be good to make it easy to identify 1) that any given string of text is a link and 2) what kind of link it is - how to follow it. The question of how to activate the link (mouse-1, mouse-2) is orthogonal to this.]