# HG changeset patch # User yuuji # Date 817929328 0 # Node ID 18f4939986e6022afdf1e955ec0613723a6da7c3 # Parent a9653fbd1c1c0376bf8ee8a7bb4f50d02eba17af (j)LaTeX2e supported yatex19.el fixed a lot diff -r a9653fbd1c1c -r 18f4939986e6 docs/qanda.eng --- a/docs/qanda.eng Thu Jun 29 13:46:57 1995 +0000 +++ b/docs/qanda.eng Sat Dec 02 18:35:28 1995 +0000 @@ -191,6 +191,14 @@ \begin{itemize} within the environment. Now it's too shallow? Umm... time for me to take a break. +*Is it possible to include personal template file template.tex handily? + + Try Emacs-19's standard package `autoinsert.el' please. Or its + upper compatible package auto-insert-tkld might also be good. + You can get auto-insert-tkld via anonymous ftp + ftp://ftp.ae.keio.ac.jp/pub/emacs-lisp/util/ + ftp://archive.cis.ohio-state.edu/pub/gnu/elisp-archive/ + [About Emacs-19/Mule2] ====================== *Equations are too dark to read when I use hilit19. @@ -295,7 +303,7 @@ Naoki; katsura@prc.tsukuba.ac.jp) is "fj Wild Bird Society". Send a mail like - To: yatex-control@harvest.jaist.ac.jp + To: yatex-control@jaist.ac.jp Subject: append ----- Hi! See any birds fly by? diff -r a9653fbd1c1c -r 18f4939986e6 docs/yatexe.tex --- a/docs/yatexe.tex Thu Jun 29 13:46:57 1995 +0000 +++ b/docs/yatexe.tex Sat Dec 02 18:35:28 1995 +0000 @@ -1673,6 +1673,20 @@ Simplyfy messages of various completions(@code{nil})$B!#(B @end defvar +@defvar YaTeX-hilit-sectioning-face +When hilit19 and yatex19 is active, YaTeX colors the sectioning commands. +This variable specifies the foreground and background color of +@code{\part} macro. The default value is @code{'(yellow/dodgerblue +yellow/slateblue)}. The first element of this list is for the screen when +@code{hilit-background-mode} is @code{'light}, and the second element is +for @code{'dark}. You should specify both color as `forecolor/backcolor'. +@end defvar + +@defvar YaTeX-hilit-sectioning-attenuation-rate +When color mode, this variable specifies how much attenuate the color +density of @code{\subparagraph} compared with that of @code{\chapter}. +See also $B!#(B@code{YaTeX-hilit-sectioning-face}. +@end defvar @node Sample definitions, Hook variables, All customizable variables, Lisp variables @@ -2128,8 +2142,8 @@ (up to Mar.1995 at least) And there is mailing list for YaTeX. Although the common language is Japanese, questions in English will be welcome. To join the ML, send the mail whose subject is `append' to -the address `yatex-control@@harvest.jaist.ac.jp'. If you have some -question, please ask to `yatex-request@@harvest.jaist.ac.jp'. +the address `yatex-control@@jaist.ac.jp'. If you have some +question, please ask to `yatex-request@@jaist.ac.jp'. The specification of this software will be surely modified (depending on my feelings) without notice :-p. diff -r a9653fbd1c1c -r 18f4939986e6 docs/yatexj.tex --- a/docs/yatexj.tex Thu Jun 29 13:46:57 1995 +0000 +++ b/docs/yatexj.tex Sat Dec 02 18:35:28 1995 +0000 @@ -1879,6 +1879,20 @@ 各種補完時のメッセージ出力を簡素化する(@code{nil})。 @end defvar +@defvar YaTeX-hilit-sectioning-face +色付けが有効な時の @code{\part} の色 +(@code{'(yellow/dodgerblue yellow/slateblue)})。 +リストの第一要素は @code{hilit-background-mode} が @code{'light} の時の、 +第二要素は @code{'dark} の時の @code{\chapter} の色で、文字色/背景色 のよ +うに指定する。 +@end defvar + +@defvar YaTeX-hilit-sectioning-attenuation-rate +色付けが有効な時の、@code{\subparagraph} の色を @code{\chapter} の濃度の何 +%薄くしたものにするか(@code{'(15 40)}。@code{YaTeX-hilit-sectioning-face} +の項参照。 +@end defvar + @node Sample definitions, Hook variables, All customizable variables, Lisp variables @comment node-name, next, previous, up @subsection カスタマイズ変数設定例 diff -r a9653fbd1c1c -r 18f4939986e6 help/YATEXHLP.jp --- a/help/YATEXHLP.jp Thu Jun 29 13:46:57 1995 +0000 +++ b/help/YATEXHLP.jp Sat Dec 02 18:35:28 1995 +0000 @@ -1083,6 +1083,12 @@ 出力される、\bibitem[LABEL]{NAME}の書式では、\cite{NAME}で参照され、 [LABEL] のような引用記号が出力される。 +cite +\cite{NAME} \cite[LABEL]{NAME} +\cite{NAME}の書式では、NAMEで参照され、[1],[2] のような形で引用記号が +出力される、\cite[LABEL]{NAME}の書式では、[1,LABEL] のような引用記号 +が出力される。 + footnote \footnote{NOTE} NOTEという内容の脚注を生成する。 @@ -1319,13 +1325,15 @@ 竹中浩さん(東京大) M-q (YaTeX-fill-paragraph) のバグを報告して頂きました。 + YaTeX-insert-amper をcontributeして頂きました。 佐藤圭さん(慶應大) ネストした同種のitemize環境でのindentationの不具合を指摘して頂き ました。 石川洋介さん(富士通) - Mule2で斜体フォントを使用するための手順を教えて頂きました。 + Mule2で斜体フォントを使用するための手順、auto-insertの存在を教え + て頂きました。 井上浩一さん(九州大学) MuleでフォーマットしたinfoファイルをNemacs用にコンバートする方法 @@ -1335,6 +1343,10 @@ font-lock の使い方を調査するといって、まだ何も教えてくれません。 早くしてください:-)。 +吉田尚志さん(慶應大) + label/ref補完で、labelやrefで始まる単語全てを候補にいれてしまう + バグを報告して頂きました。 + yatex (setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist)) diff -r a9653fbd1c1c -r 18f4939986e6 yahtml.el --- a/yahtml.el Thu Jun 29 13:46:57 1995 +0000 +++ b/yahtml.el Sat Dec 02 18:35:28 1995 +0000 @@ -1,6 +1,6 @@ ;;; -*- Emacs-Lisp -*- ;;; (c ) 1994 by HIROSE Yuuji [yuuji@ae.keio.ac.jp, pcs39334@ascii-net.or.jp] -;;; Last modified Mon Apr 24 22:52:17 1995 on pajero +;;; Last modified Mon Nov 20 11:26:38 1995 on inspire ;;; This is PURELY tentative. ;;; $Id$ @@ -10,11 +10,16 @@ ;;; completing featureas are available: ([prefix] means `C-c' by default) ;;; ;;; * [prefix] b X Complete environments such as `H1' which -;;; normally requires newline. +;;; normally requires closing tag ` +;;; ... is also classified into +;;; this group ;;; * [prefix] s Complete declarative notations such as -;;; ` .... ' +;;; `' +;;; `' ;;; * [prefix] l Complete typeface-changing commands such as ;;; ` ... ' or ` ... ' +;;; * [prefix] m Complete single commands such as +;;; `
' or `
' ;;; * menu-bar yahtml Complete all by selecting a menu item (Though I ;;; hate menu, this is most useful) ;;; @@ -23,16 +28,87 @@ (require 'yatex) -(defvar yahtml-prefix-map (copy-keymap YaTeX-prefix-map)) -(defvar yahtml-mode-map nil - "Keymap used in yahtml-mode.") +(defvar yahtml-prefix-map nil) +(defvar yahtml-mode-map nil "Keymap used in yahtml-mode.") + +(defun yahtml-define-begend-key-normal (key env &optional map) + "Define short cut yahtml-insert-begin-end key." + (YaTeX-define-key + key + (list 'lambda '(arg) '(interactive "P") + (list 'yahtml-insert-begin-end env 'arg)) + map)) + +(defun yahtml-define-begend-region-key (key env &optional map) + "Define short cut yahtml-insert-begin-end-region key." + (YaTeX-define-key key (list 'lambda nil '(interactive) + (list 'yahtml-insert-begin-end env t)) map)) + +(defun yahtml-define-begend-key (key env &optional map) + "Define short cut key for begin type completion both for +normal and region mode. To customize yahtml, user should use this function." + (yahtml-define-begend-key-normal key env map) + (if YaTeX-inhibit-prefix-letter nil + (yahtml-define-begend-region-key + (concat (upcase (substring key 0 1)) (substring key 1)) env))) + + (if yahtml-mode-map nil - (setq yahtml-mode-map (make-sparse-keymap)) + (setq yahtml-mode-map (make-sparse-keymap) + yahtml-prefix-map (make-sparse-keymap)) (define-key yahtml-mode-map YaTeX-prefix yahtml-prefix-map) (define-key yahtml-mode-map "\M-\C-@" 'YaTeX-mark-environment) (define-key yahtml-mode-map "\M-\C-a" 'YaTeX-beginning-of-environment) - (define-key yahtml-mode-map "\M-\C-e" 'YaTeX-end-of-environment)) + (define-key yahtml-mode-map "\M-\C-e" 'YaTeX-end-of-environment) + (define-key yahtml-mode-map "\C-i" 'YaTeX-indent-line) + (define-key yahtml-mode-map YaTeX-prefix yahtml-prefix-map) + (let ((map yahtml-prefix-map)) + (YaTeX-define-key "^" 'yahtml-visit-main map) + (YaTeX-define-key "4^" 'yahtml-visit-main-other-window map) + (YaTeX-define-key "4g" 'yahtml-goto-corresponding-*-other-window map) + (YaTeX-define-key "44" 'YaTeX-switch-to-window map) + (and YaTeX-emacs-19 window-system + (progn + (YaTeX-define-key "5^" 'yahtml-visit-main-other-frame map) + (YaTeX-define-key "5g" 'yahtml-goto-corresponding-*-other-frame map) + (YaTeX-define-key "55" 'YaTeX-switch-to-window map))) + (YaTeX-define-key "v" 'YaTeX-version map) + (YaTeX-define-key "}" 'YaTeX-insert-braces-region map) + (YaTeX-define-key "]" 'YaTeX-insert-brackets-region map) + (YaTeX-define-key ")" 'YaTeX-insert-parens-region map) + (YaTeX-define-key "s" 'yahtml-insert-form map) + (YaTeX-define-key "l" 'yahtml-insert-tag map) + (YaTeX-define-key "m" 'yahtml-insert-single map) + (YaTeX-define-key "n" '(lambda () (interactive) (insert "
\n")) map) + (if YaTeX-no-begend-shortcut + (progn + (YaTeX-define-key "B" 'yahtml-insert-begend-region map) + (YaTeX-define-key "b" 'yahtml-insert-begend map)) + (yahtml-define-begend-key "bh" "HTML" map) + (yahtml-define-begend-key "bH" "HEAD" map) + (yahtml-define-begend-key "bt" "TITLE" map) + (yahtml-define-begend-key "bb" "BODY" map) + (yahtml-define-begend-key "bd" "DL" map) + (yahtml-define-begend-key "b1" "H1" map) + (yahtml-define-begend-key "b2" "H2" map) + (yahtml-define-begend-key "b3" "H3" map) + (yahtml-define-begend-key "ba" "a" map) + (yahtml-define-begend-key "bf" "form" map) + (yahtml-define-begend-key "bs" "select" map) + (YaTeX-define-key "b " 'yahtml-insert-begend map) + (YaTeX-define-key "B " 'yahtml-insert-begend map) + ) + (YaTeX-define-key "e" 'yahtml-end-environment map) + (YaTeX-define-key ">" 'yahtml-comment-region map) + (YaTeX-define-key "<" 'yahtml-uncomment-region map) + (YaTeX-define-key "g" 'yahtml-goto-corresponding-* map) + ) +) +(defvar yahtml-paragraph-separate + (concat + "^$\\|
\\|

\\|^[ \t]*") + "*Regexp of html paragraph separater") (defvar yahtml-syntax-table nil "*Syntax table for typesetting buffer") @@ -44,24 +120,37 @@ ) (defvar yahtml-command-regexp "[A-Za-z0-9]+" "Regexp of constituent of html commands.") +(defvar yahtml-kanji-code 2 + "Kanji coding system of html file; 1=sjis, 2=jis, 3=euc") ;;; Completion tables for `form' -(defvar yahtml-form-table '(("a") ("form"))) +(defvar yahtml-form-table + '(("img") ("input"))) (defvar yahtml-user-form-table nil) (defvar yahtml-tmp-form-table nil) (defvar yahtml-env-table - '(("html") ("head") ("title") ("body") ("dl") - ("h1") ("h2") ("h3") ("h4") ("h5") ("h6"))) + '(("html") ("head") ("title") ("body") ("dl") ("a") ("form") ("select") + ("h1") ("h2") ("h3") ("h4") ("h5") ("h6") ("ul"))) + +(defvar yahtml-user-env-table nil) +(defvar yahtml-tmp-env-table nil) ;;; Completion tables for typeface designator (defvar yahtml-typeface-table '(("defn") ("em") ("cite") ("code") ("kbd") ("samp") - ("strong") ("var") ("b") ("i") ("tt") ("u")) + ("strong") ("var") ("b") ("i") ("tt") ("u") ("address")) "Default completion table of typeface designator") (defvar yahtml-user-typeface-table nil) (defvar yahtml-tmp-typeface-table nil) +(defvar yahtml-single-cmd-table + '(("hr") ("br") ("option") ("p")) + "Default completion table of HTML single command.") +(defvar yahtml-user-single-cmd-table nil) +(defvar yahtml-tmp-single-cmd-table nil) +(defvar yahtml-last-single-cmd nil) + (defvar yahtml-prefer-upcases nil) (cond (yahtml-prefer-upcases @@ -75,38 +164,42 @@ (mapcar (function (lambda (list) (list (upcase (car list))))) yahtml-typeface-table)))) +(defvar yahtml-struct-name-regexp + "\\<\\(h[1-6]\\|[uod]l\\|body\\|title\\|head\\)") + + (defun yahtml-mode () (interactive) (yatex-mode) + (cond + ((boundp 'MULE) + (set-file-coding-system + (cdr (assq yahtml-kanji-code YaTeX-kanji-code-alist)))) + ((boundp 'NEMACS) + (make-local-variable 'kanji-fileio-code) + (setq kanji-fileio-code yahtml-kanji-code))) (setq major-mode 'yahtml-mode mode-name "yahtml") (make-local-variable 'YaTeX-ec) (setq YaTeX-ec "") - (make-local-variable 'YaTeX-struct-begin) (setq YaTeX-struct-begin "<%1>") + (make-local-variable 'YaTeX-struct-begin) (setq YaTeX-struct-begin "<%1%2>") (make-local-variable 'YaTeX-struct-end) (setq YaTeX-struct-end "") - (mapcar 'make-local-variable - '(env-table user-env-table tmp-env-table)) - (setq env-table yahtml-env-table) - (mapcar 'make-local-variable - '(singlecmd-table user-singlecmd-table tmp-singlecmd-table)) (make-local-variable 'YaTeX-struct-name-regexp) - (setq YaTeX-struct-name-regexp "[^/]+") + (setq YaTeX-struct-name-regexp yahtml-struct-name-regexp) (make-local-variable 'YaTeX-prefix-map) (make-local-variable 'YaTeX-command-token-regexp) (setq YaTeX-command-token-regexp yahtml-command-regexp) - (setq YaTeX-prefix-map yahtml-prefix-map) + (make-local-variable 'YaTeX-environment-indent) + (setq YaTeX-environment-indent 0) + (make-local-variable 'fill-prefix) + (setq fill-prefix nil) + (make-local-variable 'paragraph-separate) + (setq paragraph-separate yahtml-paragraph-separate + paragraph-start yahtml-paragraph-separate) + (make-local-variable 'comment-start) + (make-local-variable 'comment-end) + (setq comment-start "") (set-syntax-table yahtml-syntax-table) (use-local-map yahtml-mode-map) - (YaTeX-define-key "s" 'yahtml-insert-form) - (YaTeX-define-key "l" 'yahtml-insert-tag) - (if YaTeX-no-begend-shortcut nil - (YaTeX-define-begend-key "bh" "HTML") - (YaTeX-define-begend-key "bH" "HEAD") - (YaTeX-define-begend-key "bt" "TITLE") - (YaTeX-define-begend-key "bb" "BODY") - (YaTeX-define-begend-key "bd" "DL") - (YaTeX-define-begend-key "b1" "H1") - (YaTeX-define-begend-key "b2" "H2") - (YaTeX-define-begend-key "b3" "H3")) (run-hooks 'yahtml-mode-hook)) (defun yahtml-define-menu (keymap bindlist) @@ -186,6 +279,17 @@ (dl "Description" . (lambda () (interactive) (yahtml-insert-begin-end "DL" nil))) ))) + (setq yahtml-menu-map-item (make-sparse-keymap "item")) + (yahtml-define-menu + yahtml-menu-map-item + (nreverse + '((li "Simple item" . + (lambda () (interactive) (yahtml-insert-single "li"))) + (dt "Define term" . + (lambda () (interactive) (yahtml-insert-single "dt"))) + (dd "Description of term" . + (lambda () (interactive) (yahtml-insert-single "dd"))) + ))) (define-key yahtml-mode-map [menu-bar yahtml] (cons "yahtml" yahtml-menu-map)) (yahtml-define-menu @@ -196,6 +300,8 @@ (cons "sectioning" yahtml-menu-map-sectioning)) (cons (list 'list "Listing") (cons "Listing" yahtml-menu-map-listing)) + (cons (list 'item "Item") + (cons "Itemizing" yahtml-menu-map-item));;; (cons (list 'logi "Logical tags") (cons "logical" yahtml-menu-map-logical)) (cons (list 'type "Typeface tags") @@ -221,8 +327,39 @@ yahtml-urls))) (message "Collecting global history...Done"))) +;;; ----------- Completion ---------- +(defvar yahtml-last-begend "html") +(defun yahtml-insert-begend (&optional region) + "Insert ... ." + (interactive "P") + (let ((cmd (YaTeX-cplread-with-learning + (format "Environment(default %s): " yahtml-last-begend) + 'yahtml-env-table 'yahtml-user-env-table 'yahtml-tmp-env-table)) + (bolp (bolp))) + (if (string< "" cmd) (setq yahtml-last-begend cmd)) + (setq cmd yahtml-last-begend) + (if region + (let ((beg (region-beginning)) + (end (region-end)) + (addin (yahtml-addin cmd))) + (goto-char end) + (insert (format "%s" cmd (if bolp "\n" ""))) + (goto-char beg) + (insert (format "<%s%s>%s" cmd addin (if bolp "\n" "")))) + (insert (format "<%s%s" cmd (yahtml-addin cmd))) + (if bolp (progn (insert (format ">\n\n" cmd cmd)) + (forward-line -1)) + (insert ">") + (save-excursion (insert (format "" cmd))))))) + +(defun yahtml-insert-begend-region () + "Call yahtml-insert-begend in the region mode." + (interactive) + (yahtml-insert-begend t)) + + (defun yahtml-insert-form (&optional form) - "Insert

." + "Insert
." (interactive) (or form (setq form @@ -230,25 +367,71 @@ "Form: " 'yahtml-form-table 'yahtml-user-form-table 'yahtml-tmp-form-table))) - (let ((p (point))) - (insert (format "<%s%s>\n" form (yahtml-addin (downcase form)))) - (indent-relative-maybe) - (save-excursion (insert (format "" form))) + (let ((p (point)) q) + (insert (format "<%s%s>" form (yahtml-addin (downcase form)))) + ;;(indent-relative-maybe) + (if (cdr (assoc form yahtml-form-table)) + (save-excursion (insert (format "" form)))) (if (search-backward "\"\"" p t) (forward-char 1)))) (defun yahtml-addin (form) "Check add-in function's existence and call it if exists." - (let ((addin (concat "yahtml::" form))) + (let ((addin (concat "yahtml:" form))) (if (and (intern-soft addin) (fboundp (intern-soft addin))) (concat " " (funcall (intern addin))) ""))) -(defun yahtml::a () +(defun yahtml:a () "Add-in function for " +; (or yahtml-urls (yahtml-collect-url-history)) +; (concat "href=\"" +; (completing-read "href: " yahtml-urls) +; "\"") + (concat "href=\"" (read-file-name "href: " "" nil nil "") "\"") +) + +(defun yahtml:img () + "Add-in function for " (or yahtml-urls (yahtml-collect-url-history)) - (concat "href=\"" - (completing-read "href: " yahtml-urls) - "\"")) + (let ((src (read-file-name "src: " "" nil t "")) + (alg (completing-read "align: " '(("top") ("middle") ("bottom"))))) + (concat "src=\"" src "\"" + (if (string< "" alg) (concat " align=\"" alg "\""))))) + +(defun yahtml:form () + "Add-in function `form' input format" + (concat + " method=" (completing-read "Method: " '(("POST") ("GET")) nil t) + " action=\"" (read-string "Action: ") "\"" + )) + +(defun yahtml:select () + "Add-in function for `select' input format" + (setq yahtml-last-single-cmd "option") + (concat " name=\"" (read-string "name: ") "\"")) + +(defvar yahtml-input-types + '(("text") ("password") ("checkbox") ("radio") ("submit") + ("reset") ("image") ("hidden"))) + +(defun yahtml:input () + "Add-in function for `input' form" + (let (name type value checked (size "") (maxlength "")) + (setq name (read-string "name: ") + type (completing-read "type (default=text): " + yahtml-input-types nil t) + value (read-string "value: ")) + (if (string-match "text\\|password\\|^$" type) + (setq size (read-string "size: ") + maxlength (read-string "maxlength: "))) + (concat + "name=\"" name "\"" + (if (string< "" type) (concat " type=\"" type "\"")) + (if (string< "" value) (concat " value=\"" value "\"")) + (if (string< "" size) (concat " size=\"" size "\"")) + (if (string< "" maxlength) (concat " maxlength=\"" maxlength "\"")) + ))) + (defun yahtml-insert-begin-end (env &optional region-mode) "Insert \\n by calling YaTeX-insert-begin-end." @@ -256,19 +439,159 @@ (setq env (funcall (if yahtml-prefer-upcases 'upcase 'downcase) env)) (YaTeX-insert-begin-end env region-mode)) -(defun yahtml-insert-tag (&optional tag) +(defun yahtml-insert-tag (tag) "Insert and put cursor inside of them." - (interactive) - (or tag - (setq tag - (YaTeX-cplread-with-learning - "Tag: " - 'yahtml-typeface-table 'yahtml-user-typeface-table - 'yahtml-tmp-typeface-table))) + (interactive + (list + (YaTeX-cplread-with-learning + "Tag: " + 'yahtml-typeface-table 'yahtml-user-typeface-table + 'yahtml-tmp-typeface-table))) (setq tag (funcall (if yahtml-prefer-upcases 'upcase 'downcase) tag)) (insert (format "<%s> " tag)) (save-excursion (insert (format "" tag)))) +(defun yahtml-insert-single (cmd) + "Insert ." + (interactive + (list (YaTeX-cplread-with-learning + (format "Command%s: " + (if yahtml-last-single-cmd + (concat "(default " yahtml-last-single-cmd ")") "")) + 'yahtml-single-cmd-table 'yahtml-user-single-cmd-table + 'yahtml-tmp-single-cmd-table))) + (setq cmd (funcall (if yahtml-prefer-upcases 'upcase 'downcase) cmd)) + (if (string< "" cmd) (setq yahtml-last-single-cmd cmd)) + (insert (format "<%s>" yahtml-last-single-cmd))) + +;;; ---------- Jump ---------- +(defun yahtml-on-href-p () + "Check if point is on href clause." + (let ((p (point)) cmd) + (save-excursion + (or (bobp) (skip-chars-backward "^ \t")) + (and (looking-at "href\\s *=\\s *\"?\\([^\"]+\\)\"?") + (< p (match-end 0)) + (YaTeX-match-string 1))))) + +(defun yahtml-goto-corresponding-href (&optional other) + "Go to corresponding name." + (let ((href (yahtml-on-href-p)) file name) + (if href + (cond + ((string-match "^http:" href) + (message "Sorry, jump across http is not supported.")) + (t (setq file (substring href 0 (string-match "#" href))) + (if (string-match "#" href) + (setq name (substring href (1+ (string-match "#" href))))) + (if (string< "" file) + (progn + (if (string-match "/$" file) + (setq file (concat file "index.html"))) + (if other (YaTeX-switch-to-buffer-other-window file) + (YaTeX-switch-to-buffer file)))) + (if name + (progn (set-mark-command nil) (yahtml-jump-to-name name))) + t))))) + +(defun yahtml-jump-to-name (name) + "Jump to html's named tag." + (setq name (format "name\\s *=\\s *\"?%s\"?" name)) + (or (and (re-search-forward name nil t) (goto-char (match-beginning 0))) + (and (re-search-backward name nil t) (goto-char (match-beginning 0))) + (message "Named tag `%s' not found" (substring href 1)))) + +(defun yahtml-on-begend-p (&optional p) + "Check if point is on begend clause." + (let ((p (point)) cmd) + (save-excursion + (if p (goto-char p)) + (if (= (char-after (point)) ?<) (forward-char 1)) + (if (and (re-search-backward "<" nil t) + (looking-at + (concat "<\\(/?" yahtml-command-regexp "\\)\\b")) + (condition-case nil + (forward-list 1)) + (< p (point))) + (YaTeX-match-string 1))))) + +(defun yahtml-goto-corresponding-begend () + (let ((cmd (yahtml-on-begend-p))) + (if cmd + (progn + (if (= (aref cmd 0) ?/) ;on line + (re-search-backward (format "<%s" (substring cmd 1))) + (re-search-forward (format "" comment) + ;; include&exec + ("" include) + ;; string + (hilit-string-find 39 string) + (yahtml-hilit-region-tag "\\(em\\|strong\\)" bold) + ("" 0 decl) + ("<\\(di\\|dt\\|li\\|dd\\)>" 0 label) + ("" crossref) + ("" 0 decl) + (" form." + (if (re-search-forward (concat "<" tag ">") nil t) + (let ((m0 (match-beginning 0))) + (skip-chars-forward " \t\n") + (cons (point) + (progn (re-search-forward (concat "") nil t) + (1- (match-beginning 0))))))) + +;(setq hilit-patterns-alist (delq (assq 'yahtml-mode hilit-patterns-alist) hilit-patterns-alist)) +(cond + ((and (featurep 'hilit19) (featurep 'yatex19)) + (or (assq 'yahtml-mode hilit-patterns-alist) + (setq hilit-patterns-alist + (cons (cons 'yahtml-mode yahtml-hilit-patterns-alist) + hilit-patterns-alist))))) + (provide 'yahtml) ; Local variables: diff -r a9653fbd1c1c -r 18f4939986e6 yatex.el Binary file yatex.el has changed diff -r a9653fbd1c1c -r 18f4939986e6 yatex.new --- a/yatex.new Thu Jun 29 13:46:57 1995 +0000 +++ b/yatex.new Sat Dec 02 18:35:28 1995 +0000 @@ -1,6 +1,15 @@ What's new in YaTeX yatex.el 各バージョンの変更点について +1.60 LaTeX2e 対応 + documentclass パラメータを修正し、ASCII 版 jLaTeX2e に対応 + \{ \}でhilitがおかしくなるバグを修正 + YaTeX-hilit-recenterのたびにpatterns-alistが太るのを修正 + yahtml.el に hilit を導入 + 変数 YaTeX-hilit-sectioning-attenuation-rate で、セクションコマ + ンドの色の濃さの減衰百分率を指定できるようにした + \chapter, \section, ...のデフォルトの色を変えた + 1.59 %(コメント)のhilitのバグを修正。 tabular環境のお任せ改行で無限ループになることがあるのを回避。 アドイン関数が効かないバグを修正。 diff -r a9653fbd1c1c -r 18f4939986e6 yatex19.el --- a/yatex19.el Thu Jun 29 13:46:57 1995 +0000 +++ b/yatex19.el Sat Dec 02 18:35:28 1995 +0000 @@ -1,7 +1,7 @@ ;;; -*- Emacs-Lisp -*- ;;; YaTeX facilities for Emacs 19 ;;; (c )1994-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Mon May 15 15:50:04 1995 on inspire +;;; Last modified Sun Dec 3 03:29:56 1995 on inspire ;;; $Id$ ;;; とりあえず hilit19 を使っている時に色が付くようにして @@ -325,8 +325,13 @@ (defvar YaTeX-hilit-pattern-adjustment-private nil "*Adjustment hilit-pattern-alist for default yatex-mode's pattern.") (defvar YaTeX-hilit-sectioning-face - '(yellow/dodgerblue yellow/cornflowerblue) + '(yellow/dodgerblue yellow/slateblue) "*Hilightening face for sectioning unit. '(FaceForLight FaceForDark)") +(defvar YaTeX-hilit-sectioning-attenuation-rate + '(15 40) + "*Maximum attenuation rate of sectioning face. '(ForeRate BackRate) +Each rate specifies how much portion of RGB value should be attenuated +towards to lowest sectioning unit. Numbers should be written in percentage.") (defvar YaTeX-sectioning-patterns-alist nil "Hilightening patterns for sectioning units.") (defvar YaTeX-hilit-singlecmd-face @@ -345,7 +350,9 @@ (sectcol (symbol-name sectface)) sect-pat-alist) (if (string-match "/" sectcol) - (let (colorvalue fR fG fB bR bG bB list pat fg bg level from face) + (let ((fmin (nth 0 YaTeX-hilit-sectioning-attenuation-rate)) + (bmin (nth 1 YaTeX-hilit-sectioning-attenuation-rate)) + colorvalue fR fG fB bR bG bB pat fg bg level from face list lm) (require 'yatexsec) (setq fg (substring sectcol 0 (string-match "/" sectcol)) bg (substring sectcol (1+ (string-match "/" sectcol))) @@ -357,18 +364,19 @@ bR (/ (nth 0 colorvalue) 256) bG (/ (nth 1 colorvalue) 256) bB (/ (nth 2 colorvalue) 256) + lm YaTeX-sectioning-max-level list YaTeX-sectioning-level) (while list (setq pat (concat YaTeX-ec-regexp (car (car list)) "\\*?{") level (cdr (car list)) fg (format "hex-%02x%02x%02x" - (- fR (/ (* level fR) 40)) ;40 musn't be constant - (- fG (/ (* level fG) 40)) - (- fB (/ (* level fB) 40))) + (- fR (/ (* level fR fmin) lm 100)) + (- fG (/ (* level fG fmin) lm 100)) + (- fB (/ (* level fB fmin) lm 100))) bg (format "hex-%02x%02x%02x" - (- bR (/ (* level bR) 15)) ;15 musn't be constant - (- bG (/ (* level bG) 15)) - (- bB (/ (* level bB) 15))) + (- bR (/ (* level bR bmin) lm 100)) + (- bG (/ (* level bG bmin) lm 100)) + (- bB (/ (* level bB bmin) lm 100))) from (intern (format "sectioning-%d" level)) face (intern (concat fg "/" bg))) (hilit-translate from face) @@ -390,39 +398,45 @@ (cond ((eq hilit-background-mode 'light) (car table)) ((eq hilit-background-mode 'dark) (car (cdr table))) - (t nil)))))) + (t nil))))) + sect single) (hilit-translate ;;sectioning (funcall get-face YaTeX-hilit-sectioning-face) - macro (funcall get-face YaTeX-hilit-singlecmd-face))) - (setq hilit-patterns-alist ;Remove at first. - (delq 'yatex-mode hilit-patterns-alist) - hilit-patterns-alist - (cons - (cons 'yatex-mode - (append - YaTeX-sectioning-patterns-alist - YaTeX-hilit-pattern-adjustment-private - ;;YaTeX-hilit-pattern-adjustment-default - YaTeX-hilit-patterns-alist - (list - (list - 'YaTeX-19-region-section-type - (concat "\\\\\\(" - (mapconcat - (function (lambda (s) (regexp-quote (car s)))) - (append user-section-table tmp-section-table) - "\\|") - "\\){") - 'keyword) - (list - (concat "\\\\\\(" - (mapconcat - (function (lambda (s) (regexp-quote (car s)))) - (append user-singlecmd-table tmp-singlecmd-table) - "\\|") - "\\)\\b") - 0 'macro)))) - hilit-patterns-alist))))) + macro (funcall get-face YaTeX-hilit-singlecmd-face)) + (if (setq sect (append user-section-table tmp-section-table)) + (setq sect (concat "\\\\\\(" + (mapconcat + (function + (lambda (s) (regexp-quote (car s)))) + sect + "\\|") + "\\){"))) + (if (setq single (append user-singlecmd-table tmp-singlecmd-table)) + (setq single (concat "\\\\\\(" + (mapconcat + (function (lambda (s) (regexp-quote (car s)))) + single + "\\|") + "\\)\\b"))) + (setq hilit-patterns-alist ;Remove at first. + (delq (assq 'yatex-mode hilit-patterns-alist) hilit-patterns-alist) + hilit-patterns-alist + (cons + (cons 'yatex-mode + (append + (list nil) + YaTeX-sectioning-patterns-alist + YaTeX-hilit-pattern-adjustment-private + ;;YaTeX-hilit-pattern-adjustment-default + YaTeX-hilit-patterns-alist + (delq nil + (list + (if sect (list + 'YaTeX-19-region-section-type + sect + 'keyword)) + (if single (list single 0 'macro)))))) + hilit-patterns-alist)))))) ;;(YaTeX-19-collect-macros) ;causes an error (defun YaTeX-hilit-recenter (arg) "Collect current local macro and hilit-recenter." @@ -490,5 +504,10 @@ ;;; string 'mediumspringgreen ;;; formula 'khaki ;;; label 'yellow-underlined)) +(and YaTeX-emacs-19 + (eval-when-compile + (if (and (boundp 'window-system) window-system) + (require 'hilit19) + (error "Byte compile this file on window system! Not `-nw'!")))) (provide 'yatex19) diff -r a9653fbd1c1c -r 18f4939986e6 yatexadd.el --- a/yatexadd.el Thu Jun 29 13:46:57 1995 +0000 +++ b/yatexadd.el Sat Dec 02 18:35:28 1995 +0000 @@ -2,7 +2,7 @@ ;;; YaTeX add-in functions. ;;; yatexadd.el rev.13 ;;; (c )1991-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Thu Jan 26 03:31:20 1995 on figaro +;;; Last modified Mon Nov 6 14:30:25 1995 on inspire ;;; $Id$ ;;; @@ -389,7 +389,7 @@ YaTeX-label-buffer (function (lambda (x) (window-width x)))) (with-output-to-temp-buffer YaTeX-label-buffer (while (YaTeX-re-search-active-forward - (concat "\\\\" labelcmd) + (concat "\\\\" labelcmd "\\b") (regexp-quote YaTeX-comment-prefix) nil t) (goto-char (match-beginning 0)) (skip-chars-forward "^{") @@ -742,5 +742,69 @@ (setq YaTeX-default-document-style sname)))) ) +;;; -------------------- LaTeX2e stuff -------------------- +(defvar YaTeX:documentclass-options-default + '(("a4paper") ("a5paper") ("b5paper") ("10pt") ("11pt") ("12pt") + ("latterpaper") ("legalpaper") ("executivepaper") ("landscape") + ("oneside") ("twoside") ("draft") ("final") ("leqno") ("fleqn") ("openbib") + ("clock") ;for slides class only + ) + "Default options list for documentclass") +(defvar YaTeX:documentclass-options-private nil + "*User defined options list for documentclass") +(defvar YaTeX:documentclass-options-local nil + "*User defined options list for local documentclass") + +(defun YaTeX:documentclass () + (let*((delim ",") + (dt (append YaTeX:documentclass-options-local + YaTeX:documentclass-options-private + YaTeX:documentclass-options-default)) + (minibuffer-completion-table dt) + (opt (read-from-minibuffer + "Documentclass options ([opt1,opt2,...]): " + nil YaTeX-minibuffer-completion-map nil)) + (substr opt) o) + (if (string< "" opt) + (progn + (while substr + (setq o (substring substr 0 (string-match delim substr))) + (or (assoc o dt) + (YaTeX-update-table + (list o) + 'YaTeX:documentclass-options-default + 'YaTeX:documentclass-options-private + 'YaTeX:documentclass-options-local)) + (setq substr + (if (string-match delim substr) + (substring substr (1+ (string-match delim substr)))))) + (concat "[" opt "]")) + ""))) + +(defvar YaTeX:documentclasses-default + '(("article") ("jarticle") ("report") ("jreport") ("book") ("jbook") + ("j-article") ("j-report") ("j-book") + ("letter") ("slides") ("ltxdoc") ("ltxguide") ("ltnews") ("proc")) + "Default documentclass alist") +(defvar YaTeX:documentclasses-private nil + "*User defined documentclass alist") +(defvar YaTeX:documentclasses-local nil + "*User defined local documentclass alist") +(defvar YaTeX-default-documentclass (if YaTeX-japan "jarticle" "article") + "*Default documentclass") + +(defun YaTeX::documentclass (&optional argp) + (cond + ((equal argp 1) + (setq env-name "document") + (let ((sname + (YaTeX-cplread-with-learning + (format "Documentclass (default %s): " YaTeX-default-documentclass) + 'YaTeX:documentclasses-default + 'YaTeX:documentclasses-private + 'YaTeX:documentclasses-local))) + (if (string= "" sname) (setq sname YaTeX-default-documentclass)) + (setq YaTeX-default-documentclass sname))))) + ;;; -------------------- End of yatexadd -------------------- (provide 'yatexadd) diff -r a9653fbd1c1c -r 18f4939986e6 yatexmth.el --- a/yatexmth.el Thu Jun 29 13:46:57 1995 +0000 +++ b/yatexmth.el Sat Dec 02 18:35:28 1995 +0000 @@ -2,7 +2,7 @@ ;;; YaTeX math-mode-specific functions. ;;; yatexmth.el rev.4 ;;; (c )1993-1995 by HIROSE Yuuji [yuuji@ae.keio.ac.jp] -;;; Last modified Sat Feb 18 03:54:50 1995 on VFR +;;; Last modified Wed Aug 16 12:45:55 1995 on inspire ;;; $Id$ ;;; [Customization guide] @@ -445,8 +445,7 @@ (or (YaTeX-quick-in-environment-p '("math" "eqnarray" "equation" "eqnarray*" "displaymath")) (let*((p (point)) (nest 0) me0 - (delim (concat YaTeX-sectioning-regexp - "\\|^%\\|^$\\|^\C-l")) + (delim (concat YaTeX-sectioning-regexp "\\|^$\\|^\C-l")) (boundary (save-excursion (if (looking-at delim) diff -r a9653fbd1c1c -r 18f4939986e6 yatexprc.el --- a/yatexprc.el Thu Jun 29 13:46:57 1995 +0000 +++ b/yatexprc.el Sat Dec 02 18:35:28 1995 +0000 @@ -2,7 +2,7 @@ ;;; YaTeX process handler. ;;; yatexprc.el ;;; (c )1993-1995 by HIROSE Yuuji.[yuuji@ae.keio.ac.jp] -;;; Last modified Sat Jan 28 01:01:44 1995 on VFR +;;; Last modified Thu Nov 2 19:35:16 1995 on inspire ;;; $Id$ (require 'yatex) @@ -668,7 +668,8 @@ (string-match (YaTeX-guess-parent (YaTeX-get-builtin "!")) (buffer-name))) (t (save-excursion - (let ((latex-main-id (concat "^\\s *" YaTeX-ec-regexp "documentstyle"))) + (let ((latex-main-id + (concat "^\\s *" YaTeX-ec-regexp "document\\(style\\|class\\)"))) (or (re-search-backward latex-main-id nil t) (re-search-forward latex-main-id nil t)))))) )