yatex
diff yahtml.el @ 61:b9f753846b6b
Bug fix release
author | yuuji |
---|---|
date | Mon, 07 Apr 1997 20:07:48 +0000 |
parents | 9e08ed569d80 |
children | 36a48185b95a |
line diff
1.1 --- a/yahtml.el Fri Jan 24 09:04:06 1997 +0000 1.2 +++ b/yahtml.el Mon Apr 07 20:07:48 1997 +0000 1.3 @@ -1,6 +1,6 @@ 1.4 ;;; -*- Emacs-Lisp -*- 1.5 ;;; (c ) 1994-1997 by HIROSE Yuuji [yuuji@ae.keio.ac.jp] 1.6 -;;; Last modified Fri Jan 24 18:03:01 1997 on supra 1.7 +;;; Last modified Mon Apr 7 16:58:32 1997 on crx 1.8 ;;; $Id$ 1.9 1.10 ;;;[Installation] 1.11 @@ -115,7 +115,7 @@ 1.12 (yahtml-define-begend-key-normal key env map) 1.13 (if YaTeX-inhibit-prefix-letter nil 1.14 (yahtml-define-begend-region-key 1.15 - (concat (upcase (substring key 0 1)) (substring key 1)) env))) 1.16 + (concat (upcase (substring key 0 1)) (substring key 1)) env map))) 1.17 1.18 1.19 (if yahtml-mode-map nil 1.20 @@ -146,8 +146,10 @@ 1.21 (YaTeX-define-key ")" 'YaTeX-insert-parens-region map) 1.22 (YaTeX-define-key "s" 'yahtml-insert-form map) 1.23 (YaTeX-define-key "l" 'yahtml-insert-tag map) 1.24 + (YaTeX-define-key "L" 'yahtml-insert-tag-region map) 1.25 (YaTeX-define-key "m" 'yahtml-insert-single map) 1.26 - (YaTeX-define-key "n" '(lambda () (interactive) (if yahtml-prefer-upcases (insert "<BR>")(insert "<br>"))) map) 1.27 + (YaTeX-define-key "n" '(lambda () (interactive) (insert (if yahtml-prefer-upcases "<BR>" "<br>"))) map) 1.28 + (YaTeX-define-key "-" '(lambda () (interactive) (insert (if yahtml-prefer-upcases "<HR>" "<hr>") "\n")) map) 1.29 (if YaTeX-no-begend-shortcut 1.30 (progn 1.31 (YaTeX-define-key "B" 'yahtml-insert-begend-region map) 1.32 @@ -188,11 +190,11 @@ 1.33 1.34 (defvar yahtml-paragraph-start 1.35 (concat 1.36 - "^$\\|<!--\\|^[ \t]*</?\\(h[1-6]\\|p\\|d[ldt]\\|[bhtd][rdh]\\|li\\|body\\|html\\|head\\|title\\|ul\\|ol\\|dl\\|pre\\|table\\|center\\)\\b") 1.37 + "^$\\|<!--\\|^[ \t]*</?\\(h[1-6]\\|p\\|d[ldt]\\|[bhtd][rdh]\\|li\\|body\\|html\\|head\\|title\\|ul\\|ol\\|dl\\|pre\\|table\\|center\\|blockquote\\)\\b") 1.38 "*Regexp of html paragraph separater") 1.39 (defvar yahtml-paragraph-separate 1.40 (concat 1.41 - "^$\\|<!--\\|^[ \t]*</?\\(h[1-6]\\|p\\|[bhtd][ldt]\\|li\\|body\\|html\\|head\\|title\\|ul\\|ol\\|dl\\|pre\\|table\\|center\\|!--\\)\\b") 1.42 + "^$\\|<!--\\|^[ \t]*</?\\(h[1-6]\\|p\\|[bhtd][ldt]\\|li\\|body\\|html\\|head\\|title\\|ul\\|ol\\|dl\\|pre\\|table\\|center\\|blockquote\\|!--\\)\\b") 1.43 "*Regexp of html paragraph separater") 1.44 (defvar yahtml-syntax-table nil 1.45 "*Syntax table for typesetting buffer") 1.46 @@ -200,8 +202,8 @@ 1.47 (if yahtml-syntax-table nil 1.48 (setq yahtml-syntax-table 1.49 (make-syntax-table (standard-syntax-table))) 1.50 - (modify-syntax-entry ?\< "(" yahtml-syntax-table) 1.51 - (modify-syntax-entry ?\> ")" yahtml-syntax-table) 1.52 + (modify-syntax-entry ?\< "(>" yahtml-syntax-table) 1.53 + (modify-syntax-entry ?\> ")<" yahtml-syntax-table) 1.54 (modify-syntax-entry ?\n " " yahtml-syntax-table) 1.55 ) 1.56 (defvar yahtml-command-regexp "[A-Za-z0-9]+" 1.57 @@ -221,7 +223,8 @@ 1.58 ("DefinitionList" . "dl") 1.59 ("Preformatted" . "pre") 1.60 ("table") ("tr") ("th") ("td") 1.61 - ("h1") ("h2") ("h3") ("h4") ("h5") ("h6"))) 1.62 + ("h1") ("h2") ("h3") ("h4") ("h5") ("h6") 1.63 + ("p"))) 1.64 1.65 (defvar yahtml-itemizing-regexp 1.66 "\\(ul\\|ul\\|dl\\)" 1.67 @@ -258,9 +261,14 @@ 1.68 1.69 (defvar yahtml-prefer-upcases nil) 1.70 1.71 +;(defvar yahtml-struct-name-regexp 1.72 +; "\\<\\(h[1-6]\\|[uod]l\\|html\\|body\\|title\\|head\\|table\\|t[rhd]\\|pre\\|a\\|form\\|select\\|center\\|blockquote\\)\\b") 1.73 (defvar yahtml-struct-name-regexp 1.74 - "\\<\\(h[1-6]\\|[uod]l\\|html\\|body\\|title\\|head\\|table\\|t[rhd]\\|pre\\|a\\|form\\|select\\)\\b") 1.75 - 1.76 + (concat 1.77 + "\\<\\(" 1.78 + (mapconcat (function (lambda (x) (car x))) yahtml-typeface-table "\\|") 1.79 + "\\)\\b") 1.80 + "Regexp of structure beginning.") 1.81 1.82 (defun yahtml-mode () 1.83 (interactive) 1.84 @@ -610,7 +618,7 @@ 1.85 "\""))))) 1.86 1.87 (defvar yahtml-parameters-completion-alist 1.88 - '(("align" ("top") ("middle") ("bottom")) 1.89 + '(("align" ("top") ("middle") ("bottom") ("left") ("right") ("center")) 1.90 ("src" . file) 1.91 ("method" ("POST") ("GET")))) 1.92 1.93 @@ -665,6 +673,12 @@ 1.94 (defun yahtml:dt () 1.95 (setq yahtml-last-single-cmd "dd") "") 1.96 1.97 +(defun yahtml:p () 1.98 + (let ((alg (yahtml-read-parameter "align"))) 1.99 + (if (string< "" alg) 1.100 + (setq alg (concat "align=" alg) 1.101 + alg (if yahtml-prefer-upcases (upcase alg) (downcase alg))) 1.102 + ""))) 1.103 1.104 (defvar yahtml-input-types 1.105 '(("text") ("password") ("checkbox") ("radio") ("submit") 1.106 @@ -736,6 +750,11 @@ 1.107 (insert (format "<%s%s>" tag (yahtml-addin tag))) 1.108 (save-excursion (insert (format "</%s>" tag))))) 1.109 1.110 +(defun yahtml-insert-tag-region (&optional tag) 1.111 + "Call yahtml-insert-tag with region mode." 1.112 + (interactive) 1.113 + (yahtml-insert-tag t tag)) 1.114 + 1.115 (defun yahtml-insert-single (cmd) 1.116 "Insert <CMD>." 1.117 (interactive 1.118 @@ -1158,7 +1177,7 @@ 1.119 (defun yahtml-fill-paragraph (arg) 1.120 (interactive "P") 1.121 (let*((case-fold-search t) (p (point)) 1.122 - (e (or (yahtml-inner-environment-but "^a\\b" t) "html")) 1.123 + (e (or (yahtml-inner-environment-but "^\\(a\\|p\\)\\b" t) "html")) 1.124 (prep (string-match "^pre$" e)) 1.125 (ps1 (if prep (default-value 'paragraph-start) 1.126 paragraph-start)) 1.127 @@ -1195,12 +1214,13 @@ 1.128 ;;; 1.129 (defun yahtml-indent-line () 1.130 (interactive) 1.131 - (let ((envs "[uod]l\\|table\\|t[rhd]\\|select") 1.132 - (itms "<\\(dt\\|dd\\|li\\|t[rdh]\\|option\\)>") 1.133 + (let ((envs "[uod]l\\|table\\|t[rhd]\\|select\\|blockquote") 1.134 + (itms "<\\(dt\\|dd\\|li\\|t[rdh]\\|option\\)\\b") 1.135 inenv p col peol (case-fold-search t)) 1.136 (save-excursion 1.137 (beginning-of-line) 1.138 - (setq inenv (or (yahtml-inner-environment-but "^a\\b" t) "html") 1.139 + (setq inenv (or (yahtml-inner-environment-but "^\\(a\\|p\\)\\b" t) 1.140 + "html") 1.141 col (get 'YaTeX-inner-environment 'indent) 1.142 p (get 'YaTeX-inner-environment 'point) 1.143 op)) 1.144 @@ -1224,7 +1244,9 @@ 1.145 (setq op (point)) 1.146 (goto-char p) 1.147 (re-search-forward itms op t) 1.148 - (goto-char (match-end 0)) 1.149 + ;(goto-char (match-end 0)) 1.150 + (skip-chars-forward "^>") 1.151 + (skip-chars-forward ">") 1.152 (skip-chars-forward " \t") 1.153 (setq col (current-column))))) 1.154 (YaTeX-reindent col))