all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nikolaj Schumacher <n_schumacher@web.de>
To: Nordlöw <per.nordlow@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Fancy C/C++ Code Coloring: Useable but too slow for large buffers. Wanted: Optimization!
Date: Mon, 17 Mar 2008 18:09:45 +0100	[thread overview]
Message-ID: <m2d4pt8eg6.fsf@nschum.de> (raw)
In-Reply-To: <c8651a72-9a3f-435a-9e4c-1b95922e66dc@i29g2000prf.googlegroups.com> ("Nordlöw"'s message of "Mon\, 17 Mar 2008 05\:43\:00 -0700 \(PDT\)")

Nordlöw <per.nordlow@gmail.com> wrote:

> (defun regexp-quote-alt-list (list)
>   "Return a regexp string which exactly matches any of the
> elements (alternatives) in the LIST of strings."
>   (interactive)
>   (mapconcat 'regexp-quote list "\\|"))

I didn't read much further, but you should use `regexp-opt' instead.
It's a pretty smart function.

Using your own example:

(regexp-quote-alt-list '("*a" "*b" "*c"))
-> "\\*a\\|\\*b\\|\\*c"

(regexp-opt '("*a" "*b" "*c"))
-> "\\*[abc]"



regards,
Nikolaj Schumacher




      parent reply	other threads:[~2008-03-17 17:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-17 12:43 Fancy C/C++ Code Coloring: Useable but too slow for large buffers. Wanted: Optimization! Nordlöw
2008-03-17 13:59 ` Jake Colman
2008-03-17 17:09 ` Nikolaj Schumacher [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2d4pt8eg6.fsf@nschum.de \
    --to=n_schumacher@web.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=per.nordlow@gmail.com \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.