From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.devel Subject: Re: ffap -vs- RFCs Date: Tue, 22 Jan 2008 08:00:49 +1100 Message-ID: <87hch6dhby.fsf@blah.blah> References: <2qodbju1ql.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1200949340 28750 80.91.229.12 (21 Jan 2008 21:02:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 21 Jan 2008 21:02:20 +0000 (UTC) Cc: Tom Tromey To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 21 22:02:39 2008 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 1JH3mw-0001Ys-Tu for ged-emacs-devel@m.gmane.org; Mon, 21 Jan 2008 22:02:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JH3mX-0005wy-4t for ged-emacs-devel@m.gmane.org; Mon, 21 Jan 2008 16:02:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JH3lS-0005I1-Jl for emacs-devel@gnu.org; Mon, 21 Jan 2008 16:01:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JH3lQ-0005GO-An for emacs-devel@gnu.org; Mon, 21 Jan 2008 16:01:05 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JH3lQ-0005GF-4H for emacs-devel@gnu.org; Mon, 21 Jan 2008 16:01:04 -0500 Original-Received: from mailout1-2.pacific.net.au ([61.8.2.209] helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JH3lP-0003iK-3N for emacs-devel@gnu.org; Mon, 21 Jan 2008 16:01:03 -0500 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout1.pacific.net.au (Postfix) with ESMTP id 503623502BD; Tue, 22 Jan 2008 08:00:54 +1100 (EST) Original-Received: from blah.blah (ppp28A2.dyn.pacific.net.au [61.8.40.162]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 10A8E8C10; Tue, 22 Jan 2008 08:00:53 +1100 (EST) Original-Received: from gg by blah.blah with local (Exim 4.68) (envelope-from ) id 1JH3lB-0001p2-No; Tue, 22 Jan 2008 08:00:49 +1100 In-Reply-To: <2qodbju1ql.fsf@fencepost.gnu.org> (Glenn Morris's message of "Fri, 18 Jan 2008 00:44:18 -0500") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:87250 Archived-At: Glenn Morris writes: > > I think it's hard to get ffap to handle things with spaces, so I just > removed the space from the RFC regexp. I struck this too and massaged ffap-string-at-point to take a space. Operative part below, whole thing at http://www.geocities.com/user42_kevin/ffap/index.html#ffap-rfc-space If the space in the alist regexp is not actively harmful perhaps it could be left in. For this and a couple of other ffap bits I thought it might be nice to have ffap test some thing-at-point types as a way of extending what it can recognise at point. But I never got to any actual code -- it'd probably for instance want to tie in to ffap-alist so some "things" could be mode-specific, then there'd be a matter of how to make it work with ffap-next. (put 'rfc 'bounds-of-thing-at-point (lambda () ;; this regexp is the same as in `ffap-alist' (and (thing-at-point-looking-at "[Rr][Ff][Cc][- #]?\\([0-9]+\\)") (cons (match-beginning 0) (match-end 0))))) (defadvice ffap-string-at-point (around ffap-rfc-space activate) "Recognise RFCs with a space, like \"RFC 1234\"." (or (let ((bounds (bounds-of-thing-at-point 'rfc))) (and bounds (setq ffap-string-at-point-region (list (car bounds) (cdr bounds))) (setq ad-return-value (buffer-substring (car bounds) (cdr bounds))))) ad-do-it))