From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.help Subject: Re: what can I do with regexp match? Date: Mon, 14 May 2007 14:42:10 +0200 Message-ID: <46485922.1010608@gmail.com> References: <87ps53zin6.fsf@poczta.po.opole.pl> 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: sea.gmane.org 1179146581 21677 80.91.229.12 (14 May 2007 12:43:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 14 May 2007 12:43:01 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Seweryn Kokot Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 14 14:42:57 2007 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 1HnZtA-0002p8-U8 for geh-help-gnu-emacs@m.gmane.org; Mon, 14 May 2007 14:42:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hna0v-0000N7-Gk for geh-help-gnu-emacs@m.gmane.org; Mon, 14 May 2007 08:50:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hna0g-0000KX-7U for help-gnu-emacs@gnu.org; Mon, 14 May 2007 08:50:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hna0e-0000Hv-22 for help-gnu-emacs@gnu.org; Mon, 14 May 2007 08:50:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hna0e-0000Hr-0F for help-gnu-emacs@gnu.org; Mon, 14 May 2007 08:50:40 -0400 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HnZss-0005Db-6u for help-gnu-emacs@gnu.org; Mon, 14 May 2007 08:42:38 -0400 Original-Received: from c83-254-145-24.bredband.comhem.se ([83.254.145.24]:64151 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.66) (envelope-from ) id 1HnZsn-0002zt-6O; Mon, 14 May 2007 14:42:34 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 Mnenhy/0.7.5.666 In-Reply-To: <87ps53zin6.fsf@poczta.po.opole.pl> X-Antivirus: avast! (VPS 000740-0, 2007-05-13), Outbound message X-Antivirus-Status: Clean X-Scan-Result: No virus found in message 1HnZsn-0002zt-6O. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1HnZsn-0002zt-6O c7f7bdb025c0026ec3912bc17d8584c8 X-detected-kernel: Linux 2.6? (barebone, rare!) 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:43955 Archived-At: Seweryn Kokot wrote: > Hello, > > I would like to have a function that visits all the tex files included > in main.tex file. I wrote the following function: > (defun my-document-files () > "Open all document files" > (interactive) > (while (re-search-forward "\\\\include{\\(.*\\)}") > (find-file (concat "~/nauka/doktorat/thesis/" "\\1" ".tex")))) > > But it doesn't work since \\1 is not replaced by regexp match. The > result is that the function visits \1.tex file. The question is how to > process the regexp match to make it argument for find-file or more > general question how to save the match in a variable or list? (match-string 1) ;; At least in Emacs 22