comparison lisp/textmodes/sgml-mode.el @ 3121:8cf203c42bee

(sgml-validate): compile1 renamed to compile-internal. (sgml-mode): Add autoload cookie.
author Richard M. Stallman <rms@gnu.org>
date Wed, 26 May 1993 18:20:35 +0000
parents 9e7ec92a4fdf
children 4db64c9c1f05
comparison
equal deleted inserted replaced
3120:c6c87b7f85b8 3121:8cf203c42bee
62 (setq sgml-mode-map (make-sparse-keymap)) 62 (setq sgml-mode-map (make-sparse-keymap))
63 (define-key sgml-mode-map ">" 'sgml-close-angle) 63 (define-key sgml-mode-map ">" 'sgml-close-angle)
64 (define-key sgml-mode-map "/" 'sgml-slash) 64 (define-key sgml-mode-map "/" 'sgml-slash)
65 (define-key sgml-mode-map "\C-c\C-v" 'sgml-validate)) 65 (define-key sgml-mode-map "\C-c\C-v" 'sgml-validate))
66 66
67 ;;;###autoload
67 (defun sgml-mode () 68 (defun sgml-mode ()
68 "Major mode for editing SGML. 69 "Major mode for editing SGML.
69 Makes > display the matching <. Makes / display matching /. 70 Makes > display the matching <. Makes / display matching /.
70 Use \\[sgml-validate] to validate your document with an SGML parser." 71 Use \\[sgml-validate] to validate your document with an SGML parser."
71 (interactive) 72 (interactive)
123 (modify-syntax-entry ?> ")<" sgml-mode-markup-syntax-table) 124 (modify-syntax-entry ?> ")<" sgml-mode-markup-syntax-table)
124 (modify-syntax-entry ?- "_ 1234" sgml-mode-markup-syntax-table) 125 (modify-syntax-entry ?- "_ 1234" sgml-mode-markup-syntax-table)
125 (modify-syntax-entry ?\' "\"" sgml-mode-markup-syntax-table)) 126 (modify-syntax-entry ?\' "\"" sgml-mode-markup-syntax-table))
126 127
127 (defconst sgml-angle-distance 4000 128 (defconst sgml-angle-distance 4000
128 "*If non-nil, is the maximum distance to search for matching < 129 "*If non-nil, is the maximum distance to search for matching <.")
129 when > is inserted.")
130 130
131 (defun sgml-close-angle (arg) 131 (defun sgml-close-angle (arg)
132 "Insert > and display matching <." 132 "Insert > and display matching <."
133 (interactive "p") 133 (interactive "p")
134 (insert-char ?> arg) 134 (insert-char ?> arg)
200 (point))))))))))) 200 (point)))))))))))
201 201
202 ;;; I doubt that null end tags are used much for large elements, 202 ;;; I doubt that null end tags are used much for large elements,
203 ;;; so use a small distance here. 203 ;;; so use a small distance here.
204 (defconst sgml-slash-distance 1000 204 (defconst sgml-slash-distance 1000
205 "*If non-nil, is the maximum distance to search for matching / 205 "*If non-nil, is the maximum distance to search for matching /.")
206 when / is inserted.")
207 206
208 (defun sgml-slash (arg) 207 (defun sgml-slash (arg)
209 "Insert / and display any previous matching /. 208 "Insert / and display any previous matching /.
210 Two /s are treated as matching if the first / ends a net-enabling 209 Two /s are treated as matching if the first / ends a net-enabling
211 start tag, and the second / is the corresponding null end tag." 210 start tag, and the second / is the corresponding null end tag."
261 " " 260 " "
262 (let ((name (buffer-file-name))) 261 (let ((name (buffer-file-name)))
263 (and name 262 (and name
264 (file-name-nondirectory name)))))))) 263 (file-name-nondirectory name))))))))
265 (setq sgml-saved-validate-command command) 264 (setq sgml-saved-validate-command command)
266 (compile1 command "No more errors")) 265 (compile-internal command "No more errors"))
267 266
268 ;;; sgml-mode.el ends here 267 ;;; sgml-mode.el ends here