changeset 588:44c9b313c68d draft

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 wrap: on
line diff
--- a/yatexlib.el	Wed Sep 21 21:34:29 2022 +0900
+++ b/yatexlib.el	Thu Sep 22 11:20:21 2022 +0900
@@ -1,7 +1,7 @@
 ;;; yatexlib.el --- YaTeX and yahtml common libraries -*- coding: sjis -*-
 ;;; 
 ;;; (c)1994-2019 by HIROSE Yuuji.[yuuji@yatex.org]
-;;; Last modified Thu Dec 26 12:47:45 2019 on firestorm
+;;; Last modified Thu Sep 22 11:17:54 2022 on firestorm
 ;;; $Id$
 
 ;;; Code:
@@ -627,11 +627,13 @@
      (where-is-internal olddef keymap))))
 
 ;;;###autoload
-(defun YaTeX-match-string (n &optional m)
-  "Return (buffer-substring (match-beginning n) (match-beginning m))."
+(defun YaTeX-match-string (n &optional m str)
+  "Return (buffer-substring (match-beginning n) (match-beginning m)).
+Optional third argument STR gives substring from string STR."
   (if (match-beginning n)
-      (YaTeX-buffer-substring (match-beginning n)
-			(match-end (or m n)))))
+      (if str (substring str n (or m n))
+	(YaTeX-buffer-substring (match-beginning n)
+				(match-end (or m n))))))
 
 ;;;###autoload
 (defun YaTeX-minibuffer-complete ()

yatex.org