comparison lisp/emacs-lisp/sregex.el @ 22974:6e0af7097929

(sregex-replace-match): Don't call sregex--value-groups. (sregex-match-end, sregex-match-beginning): Likewise. (sregex-match-string-no-properties, sregex-match-string): Likewise.
author Richard M. Stallman <rms@gnu.org>
date Mon, 10 Aug 1998 02:12:04 +0000
parents 7947a4ea28a8
children cb028b1d6345
comparison
equal deleted inserted replaced
22973:c3bbca1b6f3a 22974:6e0af7097929
331 can be obtained with `sregex-info'. The SUBEXP argument is adjusted 331 can be obtained with `sregex-info'. The SUBEXP argument is adjusted
332 to allow for \"introduced groups\". If the extra argument is omitted 332 to allow for \"introduced groups\". If the extra argument is omitted
333 or nil, it defaults to the current value of (sregex-info)." 333 or nil, it defaults to the current value of (sregex-info)."
334 (replace-match replacement fixedcase literal string 334 (replace-match replacement fixedcase literal string
335 (and subexp 335 (and subexp
336 (sregex-backref-num 336 (sregex-backref-num subexp sregex))))
337 subexp
338 (sregex--value-groups (or sregex
339 sregex--current-sregex))))))
340 337
341 (defun sregex-match-string (count &optional in-string sregex) 338 (defun sregex-match-string (count &optional in-string sregex)
342 "Like `match-string', for a regexp made with `sregex'. 339 "Like `match-string', for a regexp made with `sregex'.
343 This takes one additional optional argument, the `sregex' info, which 340 This takes one additional optional argument, the `sregex' info, which
344 can be obtained with `sregex-info'. The COUNT argument is adjusted to 341 can be obtained with `sregex-info'. The COUNT argument is adjusted to
345 allow for \"introduced groups\". If the extra argument is omitted or 342 allow for \"introduced groups\". If the extra argument is omitted or
346 nil, it defaults to the current value of (sregex-info)." 343 nil, it defaults to the current value of (sregex-info)."
347 (match-string (and count 344 (match-string (and count
348 (sregex-backref-num 345 (sregex-backref-num count sregex))
349 count
350 (sregex--value-groups (or sregex
351 sregex--current-sregex))))
352 in-string)) 346 in-string))
353 347
354 (defun sregex-match-string-no-properties (count &optional in-string sregex) 348 (defun sregex-match-string-no-properties (count &optional in-string sregex)
355 "Like `match-string-no-properties', for a regexp made with `sregex'. 349 "Like `match-string-no-properties', for a regexp made with `sregex'.
356 This takes one additional optional argument, the `sregex' info, which 350 This takes one additional optional argument, the `sregex' info, which
357 can be obtained with `sregex-info'. The COUNT argument is adjusted to 351 can be obtained with `sregex-info'. The COUNT argument is adjusted to
358 allow for \"introduced groups\". If the extra argument is omitted or 352 allow for \"introduced groups\". If the extra argument is omitted or
359 nil, it defaults to the current value of (sregex-info)." 353 nil, it defaults to the current value of (sregex-info)."
360 (match-string-no-properties 354 (match-string-no-properties
361 (and count 355 (and count
362 (sregex-backref-num 356 (sregex-backref-num count sregex))
363 count
364 (sregex--value-groups (or sregex
365 sregex--current-sregex))))
366 in-string)) 357 in-string))
367 358
368 (defun sregex-match-beginning (count &optional sregex) 359 (defun sregex-match-beginning (count &optional sregex)
369 "Like `match-beginning', for a regexp made with `sregex'. 360 "Like `match-beginning', for a regexp made with `sregex'.
370 This takes one additional optional argument, the `sregex' info, which 361 This takes one additional optional argument, the `sregex' info, which
371 can be obtained with `sregex-info'. The COUNT argument is adjusted to 362 can be obtained with `sregex-info'. The COUNT argument is adjusted to
372 allow for \"introduced groups\". If the extra argument is omitted or 363 allow for \"introduced groups\". If the extra argument is omitted or
373 nil, it defaults to the current value of (sregex-info)." 364 nil, it defaults to the current value of (sregex-info)."
374 (match-beginning (sregex-backref-num 365 (match-beginning (sregex-backref-num count sregex)))
375 count
376 (sregex--value-groups (or sregex
377 sregex--current-sregex)))))
378 366
379 (defun sregex-match-end (count &optional sregex) 367 (defun sregex-match-end (count &optional sregex)
380 "Like `match-end', for a regexp made with `sregex'. 368 "Like `match-end', for a regexp made with `sregex'.
381 This takes one additional optional argument, the `sregex' info, which 369 This takes one additional optional argument, the `sregex' info, which
382 can be obtained with `sregex-info'. The COUNT argument is adjusted to 370 can be obtained with `sregex-info'. The COUNT argument is adjusted to
383 allow for \"introduced groups\". If the extra argument is omitted or 371 allow for \"introduced groups\". If the extra argument is omitted or
384 nil, it defaults to the current value of (sregex-info)." 372 nil, it defaults to the current value of (sregex-info)."
385 (match-end (sregex-backref-num 373 (match-end (sregex-backref-num count sregex)))
386 count
387 (sregex--value-groups (or sregex
388 sregex--current-sregex)))))
389 374
390 (defun sregex-match-data (&optional sregex) 375 (defun sregex-match-data (&optional sregex)
391 "Like `match-data', for a regexp made with `sregex'. 376 "Like `match-data', for a regexp made with `sregex'.
392 This takes one additional optional argument, the `sregex' info, which 377 This takes one additional optional argument, the `sregex' info, which
393 can be obtained with `sregex-info'. \"Introduced groups\" are removed 378 can be obtained with `sregex-info'. \"Introduced groups\" are removed