# HG changeset patch # User HIROSE Yuuji # Date 1663813221 -32400 # Node ID 44c9b313c68deb4e2787c08310f2fda44d33a65c # Parent c6a26b422d3065d59dcef86a4db99cbad0f64bb0 YaTeX-match-string can take third argument for source string. diff -r c6a26b422d30 -r 44c9b313c68d yatexlib.el --- 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 ()