From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vinicius Jose Latorre Newsgroups: gmane.emacs.devel Subject: Re: Possible problem with looking-back function Date: Fri, 20 Aug 2010 21:08:34 -0300 Message-ID: <4C6F1902.70701@ig.com.br> References: <4C6C85AD.1010500@ig.com.br> <49933.130.55.132.107.1282185810.squirrel@webmail.lanl.gov> <4C6DE451.5080706@ig.com.br> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1282349166 31184 80.91.229.12 (21 Aug 2010 00:06:06 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 21 Aug 2010 00:06:06 +0000 (UTC) Cc: GNU Emacs To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 21 02:06:04 2010 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.69) (envelope-from ) id 1Ombb0-00055m-I7 for ged-emacs-devel@m.gmane.org; Sat, 21 Aug 2010 02:06:02 +0200 Original-Received: from localhost ([127.0.0.1]:50919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ombaz-0001y3-Cg for ged-emacs-devel@m.gmane.org; Fri, 20 Aug 2010 20:06:01 -0400 Original-Received: from [140.186.70.92] (port=34074 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ombat-0001xF-Bs for emacs-devel@gnu.org; Fri, 20 Aug 2010 20:05:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ombar-00049Z-Ur for emacs-devel@gnu.org; Fri, 20 Aug 2010 20:05:55 -0400 Original-Received: from mail-yx0-f169.google.com ([209.85.213.169]:60570) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ombar-00049U-Ry for emacs-devel@gnu.org; Fri, 20 Aug 2010 20:05:53 -0400 Original-Received: by yxs7 with SMTP id 7so1771709yxs.0 for ; Fri, 20 Aug 2010 17:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=yZE5mprlXHyDBLl+CpF/iO6Rf0ss8xdnZ0gO3ykmjXU=; b=K7O8WgUPSDfp2rCeJSP6V1DeYMeiLq1WPZEL7jB0hMX8vkZ6hcSTLnn/e/0OPHWg5s dmYTtkD00TNuc9RaHfNVgDRkI9dk5nmegF2MuuSjQQuYQ4cAm1VA51voxJ8HqEmdft2b hyI1eZAlmi6IlinZx9SKCB4r5szkeLdGkzSjU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=iluHjnns+os4zWxOFOoMLiC5MSYwIMAGIefRBAidk6cfijSvibsveQJgERdwnJyEfG VQV4xh5XBEfjbxc2ZfRaWoI1E9vFcs+O+CPXBsE4LAbpGGLihX0AbZamIatosf84cWcV ykN6kD4DMfHSmC0+UGL78AeCxO5ugSeoKFtKQ= Original-Received: by 10.100.95.6 with SMTP id s6mr2394596anb.200.1282349135561; Fri, 20 Aug 2010 17:05:35 -0700 (PDT) Original-Received: from [192.168.0.101] ([187.106.50.189]) by mx.google.com with ESMTPS id a12sm5364057and.36.2010.08.20.17.05.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 20 Aug 2010 17:05:33 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:128940 Archived-At: > Or you can still use a regexp, with something like > > (defun other-looking-back (re limit) > (save-restriction > (narrow-to-region (point-min) (point)) > (goto-char limit) > (re-search-forward (concat "\\(?:" re "\\)\\'") nil t))) > > Note that it imposes a few different constraints on the regexp, mostly > it can't use things like \> or \< or \b at the end because > narrow-to-region will prevent it from peeking at the next char. > Ok, thanks all for helping.