yatex
changeset 148:20a8da73ceb3 dev
merged
author | HIROSE Yuuji <yuuji@koeki-u.ac.jp> |
---|---|
date | Mon, 27 Sep 2010 17:08:44 +0900 |
parents | 78803eda24b8 f9d3c2451d19 |
children | 2008ee4c9c5d |
files | yatexprc.el |
diffstat | 8 files changed, 287 insertions(+), 40 deletions(-) [+] |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/newpage.rb Mon Sep 27 17:08:44 2010 +0900 1.3 @@ -0,0 +1,128 @@ 1.4 +#!/usr/bin/env ruby 1.5 +# THIS is very very tentative. Insufficient examination of function. 1.6 +# Create new HTML file referring other HTML file in the same directory. 1.7 +# (C)2010 by HIROSE Yuuji [yuuji@yatex.org] 1.8 +# Last modified Mon Sep 6 16:16:33 2010 on firestorm 1.9 +# $Id$ 1.10 +# http://www.yatex.org 1.11 +# Example: 1.12 +# newpage.rb Create new index.html by copying template. 1.13 +# newpage.rb foo.html Create new foo.html whose by copying header 1.14 +# and footer from index.html. 1.15 +# newpage.rb d/sub.html Create new directory d (if necessary) and 1.16 +# d/sub.html by copying header/footer from 1.17 +# index.html in a same directory or parent 1.18 +# directory rewriting href to css file 1.19 +# considering relative path. 1.20 +# newpage.rb -o [file] Forcibly overwrite existing file. 1.21 +# newpage.rb -c cssfile Set `cssfile' as defualt css. 1.22 +# newpage.rb -t template Set `template' as HTML template. 1.23 +require 'fileutils' 1.24 + 1.25 +mydir=File.dirname($0) 1.26 +myname=File.basename($0, ".rb") 1.27 + 1.28 + 1.29 +index = 'index.html' 1.30 +cssdefault = nil 1.31 +overwrite = nil 1.32 +template = __FILE__ #File.expand_path(myname+".html", mydir) 1.33 + 1.34 +def guesscss(dir) 1.35 + 1.36 +end 1.37 + 1.38 +while ARGV[0] && /^-/ =~ (a0=ARGV[0].dup) && ARGV.shift 1.39 + break if /^--$/ =~ a0 1.40 + while /^-[A-Za-z]/ =~ a0 1.41 + case a0 1.42 + when "-c" # css 1.43 + ARGV.shift; cssdefault = ARGV[0] 1.44 + when "-t" # template 1.45 + ARGV.shift; cssdefault = ARGV[0] 1.46 + when "-o" # overwrite 1.47 + overwrite = true 1.48 + end 1.49 + a0.sub!(/-.(.*)/, '-\\1') 1.50 + end 1.51 +end 1.52 + 1.53 +outfile = ARGV[0]||index 1.54 +if !overwrite && test(?s, outfile) then 1.55 + STDERR.printf("File \`%s' exists. Use -o option to overwrite.\n", outfile) 1.56 + exit 1 1.57 +end 1.58 + 1.59 +# set css default file 1.60 +dots = 0 1.61 +of = outfile 1.62 +dots+=1 while "." != (of=File.dirname(of)) 1.63 +cssdir = "../"*dots 1.64 + 1.65 +# set copy source 1.66 +outdir = File.dirname(outfile) 1.67 +if "index.html" == File.basename(outfile) 1.68 + src = (dots == 0 ? template : "index.html") 1.69 +elsif test(?s, outdir+"/index.html") 1.70 + src = outdir+"/index.html" 1.71 +else 1.72 + src = template 1.73 +end 1.74 + 1.75 +FileUtils.mkdir_p(outdir) 1.76 + 1.77 +cssfile = cssdir+"main.css" 1.78 +name = File.basename(outfile, ".html") 1.79 +begin 1.80 + open(outfile, "w") do |out| 1.81 + #IO.foreach(src) do |line| 1.82 + if src == __FILE__ 1.83 + input = DATA 1.84 + else 1.85 + input = open(src, "r") 1.86 + end 1.87 + begin 1.88 + html = input.readlines.join 1.89 + html.sub!(%r|^<h1.*<\/h1>|i, sprintf("<h1>%s</h1>\n", name)) 1.90 + if !html.gsub!("__CSSFILE__", cssfile) 1.91 + html.gsub!(/href=(['\"])(.*\.css)\1/, 'href="'+cssdir+'\2"') 1.92 + end 1.93 + html.gsub!("__TITLE__", name) 1.94 + out.print html 1.95 + ensure 1.96 + input.close 1.97 + end 1.98 + end 1.99 + printf(<<_EOS_, outfile, name) 1.100 +<a href="%s">%s</a> 1.101 +_EOS_ 1.102 +rescue 1.103 + p $! 1.104 + STDERR.printf(<<'_EOS_', outfile, outfile) 1.105 +Cannot output to [%s]. Do 1.106 + chmod +w %s 1.107 +or 1.108 + chmod +w . 1.109 +or change output directory. 1.110 +_EOS_ 1.111 + exit 1 1.112 +end 1.113 + 1.114 +__END__ 1.115 +<html> 1.116 +<head> 1.117 +<title>__TITLE__</title> 1.118 +<style type="text/css"> 1.119 +<!-- 1.120 +/* Local CSS here */ 1.121 +--> 1.122 +</style> 1.123 +<link rel="stylesheet" type="text/css" href="__CSSFILE__"> 1.124 +</head> 1.125 + 1.126 +<body> 1.127 +<h1>__TITLE__</h1> 1.128 + 1.129 +<!--#include virtual="/~yuuji/signature.html"--> 1.130 +</body> 1.131 +</html>
2.1 --- a/yahtml.el Mon Sep 27 17:05:03 2010 +0900 2.2 +++ b/yahtml.el Mon Sep 27 17:08:44 2010 +0900 2.3 @@ -1,6 +1,6 @@ 2.4 ;;; -*- Emacs-Lisp -*- 2.5 ;;; (c) 1994-2010 by HIROSE Yuuji [yuuji(@)yatex.org] 2.6 -;;; Last modified Fri Feb 12 21:30:03 2010 on firestorm 2.7 +;;; Last modified Mon Sep 13 08:09:46 2010 on firestorm 2.8 ;;; $Id$ 2.9 2.10 (defconst yahtml-revision-number "1.74.2" 2.11 @@ -417,7 +417,7 @@ 2.12 ("DefinitionList" . "dl") 2.13 ("Preformatted" . "pre") 2.14 ("table") ("thead") ("tbody") ("tfoot") ("tr") ("th") ("td") 2.15 - ("address") 2.16 + ("address") ("button") 2.17 ("h1") ("h2") ("h3") ("h4") ("h5") ("h6") 2.18 ;; ("p") ;This makes indentation screwed up! 2.19 ("style") ("script") ("noscript") ("div") ("object") ("ins") ("del") 2.20 @@ -880,6 +880,25 @@ 2.21 "class(or class list delimited by \\[quoted-insert] SPC): ")) 2.22 nil YaTeX-minibuffer-completion-map nil))) 2.23 2.24 +(defvar yahtml-newpage-command "newpage.rb" 2.25 + "*Command name to create new HTML file referring to index.html. 2.26 +This command should create new HTML file named argument 1 and 2.27 +output string like `<a href=\"newfile.html\">anchor tag</a>'. 2.28 +This program should take -o option to overwrite existing HTML file.") 2.29 +(defun yahtml-newpage (file ov) 2.30 + "Create newpage via newpage script" 2.31 + (interactive 2.32 + (list 2.33 + (let (insert-default-directory) 2.34 + (read-file-name "New webpage file name: " "")) 2.35 + current-prefix-arg)) 2.36 + (if (and (file-exists-p file) (not ov)) 2.37 + (error "%s already exists. Call this with universal argument to force overwrite." file)) 2.38 + (insert (substring 2.39 + (YaTeX-command-to-string 2.40 + (concat yahtml-newpage-command " " (if ov "-o ") file)) 2.41 + 0 -1))) 2.42 + 2.43 ;;; ---------- Add-in ---------- 2.44 (defun yahtml-addin (form) 2.45 "Check add-in function's existence and call it if exists." 2.46 @@ -888,6 +907,7 @@ 2.47 (and (setq a (yahtml-css-get-element-completion-alist form)) 2.48 (not (equal last-command-char ?\C-j)) 2.49 (memq yahtml-current-completion-type '(multiline inline)) 2.50 + (not (string-match "#" form)) 2.51 (yahtml-make-optional-argument ;should be made generic? 2.52 "class" (yahtml-read-css a))) 2.53 (if (and (intern-soft addin) (fboundp (intern-soft addin)) 2.54 @@ -1116,6 +1136,10 @@ 2.55 ((eq alist 'file) 2.56 (let ((insert-default-directory)) 2.57 (read-file-name prompt "" default nil ""))) 2.58 + ((eq alist 'command) 2.59 + (if (fboundp 'read-shell-command) 2.60 + (read-shell-command prompt) 2.61 + (read-string prompt))) 2.62 ((and alist (symbolp alist)) 2.63 (completing-read prompt (symbol-value alist) nil nil default)) 2.64 (alist 2.65 @@ -1563,6 +1587,16 @@ 2.66 "Add-in function for abbr." 2.67 (yahtml-make-optional-argument "title" (yahtml-read-parameter "title"))) 2.68 2.69 +(defun yahtml:button () 2.70 + (concat 2.71 + (yahtml-make-optional-argument 2.72 + "name" (yahtml-read-parameter "name")) 2.73 + (yahtml-make-optional-argument 2.74 + "type" (yahtml-read-parameter 2.75 + "type" "button" '(("submit")("reset")("button")))) 2.76 + (yahtml-make-optional-argument 2.77 + "value" (yahtml-read-parameter "value")))) 2.78 + 2.79 ;;; ---------- Simple tag ---------- 2.80 (defun yahtml-insert-tag (region-mode &optional tag) 2.81 "Insert <TAG> </TAG> and put cursor inside of them." 2.82 @@ -1656,7 +1690,8 @@ 2.83 (format "%s=\"%s\"--" (if (string-match "/" file) "virtual" "file") file))) 2.84 2.85 (defun yahtml:!--\#exec () 2.86 - (format "cmd=\"%s\"--" (yahtml-read-parameter "cmd" "" '(("cmd" . file))))) 2.87 + (format "cmd=\"%s\"--" 2.88 + (yahtml-read-parameter "cmd" "" '(("cmd" . command))))) 2.89 2.90 ;;; ---------- Jump ---------- 2.91 (defun yahtml-on-href-p () 2.92 @@ -2247,6 +2282,39 @@ 2.93 (goto-char (get 'YaTeX-inner-environment 'point)))) 2.94 e)) 2.95 2.96 +(defun yahtml-untranslate-string (str) 2.97 + "Untranslate entity reference." 2.98 + (let ((md (match-data)) (left "") (right str) b0 ch 2.99 + (ct (append yahtml-entity-reference-chars-alist 2.100 + yahtml-entity-reference-chars-alist-default)) 2.101 + (revrex yahtml-entity-reference-chars-reverse-regexp)) 2.102 + (unwind-protect 2.103 + (progn 2.104 + (while (string< "" right) 2.105 + (cond 2.106 + ((string-match revrex right) 2.107 + (setq ch (YaTeX-rassoc 2.108 + (substring right (match-beginning 1) (match-end 1))) 2.109 + b0 (substring right 0 (match-beginning 0)) 2.110 + right (substring right (match-end 0)) 2.111 + left (concat left 2.112 + (substring right 0 (match-beginning 0)) 2.113 + (char-to-string ch)))) 2.114 + ((string-match "\\&#\\(x\\)?\\([0-9a-f]+\\);" right) 2.115 + (setq ch (substring right (match-beginning 2) (match-end 2)) 2.116 + b0 (substring right 0 (match-beginning 0)) 2.117 + right (substring right (match-end 0)) 2.118 + left (concat left 2.119 + b0 2.120 + (char-to-string 2.121 + (if (match-beginning 1) 2.122 + (YaTeX-hex ch) 2.123 + (string-to-number ch)))))) 2.124 + (t (setq left (concat left right) 2.125 + right "")))) 2.126 + left) 2.127 + (store-match-data md)))) 2.128 + 2.129 ;;; ---------- filling ---------- 2.130 (defvar yahtml-saved-move-to-column (symbol-function 'move-to-column)) 2.131 (defun yahtml-move-to-column (col &optional force) 2.132 @@ -2453,9 +2521,9 @@ 2.133 ;;; ---------- Lint and Browsing ---------- 2.134 ;;; 2.135 (defun yahtml-browse-menu () 2.136 - "Browsing menu" 2.137 + "Browsing or other external process invokation menu." 2.138 (interactive) 2.139 - (message "J)weblint p)Browse R)eload...") 2.140 + (message "J)weblint p)Browse R)eload N)ewpage...") 2.141 (let ((c (char-to-string (read-char)))) 2.142 (cond 2.143 ((string-match "j" c) 2.144 @@ -2463,7 +2531,9 @@ 2.145 ((string-match "[bp]" c) 2.146 (yahtml-browse-current-file)) 2.147 ((string-match "r" c) 2.148 - (yahtml-browse-reload))))) 2.149 + (yahtml-browse-reload)) 2.150 + ((string-match "n" c) 2.151 + (call-interactively 'yahtml-newpage))))) 2.152 2.153 (if (fboundp 'wrap-function-to-control-ime) 2.154 (wrap-function-to-control-ime 'yahtml-browse-menu t nil)) 2.155 @@ -2476,10 +2546,12 @@ 2.156 (interactive "bCall lint on buffer: ") 2.157 (setq buf (get-buffer buf)) 2.158 (YaTeX-save-buffers) 2.159 - (YaTeX-typeset 2.160 - (concat yahtml-lint-program " " 2.161 - (file-name-nondirectory (buffer-file-name buf))) 2.162 - yahtml-lint-buffer "lint" "lint")) 2.163 + (let ((bcmd (YaTeX-get-builtin "lint"))) 2.164 + (and bcmd (setq bcmd (yahtml-untranslate-string bcmd))) 2.165 + (YaTeX-typeset 2.166 + (concat (or bcmd yahtml-lint-program) 2.167 + " " (file-name-nondirectory (buffer-file-name buf))) 2.168 + yahtml-lint-buffer "lint" "lint"))) 2.169 2.170 (defun yahtml-file-to-url (file) 2.171 "Convert local unix file name to URL. 2.172 @@ -2685,7 +2757,7 @@ 2.173 (cond 2.174 ((and (> cols 0) 2.175 (memq (read-char) '(?d ?D))) ;Duplication mode 2.176 - (setq line (YaTeX-buffer-substring (point) cp))) 2.177 + (setq line (YaTeX-buffer-substring (point) (1- cp)))) 2.178 (t ;empty cells 2.179 (setq line "<tr>" i 0) 2.180 (if (> cols 0)
3.1 --- a/yatex.new Mon Sep 27 17:05:03 2010 +0900 3.2 +++ b/yatex.new Mon Sep 27 17:08:44 2010 +0900 3.3 @@ -5,6 +5,9 @@ 3.4 [prefix] t e でポイント位置を含む環境か数式環境をタイプセット。 3.5 M-C-SPC で環境だけでなく数式環境もマークする。 3.6 [prefix] t d でタイプセッタ起動成功のあと dvipdfmx を起動。 3.7 + === yahtml === 3.8 + [prefix] t ブラウザメニューに「n:新規ページ作成」を追加(実験)。 3.9 + [prefix] t j のlintコマンドを <!-- #lint CmdLine --> で指定可。 3.10 3.11 1.74 === yatex === 3.12 YaTeX-kanji-code が 4 のときは UTF-8 とした。
4.1 --- a/yatexadd.el Mon Sep 27 17:05:03 2010 +0900 4.2 +++ b/yatexadd.el Mon Sep 27 17:08:44 2010 +0900 4.3 @@ -2,8 +2,8 @@ 4.4 ;;; YaTeX add-in functions. 4.5 ;;; yatexadd.el rev.18 4.6 ;;; (c)1991-2006 by HIROSE Yuuji.[yuuji@yatex.org] 4.7 -;;; Last modified Thu Oct 15 09:18:40 2009 on firestorm 4.8 -;;; $Id: yatexadd.el,v f14ec50103d0 2009/09/27 22:55:44 yuuji $ 4.9 +;;; Last modified Thu Sep 9 09:08:19 2010 on firestorm 4.10 +;;; $Id$ 4.11 4.12 ;;; 4.13 ;;Sample functions for LaTeX environment. 4.14 @@ -1665,7 +1665,7 @@ 4.15 ("Emerald") ("JungleGreen") ("SeaGreen") ("Green") ("ForestGreen") 4.16 ("PineGreen") ("LimeGreen") ("YellowGreen") ("SpringGreen") ("OliveGreen") 4.17 ("RawSienna") ("Sepia") ("Brown") ("Tan") ("Gray") ("Black") ("White")) 4.18 - "Colors defined in $TEXMF/tex/plain/colordvi.tex") 4.19 + "Colors defined in $TEXMF/tex/plain/dvips/colordvi.tex") 4.20 4.21 (defvar YaTeX:latex2e-basic-color-alist 4.22 '(("black") ("white") ("red") ("blue") ("yellow") ("green") ("cyan")
5.1 --- a/yatexlib.el Mon Sep 27 17:05:03 2010 +0900 5.2 +++ b/yatexlib.el Mon Sep 27 17:08:44 2010 +0900 5.3 @@ -2,7 +2,7 @@ 5.4 ;;; YaTeX and yahtml common libraries, general functions and definitions 5.5 ;;; yatexlib.el 5.6 ;;; (c)1994-2009 by HIROSE Yuuji.[yuuji@yatex.org] 5.7 -;;; Last modified Thu May 27 15:09:44 2010 on firestorm 5.8 +;;; Last modified Sat Sep 11 11:40:11 2010 on firestorm 5.9 ;;; $Id$ 5.10 5.11 ;; General variables 5.12 @@ -822,6 +822,21 @@ 5.13 (win-switch-to-window 1 (- last-command-char win:base-key))) 5.14 5.15 ;;;###autoload 5.16 +(defun YaTeX-command-to-string (cmd) 5.17 + (if (fboundp 'shell-command-to-string) 5.18 + (funcall 'shell-command-to-string cmd) 5.19 + (let ((tbuf " *tmpout*")) 5.20 + (if (get-buffer-create tbuf) (kill-buffer tbuf)) 5.21 + (let ((standard-output (get-buffer-create tbuf))) 5.22 + (unwind-protect 5.23 + (save-excursion 5.24 + (call-process 5.25 + shell-file-name nil tbuf nil YaTeX-shell-command-option cmd) 5.26 + (set-buffer tbuf) 5.27 + (buffer-string)) 5.28 + (kill-buffer tbuf)))))) 5.29 + 5.30 +;;;###autoload 5.31 (defun YaTeX-reindent (col) 5.32 "Remove current indentation and reindento to COL column." 5.33 (save-excursion 5.34 @@ -1052,6 +1067,37 @@ 5.35 (get-file-buffer pf) 5.36 (switch-to-buffer (get-file-buffer pf))))) 5.37 5.38 +(defun YaTeX-get-builtin (key) 5.39 + "Read source built-in command of %# usage." 5.40 + (catch 'builtin 5.41 + (let ((bl (delq nil (list (current-buffer) 5.42 + (and YaTeX-parent-file 5.43 + (get-file-buffer YaTeX-parent-file))))) 5.44 + (leader (or (cdr-safe (assq major-mode 5.45 + '((yatex-mode . "%#") 5.46 + (yahtml-mode . "<!-- #")))) 5.47 + ""))) 5.48 + (save-excursion 5.49 + (while bl 5.50 + (set-buffer (car bl)) 5.51 + (save-excursion 5.52 + (goto-char (point-min)) 5.53 + (if (and (re-search-forward 5.54 + (concat "^" (regexp-quote (concat leader key))) nil t) 5.55 + (not (eolp))) 5.56 + (throw 'builtin 5.57 + (YaTeX-buffer-substring 5.58 + (progn 5.59 + (skip-chars-forward " \t" (point-end-of-line)) 5.60 + (point)) 5.61 + (if (string< "" comment-end) 5.62 + (progn 5.63 + (search-forward 5.64 + comment-end (point-end-of-line) t) 5.65 + (match-beginning 0)) 5.66 + (point-end-of-line)))))) 5.67 + (setq bl (cdr bl))))))) 5.68 + 5.69 ;;;VER2 5.70 (defun YaTeX-insert-struc (what env) 5.71 (cond 5.72 @@ -1073,6 +1119,24 @@ 5.73 ((fboundp 'truncate-string) (truncate-string str width)) 5.74 (t (substring str 0 width)))) 5.75 5.76 +(defun YaTeX-hex (str) 5.77 + "Return int expressed by hexadecimal string STR." 5.78 + (if (string< "20" emacs-version) 5.79 + (string-to-number str 16) 5.80 + (let ((md (match-data))) 5.81 + (unwind-protect 5.82 + (if (string-match "[^0-9a-f]" str) 5.83 + (error "Non hexadecimal character in %s" str) 5.84 + (let ((i 0) d) 5.85 + (setq str (downcase str)) 5.86 + (while (string< "" str) 5.87 + (setq d (+ 0 (string-to-char str)) ; + 0 for XEmacs 5.88 + i (+ (* 16 i) (- d (if (<= d ?9) ?0 (- ?a 10)))) 5.89 + str (substring str 1))) 5.90 + i)) 5.91 + (store-match-data md))))) 5.92 + 5.93 + 5.94 ;;; Function for menu support 5.95 (defun YaTeX-define-menu (keymap bindlist) 5.96 "Define KEYMAP(symbol)'s menu-bindings according to BINDLIST.
6.1 --- a/yatexmth.el Mon Sep 27 17:05:03 2010 +0900 6.2 +++ b/yatexmth.el Mon Sep 27 17:08:44 2010 +0900 6.3 @@ -2,7 +2,7 @@ 6.4 ;;; YaTeX math-mode-specific functions. 6.5 ;;; yatexmth.el 6.6 ;;; (c)1993-2010 by HIROSE Yuuji [yuuji@yatex.org] 6.7 -;;; Last modified Fri May 28 15:21:26 2010 on firestorm 6.8 +;;; Last modified Sat Sep 11 15:51:37 2010 on firestorm 6.9 ;;; $Id$ 6.10 6.11 ;;; [Customization guide] 6.12 @@ -175,6 +175,7 @@ 6.13 ("=<" "leqq" ("<\n=" "≦")) 6.14 (">" "geq" (">\n-" ">\n-")) 6.15 (">=" "geqq" (">\n=" "≧")) 6.16 + ("=:" "fallingdotseq" (".\n==\n ." "≒")) 6.17 ("-=" "equiv" ("=\n-" YaTeX-image-equiv)) 6.18 ("=-" "equiv" ("=\n-" YaTeX-image-equiv)) 6.19 ("---" "equiv" ("=\n-" YaTeX-image-equiv))
7.1 --- a/yatexpkg.el Mon Sep 27 17:05:03 2010 +0900 7.2 +++ b/yatexpkg.el Mon Sep 27 17:08:44 2010 +0900 7.3 @@ -2,7 +2,7 @@ 7.4 ;;; YaTeX package manager 7.5 ;;; yatexpkg.el 7.6 ;;; (c)2003-2010 by HIROSE, Yuuji [yuuji@yatex.org] 7.7 -;;; Last modified Fri May 28 15:16:04 2010 on firestorm 7.8 +;;; Last modified Sat Sep 11 15:50:40 2010 on firestorm 7.9 ;;; $Id$ 7.10 7.11 (defvar YaTeX-package-ams-envs 7.12 @@ -32,6 +32,7 @@ 7.13 ("amsmath" (env . YaTeX-package-ams-envs) 7.14 (section "tag" "tag*")) 7.15 ("amssymb" (maketitle "leqq" "geqq" "mathbb" "mathfrak" 7.16 + "fallingdotseq" 7.17 "lll" "ggg")) ;very few. Please tell us! 7.18 ("graphicx" (section "includegraphics" 7.19 "rotatebox" "scalebox" "resizebox" "reflectbox")
8.1 --- a/yatexprc.el Mon Sep 27 17:05:03 2010 +0900 8.2 +++ b/yatexprc.el Mon Sep 27 17:08:44 2010 +0900 8.3 @@ -2,7 +2,7 @@ 8.4 ;;; YaTeX process handler. 8.5 ;;; yatexprc.el 8.6 ;;; (c)1993-2010 by HIROSE Yuuji.[yuuji@yatex.org] 8.7 -;;; Last modified Mon Sep 27 17:03:24 2010 on duke 8.8 +;;; Last modified Mon Sep 27 17:07:41 2010 on duke 8.9 ;;; $Id$ 8.10 8.11 ;(require 'yatex) 8.12 @@ -917,28 +917,6 @@ 8.13 (YaTeX-switch-to-buffer-other-window 8.14 (concat (YaTeX-get-preview-file-name) ".tex")))) 8.15 8.16 -(defun YaTeX-get-builtin (key) 8.17 - "Read source built-in command of %# usage." 8.18 - (catch 'builtin 8.19 - (let ((bl (delq nil (list (current-buffer) 8.20 - (and YaTeX-parent-file 8.21 - (get-file-buffer YaTeX-parent-file)))))) 8.22 - (save-excursion 8.23 - (while bl 8.24 - (set-buffer (car bl)) 8.25 - (save-excursion 8.26 - (goto-char (point-min)) 8.27 - (if (and (re-search-forward 8.28 - (concat "^" (regexp-quote (concat "%#" key))) nil t) 8.29 - (not (eolp))) 8.30 - (throw 'builtin 8.31 - (YaTeX-buffer-substring 8.32 - (progn 8.33 - (skip-chars-forward " \t" (point-end-of-line)) 8.34 - (point)) 8.35 - (point-end-of-line))))) 8.36 - (setq bl (cdr bl))))))) 8.37 - 8.38 (defun YaTeX-save-buffers () 8.39 "Save buffers whose major-mode is equal to current major-mode." 8.40 (basic-save-buffer)