yatex

changeset 590:7810c4ec21fe

Move wrapper functions former part of the file for the clarity.
author HIROSE Yuuji <yuuji@gentei.org>
date Fri, 23 Sep 2022 06:46:32 +0900
parents 921d58902dca
children e3b7e199a87d
files yatexlib.el
diffstat 1 files changed, 35 insertions(+), 30 deletions(-) [+]
line diff
     1.1 --- a/yatexlib.el	Fri Sep 23 06:29:04 2022 +0900
     1.2 +++ b/yatexlib.el	Fri Sep 23 06:46:32 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 Sep 22 11:17:54 2022 on firestorm
     1.8 +;;; Last modified Fri Sep 23 06:43:32 2022 on firestorm
     1.9  ;;; $Id$
    1.10  
    1.11  ;;; Code:
    1.12 @@ -119,6 +119,38 @@
    1.13    "*Main LaTeX source file name used when %#! expression doesn't exist.")
    1.14  (make-variable-buffer-local 'YaTeX-parent-file)
    1.15  
    1.16 +;;;
    1.17 +;; Emacs 21 compensational wrapper
    1.18 +;;;
    1.19 +(defun YaTeX-minibuffer-begin ()
    1.20 + (if (fboundp 'field-beginning)
    1.21 +     (field-beginning (point-max))
    1.22 +   (point-min)))
    1.23 +
    1.24 +(defun YaTeX-minibuffer-end ()
    1.25 + (if (fboundp 'field-end)
    1.26 +     (field-end (point-max))
    1.27 +   (point-max)))
    1.28 +
    1.29 +(defun YaTeX-minibuffer-string ()
    1.30 +  (buffer-substring (YaTeX-minibuffer-begin) (YaTeX-minibuffer-end)))
    1.31 +
    1.32 +(defun YaTeX-minibuffer-erase ()
    1.33 +  (if (eq (selected-window) (minibuffer-window))
    1.34 +      (if (fboundp 'delete-field) (delete-field) (erase-buffer))))
    1.35 +
    1.36 +(fset 'YaTeX-buffer-substring
    1.37 +      (if (fboundp 'buffer-substring-no-properties)
    1.38 +	  'buffer-substring-no-properties
    1.39 +	'buffer-substring))
    1.40 +(fset 'YaTeX-substring
    1.41 +      (if (fboundp 'substring-no-properties)
    1.42 +	  'substring-no-properties
    1.43 +	'substing))
    1.44 +
    1.45 +(defun YaTeX-region-active-p ()
    1.46 +  (and (fboundp 'region-active-p) (region-active-p)))
    1.47 +
    1.48  ;---------- Define default key bindings on YaTeX mode map ----------
    1.49  ;;;###autoload
    1.50  (defun YaTeX-kanji-ptex-mnemonic ()
    1.51 @@ -631,7 +663,8 @@
    1.52    "Return (buffer-substring (match-beginning n) (match-beginning m)).
    1.53  Optional third argument STR gives substring from string STR."
    1.54    (if (match-beginning n)
    1.55 -      (if str (substring str n (or m n))
    1.56 +      (if str (YaTeX-substring
    1.57 +	       str (match-beginning m) (match-end (or m n)))
    1.58  	(YaTeX-buffer-substring (match-beginning n)
    1.59  				(match-end (or m n))))))
    1.60  
    1.61 @@ -1387,34 +1420,6 @@
    1.62       bindlist))))
    1.63  
    1.64  ;;;
    1.65 -;; Emacs 21 compensational wrapper
    1.66 -;;;
    1.67 -(defun YaTeX-minibuffer-begin ()
    1.68 - (if (fboundp 'field-beginning)
    1.69 -     (field-beginning (point-max))
    1.70 -   (point-min)))
    1.71 -
    1.72 -(defun YaTeX-minibuffer-end ()
    1.73 - (if (fboundp 'field-end)
    1.74 -     (field-end (point-max))
    1.75 -   (point-max)))
    1.76 -
    1.77 -(defun YaTeX-minibuffer-string ()
    1.78 -  (buffer-substring (YaTeX-minibuffer-begin) (YaTeX-minibuffer-end)))
    1.79 -
    1.80 -(defun YaTeX-minibuffer-erase ()
    1.81 -  (if (eq (selected-window) (minibuffer-window))
    1.82 -      (if (fboundp 'delete-field) (delete-field) (erase-buffer))))
    1.83 -
    1.84 -(fset 'YaTeX-buffer-substring
    1.85 -      (if (fboundp 'buffer-substring-no-properties)
    1.86 -	  'buffer-substring-no-properties
    1.87 -	'buffer-substring))
    1.88 -
    1.89 -(defun YaTeX-region-active-p ()
    1.90 -  (and (fboundp 'region-active-p) (region-active-p)))
    1.91 -
    1.92 -;;;
    1.93  ;; hilit19 vs. font-lock
    1.94  ;;;
    1.95  (defvar YaTeX-19-functions-font-lock-direct