diff options
| author | Richard M. Stallman | 1998-07-19 00:04:01 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-07-19 00:04:01 +0000 |
| commit | a01588fc82a5b3206c439c921d7f44d5c8b9b16c (patch) | |
| tree | a736b822ce829b2222e887a8fcda0ac4b4223ba4 | |
| parent | 12837971248be10935c19021b71d80bb1826c560 (diff) | |
| download | emacs-a01588fc82a5b3206c439c921d7f44d5c8b9b16c.tar.gz emacs-a01588fc82a5b3206c439c921d7f44d5c8b9b16c.zip | |
(sgml-mode): Call kill-local-variables
here directly, then set major-mode, then call sgml-mode-common.
Run the hooks here at the end.
(html-mode): Likewise.
(sgml-mode-common): Don't call kill-local-variables; don't run hooks.
| -rw-r--r-- | lisp/textmodes/sgml-mode.el | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 3359b7616c5..6ce8faed903 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el | |||
| @@ -281,7 +281,6 @@ an optional alist of possible values." | |||
| 281 | SGML-TAG-FACE-ALIST is used for calculating `sgml-font-lock-keywords-2'. | 281 | SGML-TAG-FACE-ALIST is used for calculating `sgml-font-lock-keywords-2'. |
| 282 | SGML-DISPLAY-TEXT sets up alternate text for when tags are invisible (see | 282 | SGML-DISPLAY-TEXT sets up alternate text for when tags are invisible (see |
| 283 | varables of same name)." | 283 | varables of same name)." |
| 284 | (kill-all-local-variables) | ||
| 285 | (setq local-abbrev-table text-mode-abbrev-table) | 284 | (setq local-abbrev-table text-mode-abbrev-table) |
| 286 | (set-syntax-table sgml-mode-syntax-table) | 285 | (set-syntax-table sgml-mode-syntax-table) |
| 287 | (make-local-variable 'indent-line-function) | 286 | (make-local-variable 'indent-line-function) |
| @@ -346,8 +345,7 @@ varables of same name)." | |||
| 346 | (while sgml-display-text | 345 | (while sgml-display-text |
| 347 | (put (car (car sgml-display-text)) 'before-string | 346 | (put (car (car sgml-display-text)) 'before-string |
| 348 | (cdr (car sgml-display-text))) | 347 | (cdr (car sgml-display-text))) |
| 349 | (setq sgml-display-text (cdr sgml-display-text))) | 348 | (setq sgml-display-text (cdr sgml-display-text)))) |
| 350 | (run-hooks 'text-mode-hook 'sgml-mode-hook)) | ||
| 351 | 349 | ||
| 352 | 350 | ||
| 353 | (defun sgml-mode-facemenu-add-face-function (face end) | 351 | (defun sgml-mode-facemenu-add-face-function (face end) |
| @@ -379,6 +377,9 @@ Do \\[describe-variable] sgml- SPC to see available variables. | |||
| 379 | Do \\[describe-key] on the following bindings to discover what they do. | 377 | Do \\[describe-key] on the following bindings to discover what they do. |
| 380 | \\{sgml-mode-map}" | 378 | \\{sgml-mode-map}" |
| 381 | (interactive) | 379 | (interactive) |
| 380 | (kill-all-local-variables) | ||
| 381 | (setq mode-name "SGML" | ||
| 382 | major-mode 'sgml-mode) | ||
| 382 | (sgml-mode-common sgml-tag-face-alist sgml-display-text) | 383 | (sgml-mode-common sgml-tag-face-alist sgml-display-text) |
| 383 | ;; Set imenu-generic-expression here, rather than in sgml-mode-common, | 384 | ;; Set imenu-generic-expression here, rather than in sgml-mode-common, |
| 384 | ;; because this definition probably is not useful in HTML mode. | 385 | ;; because this definition probably is not useful in HTML mode. |
| @@ -386,9 +387,7 @@ Do \\[describe-key] on the following bindings to discover what they do. | |||
| 386 | (setq imenu-generic-expression | 387 | (setq imenu-generic-expression |
| 387 | "<!\\(element\\|entity\\)[ \t\n]+%?[ \t\n]*\\([A-Za-z][-A-Za-z.0-9]*\\)") | 388 | "<!\\(element\\|entity\\)[ \t\n]+%?[ \t\n]*\\([A-Za-z][-A-Za-z.0-9]*\\)") |
| 388 | (use-local-map sgml-mode-map) | 389 | (use-local-map sgml-mode-map) |
| 389 | (setq mode-name "SGML" | 390 | (run-hooks 'text-mode-hook 'sgml-mode-hook)) |
| 390 | major-mode 'sgml-mode)) | ||
| 391 | |||
| 392 | 391 | ||
| 393 | 392 | ||
| 394 | (defun sgml-comment-indent () | 393 | (defun sgml-comment-indent () |
| @@ -1180,6 +1179,9 @@ To work around that, do: | |||
| 1180 | 1179 | ||
| 1181 | \\{html-mode-map}" | 1180 | \\{html-mode-map}" |
| 1182 | (interactive) | 1181 | (interactive) |
| 1182 | (kill-all-local-variables) | ||
| 1183 | (setq mode-name "HTML" | ||
| 1184 | major-mode 'html-mode) | ||
| 1183 | (sgml-mode-common html-tag-face-alist html-display-text) | 1185 | (sgml-mode-common html-tag-face-alist html-display-text) |
| 1184 | (use-local-map html-mode-map) | 1186 | (use-local-map html-mode-map) |
| 1185 | (make-local-variable 'sgml-tag-alist) | 1187 | (make-local-variable 'sgml-tag-alist) |
| @@ -1191,9 +1193,7 @@ To work around that, do: | |||
| 1191 | (make-local-variable 'sentence-end) | 1193 | (make-local-variable 'sentence-end) |
| 1192 | (setq sentence-end | 1194 | (setq sentence-end |
| 1193 | "[.?!][]\"')}]*\\(<[^>]*>\\)*\\($\\| $\\|\t\\| \\)[ \t\n]*") | 1195 | "[.?!][]\"')}]*\\(<[^>]*>\\)*\\($\\| $\\|\t\\| \\)[ \t\n]*") |
| 1194 | (setq mode-name "HTML" | 1196 | (setq sgml-tag-alist html-tag-alist |
| 1195 | major-mode 'html-mode | ||
| 1196 | sgml-tag-alist html-tag-alist | ||
| 1197 | sgml-face-tag-alist html-face-tag-alist | 1197 | sgml-face-tag-alist html-face-tag-alist |
| 1198 | sgml-tag-help html-tag-help | 1198 | sgml-tag-help html-tag-help |
| 1199 | outline-regexp "^.*<[Hh][1-6]\\>" | 1199 | outline-regexp "^.*<[Hh][1-6]\\>" |
| @@ -1203,7 +1203,7 @@ To work around that, do: | |||
| 1203 | (setq imenu-create-index-function 'html-imenu-index) | 1203 | (setq imenu-create-index-function 'html-imenu-index) |
| 1204 | (make-local-variable 'imenu-sort-function) | 1204 | (make-local-variable 'imenu-sort-function) |
| 1205 | (setq imenu-sort-function nil) ; sorting the menu defeats the purpose | 1205 | (setq imenu-sort-function nil) ; sorting the menu defeats the purpose |
| 1206 | (run-hooks 'html-mode-hook)) | 1206 | (run-hooks 'text-mode-hook 'sgml-mode-hook 'html-mode-hook)) |
| 1207 | 1207 | ||
| 1208 | (defvar html-imenu-regexp | 1208 | (defvar html-imenu-regexp |
| 1209 | "\\s-*<h\\([1-9]\\)[^\n<>]*>\\(<[^\n<>]*>\\)*\\s-*\\([^\n<>]*\\)" | 1209 | "\\s-*<h\\([1-9]\\)[^\n<>]*>\\(<[^\n<>]*>\\)*\\s-*\\([^\n<>]*\\)" |