[EMAIL PROTECTED] (Kim F. Storm) writes:

> I noticed the following code in reftex-index.el:
>
>                     (condition-case nil (texmathp) (error nil))))
>             (setq beg (car (match-data))
>                   end (nth 1 (match-data)))
>
> Using match-data like that seems inefficient.
>
> I suggtest using match-beginning/match-end instead.

That is not the same: the above will set beg and end to markers,
whereas match-beginning/match-end happen to be integers.  However, the
above will also create markers that are unused, so it would be saner
to call (match-data) only once _if_ indeed markers are what is
required.

Unused markers slow done editing operations afterwards.  So even if
markers _are_ what is wanted for some reason, they should be
explicitly unseated with set-marker once they are no longer needed.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to