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

> Tramp has this function:
>
> (defun tramp-match-string-list (&optional string)
>   "Returns list of all match strings.
> That is, (list (match-string 0) (match-string 1) ...), according to the
> number of matches."
>   (let* ((nmatches (/ (length (match-data)) 2))
>          (i (- nmatches 1))
>          (res nil))
>     (while (>= i 0)
>       (setq res (cons (match-string i string) res))
>       (setq i (- i 1)))
>     res))
>
>
> It is used in function tramp-wait-for-regexp only, and all uses of
> that function only tests whether the return value is nil or non-nil.
>
> So the above code seems like vast overkill to me :-)

In addition, (/ (length (match-data)) 2) creates a whole slew of
markers that slow down editing operations until the next garbage
collection.  You should rather use
(/ (length (match-data t)) 2)
if you really must.

-- 
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