From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bastien Guerry Newsgroups: gmane.emacs.help Subject: Re: thingatpt Date: Fri, 29 Feb 2008 03:29:23 +0000 Message-ID: <87zltkbfu4.fsf@bzg.ath.cx> References: <200802290200.m1T20AkT018010@localhost.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1204255841 12251 80.91.229.12 (29 Feb 2008 03:30:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Feb 2008 03:30:41 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Xavier Maillard Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 29 04:30:58 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 1JUvxZ-0000FY-7R for geh-help-gnu-emacs@m.gmane.org; Fri, 29 Feb 2008 04:30:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUvx2-0007HL-SK for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Feb 2008 22:30:24 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JUvw6-0006se-1y for help-gnu-emacs@gnu.org; Thu, 28 Feb 2008 22:29:26 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JUvw4-0006rg-Dk for help-gnu-emacs@gnu.org; Thu, 28 Feb 2008 22:29:25 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUvw4-0006ra-87 for help-gnu-emacs@gnu.org; Thu, 28 Feb 2008 22:29:24 -0500 Original-Received: from ug-out-1314.google.com ([66.249.92.171]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JUvw3-0003T2-Uo for help-gnu-emacs@gnu.org; Thu, 28 Feb 2008 22:29:24 -0500 Original-Received: by ug-out-1314.google.com with SMTP id a2so87309ugf.48 for ; Thu, 28 Feb 2008 19:29:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:received:from:to:cc:subject:in-reply-to:references:user-agent:date:message-id:mime-version:content-type:sender; bh=niQyS2XDC9zstvEiFfmlMUbMKfi1DFgd9yNVdX3KcAo=; b=rbqOFtGhyUypenZwcvIdMcmQ+1WhmkdcYJNfJve5qBjufhd/y1EUaARyc3OK0r76TfeBV7FS3YtXO5JWHiFCDWH7EEdRhpB22Vx1GK3rFT0Ha1jh2tb1PmrUVNfmOGgF92nvNplTUsl9o8ensPmkjT+qAf+yGqjc18t714lP7uc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date:message-id:mime-version:content-type:sender; b=mCDVyDbNLE51XX7/Z8sOZ91bff79tceWnbJhFzN55MBGtXUMohaXDugLwirxwrdXs6NqgpOTEkPe3crf6IPwO7GbmFk4pQ8RQJJhOKuIdHlldCI91AjJnMODB6+cra8KNLeVRkpH4uT2XDdN2dhtX1BPZrIxhHxpdgwFYSw9g8E= Original-Received: by 10.67.121.2 with SMTP id y2mr340486ugm.78.1204255763063; Thu, 28 Feb 2008 19:29:23 -0800 (PST) Original-Received: from bzg.ath.cx ( [81.99.213.34]) by mx.google.com with ESMTPS id c22sm16378926ika.3.2008.02.28.19.29.21 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Feb 2008 19:29:22 -0800 (PST) Original-Received: by bzg.ath.cx (Postfix, from userid 1000) id 2436B1575BD; Fri, 29 Feb 2008 03:29:22 +0000 (GMT) In-Reply-To: <200802290200.m1T20AkT018010@localhost.localdomain> (Xavier Maillard's message of "Fri, 29 Feb 2008 03:00:10 +0100") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:51962 Archived-At: Xavier Maillard writes: > I am trying to find out how to extend thing at point for a > personnal need. I'm not sure you need thingatpt. > 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 ? I would use something like this: (defvar my-mouse-map (make-sparse-keymap)) (define-key my-mouse-map [(tab)] 'my-goto-next-active-string) (defun my-goto-next-active-string () (interactive) (let ((pos (point))) (re-search-forward "\\<[0-9]\\{10\\}\\>" nil t) (if (and (eq (match-beginning 0) pos) (re-search-forward "\\<[0-9]\\{10\\}\\>" nil t)) (goto-char (match-beginning 0)) (goto-char pos)))) (defun my-make-active-strings () (interactive) (save-excursion (goto-char (point-min)) (while (re-search-forward "\\<[0-9]\\{10\\}\\>" nil t) (add-text-properties (match-beginning 0) (match-end 0) (list 'mouse-face 'highlight 'rear-nonsticky t 'keymap my-mouse-map))))) You can also use `next-single-property-change' instead of the regexp in my-goto-next-active-string. Hope this gives you directions. -- Bastien