unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: David Hansen <david.hansen@gmx.net>
To: help-gnu-emacs@gnu.org
Subject: Re: set-match-data needs match-data
Date: Tue, 17 Jul 2007 02:32:16 +0200	[thread overview]
Message-ID: <87bqeb7tv3.fsf@localhorst.mine.nu> (raw)
In-Reply-To: 1184614733.340103.3340@o61g2000hsh.googlegroups.com

On Mon, 16 Jul 2007 12:38:53 -0700 <spamfilteraccount@gmail.com> wrote:

> In this font lock function the match data is set properly only if
> (match-data) is called afterwards. Anyone knows why calling match-data
> after set-match-data is necessary here? Emacs 22.
>
>
> (defun ipa-font-lock-pos-info (limit)
>   (re-search-forward "^(")
>   (beginning-of-line)
>   (let ((sexp-start (point-marker))
>         sexp-end colon-end)
>     (forward-sexp)
>     (setq sexp-end (point-marker))
>     (forward-char)
>     (setq colon-end (point-marker))
>     (set-match-data (list sexp-start ;; whole
>                           colon-end
>                           sexp-start ;; sexp
>                           sexp-end
>                           sexp-end ;; colon
>                           colon-end)))
>   (match-data))

Returning non nil should be sufficient but this function looks flawed to
my in another way.  Try

(when (re-search-forward "^(" limit t)
  ;; ...
  t)

David

  reply	other threads:[~2007-07-17  0:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-16 19:38 set-match-data needs match-data spamfilteraccount
2007-07-17  0:32 ` David Hansen [this message]
     [not found] ` <mailman.3540.1184632703.32220.help-gnu-emacs@gnu.org>
2007-07-17  6:57   ` spamfilteraccount

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=87bqeb7tv3.fsf@localhorst.mine.nu \
    --to=david.hansen@gmx.net \
    --cc=help-gnu-emacs@gnu.org \
    /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).