emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: find-file-noselect needs save-match-data


From: Richard Stallman
Subject: Re: find-file-noselect needs save-match-data
Date: Thu, 14 Jun 2007 12:19:43 -0400

    >     Anyway, such a function should likely _return_ the corresponding
    >     match-data (rather than setting a global variable to it), and things
    >     like match-beginning should optionally take an argument for this
    >     particular match-data.

    Then what's the advantage compared to using save-match-data?

This function would be simpler, and probably noticeably faster, than

    (save-match-data
       (string-match X Y)
       (match-data))

You have a valid point that this function would be somewhat
slower than a similar function which returned only the position
of the start of the match.  I am not sure whether this speed
difference is significant.  Would someone like to try
implementing those two functions, and see how they compare
in speed to the expression above?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]