comparison yatexlib.el @ 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 4dad5f91b26c
children 7810c4ec21fe
comparison
equal deleted inserted replaced
587:c6a26b422d30 588:44c9b313c68d
1 ;;; yatexlib.el --- YaTeX and yahtml common libraries -*- coding: sjis -*- 1 ;;; yatexlib.el --- YaTeX and yahtml common libraries -*- coding: sjis -*-
2 ;;; 2 ;;;
3 ;;; (c)1994-2019 by HIROSE Yuuji.[yuuji@yatex.org] 3 ;;; (c)1994-2019 by HIROSE Yuuji.[yuuji@yatex.org]
4 ;;; Last modified Thu Dec 26 12:47:45 2019 on firestorm 4 ;;; Last modified Thu Sep 22 11:17:54 2022 on firestorm
5 ;;; $Id$ 5 ;;; $Id$
6 6
7 ;;; Code: 7 ;;; Code:
8 8
9 ;; High-precedence compatible function 9 ;; High-precedence compatible function
625 (mapcar 625 (mapcar
626 (function (lambda (key) (define-key keymap key newdef))) 626 (function (lambda (key) (define-key keymap key newdef)))
627 (where-is-internal olddef keymap)))) 627 (where-is-internal olddef keymap))))
628 628
629 ;;;###autoload 629 ;;;###autoload
630 (defun YaTeX-match-string (n &optional m) 630 (defun YaTeX-match-string (n &optional m str)
631 "Return (buffer-substring (match-beginning n) (match-beginning m))." 631 "Return (buffer-substring (match-beginning n) (match-beginning m)).
632 Optional third argument STR gives substring from string STR."
632 (if (match-beginning n) 633 (if (match-beginning n)
633 (YaTeX-buffer-substring (match-beginning n) 634 (if str (substring str n (or m n))
634 (match-end (or m n))))) 635 (YaTeX-buffer-substring (match-beginning n)
636 (match-end (or m n))))))
635 637
636 ;;;###autoload 638 ;;;###autoload
637 (defun YaTeX-minibuffer-complete () 639 (defun YaTeX-minibuffer-complete ()
638 "Complete in minibuffer. 640 "Complete in minibuffer.
639 If the symbol 'delim is bound and is string, its value is assumed to be 641 If the symbol 'delim is bound and is string, its value is assumed to be

yatex.org