yatex
changeset 420:8f804c8339bb dev
merged
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Sun, 12 Jul 2015 10:07:08 +0900 |
parents | 510106cf15fb 465d80a913e4 |
children | e37af485338a 5e7b06dcab9c 9219b8c610f8 |
files | |
diffstat | 1 files changed, 21 insertions(+), 5 deletions(-) [+] |
line diff
1.1 --- a/yatex.el Sun Jul 12 10:06:47 2015 +0900 1.2 +++ b/yatex.el Sun Jul 12 10:07:08 2015 +0900 1.3 @@ -1,6 +1,6 @@ 1.4 ;;; yatex.el --- Yet Another tex-mode for emacs //野鳥// -*- coding: sjis -*- 1.5 ;;; (c)1991-2015 by HIROSE Yuuji.[yuuji@yatex.org] 1.6 -;;; Last modified Fri Feb 13 20:40:56 2015 on firestorm 1.7 +;;; Last modified Wed Jul 8 13:41:17 2015 on duke 1.8 ;;; $Id$ 1.9 ;;; The latest version of this software is always available at; 1.10 ;;; http://www.yatex.org/ 1.11 @@ -612,6 +612,18 @@ 1.12 (modify-syntax-entry ?\\ "/" YaTeX-mode-syntax-table) 1.13 (modify-syntax-entry ?~ " " YaTeX-mode-syntax-table)) 1.14 1.15 +(defvar YaTeX-mode-syntax-table-nonparen nil 1.16 + "Syntax table for yatex-mode with normal parentheses treated white spaces") 1.17 +(if YaTeX-mode-syntax-table-nonparen nil 1.18 + (setq YaTeX-mode-syntax-table-nonparen 1.19 + (make-syntax-table YaTeX-mode-syntax-table)) 1.20 + (let ((zenparens "()()「」『』【】[]{}《》〈〉〔〕") (i 0) s) 1.21 + (while (string-match "." zenparens i) 1.22 + (setq s (substring zenparens (match-beginning 0) (match-end 0)) 1.23 + i (1+ i)) 1.24 + (modify-syntax-entry 1.25 + (string-to-char s) " " YaTeX-mode-syntax-table-nonparen)))) 1.26 + 1.27 ;---------- Provide YaTeX-mode ---------- 1.28 ;;; 1.29 ;; Major mode definition 1.30 @@ -2064,10 +2076,14 @@ 1.31 (goto-char (match-beginning 0)) 1.32 (throw 'found t)) 1.33 ;;If inside of parentheses, try to escape. 1.34 - (while (and (not (= (preceding-char) ?\])) ;skip optional arg 1.35 - (condition-case err 1.36 - (progn (up-list -1) t) 1.37 - (error nil)))) 1.38 + (unwind-protect 1.39 + (progn 1.40 + (set-syntax-table YaTeX-mode-syntax-table-nonparen) 1.41 + (while (and (not (= (preceding-char) ?\])) ;skip optional arg 1.42 + (condition-case err 1.43 + (progn (up-list -1) t) 1.44 + (error nil))))) 1.45 + (set-syntax-table YaTeX-mode-syntax-table)) 1.46 (while (equal (preceding-char) ?\]) (backward-list)) 1.47 ;;(2) search command directly 1.48 (skip-chars-forward "^{}[]")