Mercurial > hgrepos > hgweb.cgi > yatex
comparison yatexlib.el @ 77:1b172d26b55e
Fix auto-fill movement on Emacs21.
Fix YaTeX:ref.
Support jump/change on AMS-LaTeX's parentheses.
author | yuuji |
---|---|
date | Thu, 01 May 2003 13:38:27 +0000 |
parents | f41b01fef5d6 |
children | 0734be649cb8 |
comparison
equal
deleted
inserted
replaced
76:c16a10460ce5 | 77:1b172d26b55e |
---|---|
1 ;;; -*- Emacs-Lisp -*- | 1 ;;; -*- Emacs-Lisp -*- |
2 ;;; YaTeX and yahtml common libraries, general functions and definitions | 2 ;;; YaTeX and yahtml common libraries, general functions and definitions |
3 ;;; yatexlib.el | 3 ;;; yatexlib.el |
4 ;;; (c )1994-2002 by HIROSE Yuuji.[yuuji@yatex.org] | 4 ;;; (c )1994-2002 by HIROSE Yuuji.[yuuji@yatex.org] |
5 ;;; Last modified Wed May 22 13:55:31 2002 on firestorm | 5 ;;; Last modified Wed Oct 2 23:35:33 2002 on firestorm |
6 ;;; $Id$ | 6 ;;; $Id$ |
7 | 7 |
8 ;; General variables | 8 ;; General variables |
9 (defvar YaTeX-dos (memq system-type '(ms-dos windows-nt OS/2))) | 9 (defvar YaTeX-dos (memq system-type '(ms-dos windows-nt OS/2))) |
10 (defvar YaTeX-emacs-19 (>= (string-to-int emacs-version) 19)) | 10 (defvar YaTeX-emacs-19 (>= (string-to-int emacs-version) 19)) |
28 (autoload 'yahtml-inner-environment-but "yahtml" "yahtml internal func." t) | 28 (autoload 'yahtml-inner-environment-but "yahtml" "yahtml internal func." t) |
29 | 29 |
30 (defvar YaTeX-kanji-code-alist | 30 (defvar YaTeX-kanji-code-alist |
31 (cond | 31 (cond |
32 ((boundp '*junet*) | 32 ((boundp '*junet*) |
33 (list (cons | 33 (list '(0 . *noconv*) |
34 (cons | |
34 1 | 35 1 |
35 (if YaTeX-dos (if (boundp '*sjis-dos*) *sjis-dos* *sjis*dos) | 36 (if YaTeX-dos (if (boundp '*sjis-dos*) *sjis-dos* *sjis*dos) |
36 *sjis*)) | 37 *sjis*)) |
37 '(2 . *junet*) '(3 . *euc-japan*))) | 38 '(2 . *junet*) '(3 . *euc-japan*))) |
38 (YaTeX-emacs-20 | 39 (YaTeX-emacs-20 |
39 ;;(cdr-safe(assq 'coding-system (assoc "Japanese" language-info-alist))) | 40 ;;(cdr-safe(assq 'coding-system (assoc "Japanese" language-info-alist))) |
40 (list (cons | 41 (list '(0 . no-conversion) |
42 (cons | |
41 1 (cond (YaTeX-dos 'shift_jis-dos) | 43 1 (cond (YaTeX-dos 'shift_jis-dos) |
42 ((member 'shift_jis (coding-system-list)) 'shift_jis-unix) | 44 ((member 'shift_jis (coding-system-list)) 'shift_jis-unix) |
43 (t 'sjis))) | 45 (t 'sjis))) |
44 '(2 . iso-2022-jp-unix) | 46 '(2 . iso-2022-jp-unix) |
45 '(3 . euc-jp-unix)))) | 47 '(3 . euc-jp-unix)))) |
722 | 724 |
723 (defun YaTeX-insert-file-contents (file visit &optional beg end) | 725 (defun YaTeX-insert-file-contents (file visit &optional beg end) |
724 (cond | 726 (cond |
725 ((and (string< "19" emacs-version) (not (featurep 'xemacs))) | 727 ((and (string< "19" emacs-version) (not (featurep 'xemacs))) |
726 (insert-file-contents file visit beg end)) | 728 (insert-file-contents file visit beg end)) |
727 ((string-match "unix" (symbol-name system-type)) | 729 ((string-match "unix\\|linux" (symbol-name system-type)) |
728 (let ((default-process-coding-system | 730 (let ((default-process-coding-system |
729 (and (boundp '*noconv*) (list '*noconv*))) | 731 (and (boundp '*noconv*) (list '*noconv*))) |
730 (file-coding-system (and (boundp '*noconv*) '*noconv*)) | 732 (file-coding-system (and (boundp '*noconv*) '*noconv*)) |
731 kanji-fileio-code | 733 kanji-fileio-code |
732 (default-process-kanji-code 0)) | 734 (default-process-kanji-code 0)) |
733 (call-process shell-file-name file (current-buffer) nil | 735 (call-process shell-file-name file (current-buffer) nil |
734 (or (and (boundp 'shell-command-option) | 736 (or (and (boundp 'shell-command-option) |
735 shell-command-option) | 737 shell-command-option) |
736 "-c") | 738 "-c") |
737 (format "head -c %d | tail -c +%d" end beg)))) | 739 (format "dd bs=1 count=%d | tail -c +%d" end beg)))) |
738 (t (insert-file-contents file)))) | 740 (t (insert-file-contents file)))) |
739 | 741 |
740 (defun YaTeX-split-string (str &optional sep null) | 742 (defun YaTeX-split-string (str &optional sep null) |
741 "Split string STR by every occurrence of SEP(regexp). | 743 "Split string STR by every occurrence of SEP(regexp). |
742 If the optional second argument SEP is nil, it defaults to \"[ \f\t\n\r\v]+\". | 744 If the optional second argument SEP is nil, it defaults to \"[ \f\t\n\r\v]+\". |