# HG changeset patch # User Richard M. Stallman # Date 900806641 0 # Node ID 3dc5c3a4f1f807b8bddaf41d92e5237d7eec373f # Parent bd6a5af23e19f68e78f25fcaa891ad0ddefbbdbb (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. diff -r bd6a5af23e19 -r 3dc5c3a4f1f8 lisp/textmodes/sgml-mode.el --- a/lisp/textmodes/sgml-mode.el Fri Jul 17 15:13:21 1998 +0000 +++ b/lisp/textmodes/sgml-mode.el Sun Jul 19 00:04:01 1998 +0000 @@ -281,7 +281,6 @@ SGML-TAG-FACE-ALIST is used for calculating `sgml-font-lock-keywords-2'. SGML-DISPLAY-TEXT sets up alternate text for when tags are invisible (see varables of same name)." - (kill-all-local-variables) (setq local-abbrev-table text-mode-abbrev-table) (set-syntax-table sgml-mode-syntax-table) (make-local-variable 'indent-line-function) @@ -346,8 +345,7 @@ (while sgml-display-text (put (car (car sgml-display-text)) 'before-string (cdr (car sgml-display-text))) - (setq sgml-display-text (cdr sgml-display-text))) - (run-hooks 'text-mode-hook 'sgml-mode-hook)) + (setq sgml-display-text (cdr sgml-display-text)))) (defun sgml-mode-facemenu-add-face-function (face end) @@ -379,6 +377,9 @@ Do \\[describe-key] on the following bindings to discover what they do. \\{sgml-mode-map}" (interactive) + (kill-all-local-variables) + (setq mode-name "SGML" + major-mode 'sgml-mode) (sgml-mode-common sgml-tag-face-alist sgml-display-text) ;; Set imenu-generic-expression here, rather than in sgml-mode-common, ;; because this definition probably is not useful in HTML mode. @@ -386,9 +387,7 @@ (setq imenu-generic-expression "]*>\\)*\\($\\| $\\|\t\\| \\)[ \t\n]*") - (setq mode-name "HTML" - major-mode 'html-mode - sgml-tag-alist html-tag-alist + (setq sgml-tag-alist html-tag-alist sgml-face-tag-alist html-face-tag-alist sgml-tag-help html-tag-help outline-regexp "^.*<[Hh][1-6]\\>" @@ -1203,7 +1203,7 @@ (setq imenu-create-index-function 'html-imenu-index) (make-local-variable 'imenu-sort-function) (setq imenu-sort-function nil) ; sorting the menu defeats the purpose - (run-hooks 'html-mode-hook)) + (run-hooks 'text-mode-hook 'sgml-mode-hook 'html-mode-hook)) (defvar html-imenu-regexp "\\s-*]*>\\(<[^\n<>]*>\\)*\\s-*\\([^\n<>]*\\)"