From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: thingatpt Date: Thu, 28 Feb 2008 19:57:24 -0800 Message-ID: <001801c87a87$31891460$0600a8c0@us.oracle.com> References: <200802290200.m1T20AkT018010@localhost.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1204257548 15953 80.91.229.12 (29 Feb 2008 03:59:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Feb 2008 03:59:08 +0000 (UTC) To: "'Xavier Maillard'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 29 04:59:31 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JUwPA-00076F-9O for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Feb 2008 04:59:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUwOd-0007Ca-SF for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Feb 2008 22:58:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JUwON-0007AQ-5p for help-gnu-emacs@gnu.org; Thu, 28 Feb 2008 22:58:39 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JUwOL-00078g-HK for help-gnu-emacs@gnu.org; Thu, 28 Feb 2008 22:58:38 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUwOL-00078d-FX for help-gnu-emacs@gnu.org; Thu, 28 Feb 2008 22:58:37 -0500 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JUwOH-0001fe-DI; Thu, 28 Feb 2008 22:58:33 -0500 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m1T3wNfi027836; Thu, 28 Feb 2008 21:58:23 -0600 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m1R83Gjb004174; Thu, 28 Feb 2008 20:58:23 -0700 Original-Received: from inet-141-146-46-1.oracle.com by acsmt350.oracle.com with ESMTP id 3594897281204257450; Thu, 28 Feb 2008 19:57:30 -0800 Original-Received: from dradamslap1 (/141.144.80.6) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 28 Feb 2008 19:57:30 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <200802290200.m1T20AkT018010@localhost.localdomain> Thread-Index: Ach6e8S3meVpHceIRiiVdHkGL4HpWAACKHjw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:51963 Archived-At: > I am trying to find out how to extend thing at point for a > personnal need. > > I have several items that are composed of a series of numbers (10 > to be precise), these items represents transaction's IDs. I want > GNU Emacs to recognise them as this so that I can do specialised > actions on them. All is ready *but* I do not know how to define a > "thing" with thingatpt.el. > > On the same topic, I can have several transaction IDs on the same > line, for exmple: > > 1234567890 0123456789 etc. > > I'd like to be able to navigate to the next/previous item using > the TAB key, how would you do that ? A basic idea of thingatpt is that you can just define a function that moves forward across your thing. If you call your thing, say, transids, then you would define a function `forward-transids'. That's all. You can alternatively put one or more of these properties on a symbol that names your thing, `transids': beginning-op, end-op, bounds-of-thing-at-point, thing-at-point. The property values are functions that determine the beginning, end, beginning and end of such a thing, or the entire thing itself. thingatpt.el has several examples of defining types of things: url (via properties end-op, beginning-op, thing-at-point, and bounds-of-thing-at-point), whitespace (via function forward-whitespace), buffer (via properties end-op and beginning-op), symbol (via function forward-symbol), and so on. You can also use the function thing-at-point to define things. See the examples of word-at-point and sentence-at-point. You can, similarly, use function form-at-point to do the same thing - see examples number-at-point and list-at-point. Library thingatpt+.el has additional examples of defining things: http://www.emacswiki.org/cgi-bin/wiki/thingatpt%2b.el http://www.emacswiki.org/cgi-bin/wiki/ThingAtPointPlus For more info (start here): http://www.emacswiki.org/cgi-bin/wiki/ThingAtPoint HTH.