yatex

changeset 145:efc3819f749b dev

Recognize <!-- #lint CommandLine --> as yahtml-lint-program.
author yuuji@gentei.org
date Sun, 12 Sep 2010 10:59:55 +0900
parents 53ff0560fc7d
children f9d3c2451d19
files yahtml.el
diffstat 1 files changed, 40 insertions(+), 5 deletions(-) [+]
line diff
     1.1 --- a/yahtml.el	Sat Sep 11 16:02:35 2010 +0900
     1.2 +++ b/yahtml.el	Sun Sep 12 10:59:55 2010 +0900
     1.3 @@ -1,6 +1,6 @@
     1.4  ;;; -*- Emacs-Lisp -*-
     1.5  ;;; (c) 1994-2010 by HIROSE Yuuji [yuuji(@)yatex.org]
     1.6 -;;; Last modified Wed Jul  7 22:12:55 2010 on firestorm
     1.7 +;;; Last modified Sun Sep 12 10:58:31 2010 on firestorm
     1.8  ;;; $Id$
     1.9  
    1.10  (defconst yahtml-revision-number "1.74.2"
    1.11 @@ -2276,6 +2276,39 @@
    1.12  	(goto-char (get 'YaTeX-inner-environment 'point))))
    1.13      e))
    1.14  
    1.15 +(defun yahtml-untranslate-string (str)
    1.16 +  "Untranslate entity reference."
    1.17 +  (let ((md (match-data)) (left "") (right str) b0 ch
    1.18 +	(ct (append yahtml-entity-reference-chars-alist
    1.19 +		    yahtml-entity-reference-chars-alist-default))
    1.20 +	(revrex yahtml-entity-reference-chars-reverse-regexp))
    1.21 +    (unwind-protect
    1.22 +	(progn
    1.23 +	  (while (string< "" right)
    1.24 +	    (cond
    1.25 +	     ((string-match revrex right)
    1.26 +	      (setq ch (YaTeX-rassoc
    1.27 +			(substring right (match-beginning 1) (match-end 1)))
    1.28 +		    b0 (substring right 0 (match-beginning 0))
    1.29 +		    right (substring right (match-end 0))
    1.30 +		    left (concat left
    1.31 +				 (substring right 0 (match-beginning 0))
    1.32 +				 (char-to-string ch))))
    1.33 +	     ((string-match "\\&#\\(x\\)?\\([0-9a-f]+\\);" right)
    1.34 +	      (setq ch (substring right (match-beginning 2) (match-end 2))
    1.35 +		    b0 (substring right 0 (match-beginning 0))
    1.36 +		    right (substring right (match-end 0))
    1.37 +		    left (concat left
    1.38 +				 b0
    1.39 +				 (char-to-string
    1.40 +				  (if (match-beginning 1)
    1.41 +				      (YaTeX-hex ch)
    1.42 +				    (string-to-number ch))))))
    1.43 +	     (t (setq left (concat left right)
    1.44 +		      right ""))))
    1.45 +	  left)
    1.46 +      (store-match-data md))))
    1.47 +
    1.48  ;;; ---------- filling ----------
    1.49  (defvar yahtml-saved-move-to-column (symbol-function 'move-to-column))
    1.50  (defun yahtml-move-to-column (col &optional force)
    1.51 @@ -2507,10 +2540,12 @@
    1.52    (interactive "bCall lint on buffer: ")
    1.53    (setq buf (get-buffer buf))
    1.54    (YaTeX-save-buffers)
    1.55 -  (YaTeX-typeset
    1.56 -   (concat yahtml-lint-program " "
    1.57 -	   (file-name-nondirectory (buffer-file-name buf)))
    1.58 -   yahtml-lint-buffer  "lint" "lint"))
    1.59 +  (let ((bcmd (YaTeX-get-builtin "lint")))
    1.60 +    (and bcmd (setq bcmd (yahtml-untranslate-string bcmd)))
    1.61 +    (YaTeX-typeset
    1.62 +     (concat (or bcmd yahtml-lint-program)
    1.63 +	     " " (file-name-nondirectory (buffer-file-name buf)))
    1.64 +     yahtml-lint-buffer  "lint" "lint")))
    1.65  
    1.66  (defun yahtml-file-to-url (file)
    1.67    "Convert local unix file name to URL.