From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: Seweryn Kokot <s.kokot@po.opole.pl>
Cc: help-gnu-emacs@gnu.org
Subject: Re: what can I do with regexp match?
Date: Mon, 14 May 2007 19:14:59 +0200 [thread overview]
Message-ID: <46489913.6070708@gmail.com> (raw)
In-Reply-To: <87irav9vvr.fsf@poczta.po.opole.pl>
Seweryn Kokot wrote:
> "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:
>
>>> Now my function is:
>>> (defun my-document-files ()
>>> "Open all document files"
>>> (interactive)
>>> (while (re-search-forward "\\\\include{\\(.*\\)}")
>>> (find-file (concat "~/" (match-string 1) ".tex"))))
>>>
>>> why it failed although I have much more occurences of \include{...} in
>>> the main.tex file? Any idea?
>> Read the documentation for find-file.
> Ok I see the problem I wonder if it would be better first to read a
> buffer to a variable, then to search regexp, then assign matches to a
> list and finally visit files from the list using dolist? But the problem
> is how to create a list from regexp matches?
It does not really matter if you use find-file-noselect or create a list
for this particular problem. The most easy way to build a list is
perhaps this:
(add-to-list 'my-list (match-string 1))
next prev parent reply other threads:[~2007-05-14 17:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-14 12:36 what can I do with regexp match? Seweryn Kokot
2007-05-14 12:42 ` Lennart Borgman (gmail)
2007-05-14 13:17 ` Seweryn Kokot
2007-05-14 15:09 ` Lennart Borgman (gmail)
2007-05-14 17:07 ` Seweryn Kokot
2007-05-14 17:14 ` Lennart Borgman (gmail) [this message]
2007-05-14 17:46 ` Seweryn Kokot
2007-05-14 15:36 ` Michaël Cadilhac
[not found] ` <mailman.649.1179157491.32220.help-gnu-emacs@gnu.org>
2007-06-09 22:01 ` Stefan Monnier
[not found] <mailman.635.1179146680.32220.help-gnu-emacs@gnu.org>
2007-05-14 17:38 ` David Kastrup
2007-05-14 20:17 ` Seweryn Kokot
2007-05-14 20:33 ` Lennart Borgman (gmail)
2007-05-14 19:01 ` Ralf Angeli
2007-05-14 20:06 ` Seweryn Kokot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46489913.6070708@gmail.com \
--to=lennart.borgman@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=s.kokot@po.opole.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).