yatex

changeset 588:44c9b313c68d

YaTeX-match-string can take third argument for source string.
author HIROSE Yuuji <yuuji@gentei.org>
date Thu, 22 Sep 2022 11:20:21 +0900
parents c6a26b422d30
children 921d58902dca
files yatexlib.el
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line diff
     1.1 --- a/yatexlib.el	Wed Sep 21 21:34:29 2022 +0900
     1.2 +++ b/yatexlib.el	Thu Sep 22 11:20:21 2022 +0900
     1.3 @@ -1,7 +1,7 @@
     1.4  ;;; yatexlib.el --- YaTeX and yahtml common libraries -*- coding: sjis -*-
     1.5  ;;; 
     1.6  ;;; (c)1994-2019 by HIROSE Yuuji.[yuuji@yatex.org]
     1.7 -;;; Last modified Thu Dec 26 12:47:45 2019 on firestorm
     1.8 +;;; Last modified Thu Sep 22 11:17:54 2022 on firestorm
     1.9  ;;; $Id$
    1.10  
    1.11  ;;; Code:
    1.12 @@ -627,11 +627,13 @@
    1.13       (where-is-internal olddef keymap))))
    1.14  
    1.15  ;;;###autoload
    1.16 -(defun YaTeX-match-string (n &optional m)
    1.17 -  "Return (buffer-substring (match-beginning n) (match-beginning m))."
    1.18 +(defun YaTeX-match-string (n &optional m str)
    1.19 +  "Return (buffer-substring (match-beginning n) (match-beginning m)).
    1.20 +Optional third argument STR gives substring from string STR."
    1.21    (if (match-beginning n)
    1.22 -      (YaTeX-buffer-substring (match-beginning n)
    1.23 -			(match-end (or m n)))))
    1.24 +      (if str (substring str n (or m n))
    1.25 +	(YaTeX-buffer-substring (match-beginning n)
    1.26 +				(match-end (or m n))))))
    1.27  
    1.28  ;;;###autoload
    1.29  (defun YaTeX-minibuffer-complete ()