diff options
| author | Chong Yidong | 2012-12-01 12:09:55 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-12-01 12:09:55 +0800 |
| commit | 92eadba57fe86a49d67a7e3d797e3180ca0f6ae7 (patch) | |
| tree | 0b6588412e5b894cd2ee09e08fda5e52201d5ba9 | |
| parent | 75b4f59c279cbab4ad6a056b39f876b9a7518267 (diff) | |
| download | emacs-92eadba57fe86a49d67a7e3d797e3180ca0f6ae7.tar.gz emacs-92eadba57fe86a49d67a7e3d797e3180ca0f6ae7.zip | |
Convert several major modes to setq-local.
* emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/js.el (js-mode):
* progmodes/make-mode.el (makefile-mode, makefile-makepp-mode)
(makefile-bsdmake-mode, makefile-imake-mode, makefile-browse):
* progmodes/perl-mode.el (perl-mode):
* progmodes/sh-script.el (sh-mode, sh-set-shell):
* textmodes/css-mode.el (css-mode):
* textmodes/sgml-mode.el (html-mode, sgml-mode)
(sgml-tags-invisible, sgml-guess-indent):
* textmodes/tex-mode.el (tex-common-initialization)
(latex-complete-bibtex-keys, tex-shell, tex-main-file)
(doctex-mode, plain-tex-mode, latex-mode):
* textmodes/texinfo.el (texinfo-mode): Use setq-local.
| -rw-r--r-- | lisp/ChangeLog | 17 | ||||
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 51 | ||||
| -rw-r--r-- | lisp/progmodes/autoconf.el | 29 | ||||
| -rw-r--r-- | lisp/progmodes/js.el | 46 | ||||
| -rw-r--r-- | lisp/progmodes/make-mode.el | 58 | ||||
| -rw-r--r-- | lisp/progmodes/perl-mode.el | 32 | ||||
| -rw-r--r-- | lisp/progmodes/sh-script.el | 87 | ||||
| -rw-r--r-- | lisp/textmodes/css-mode.el | 21 | ||||
| -rw-r--r-- | lisp/textmodes/sgml-mode.el | 116 | ||||
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 101 | ||||
| -rw-r--r-- | lisp/textmodes/texinfo.el | 103 |
11 files changed, 308 insertions, 353 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4dc694e486c..334efbc10e1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2012-12-01 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/lisp-mode.el (lisp-mode-variables, lisp-mode): | ||
| 4 | * progmodes/autoconf.el (autoconf-mode): | ||
| 5 | * progmodes/js.el (js-mode): | ||
| 6 | * progmodes/make-mode.el (makefile-mode, makefile-makepp-mode) | ||
| 7 | (makefile-bsdmake-mode, makefile-imake-mode, makefile-browse): | ||
| 8 | * progmodes/perl-mode.el (perl-mode): | ||
| 9 | * progmodes/sh-script.el (sh-mode, sh-set-shell): | ||
| 10 | * textmodes/css-mode.el (css-mode): | ||
| 11 | * textmodes/sgml-mode.el (html-mode, sgml-mode) | ||
| 12 | (sgml-tags-invisible, sgml-guess-indent): | ||
| 13 | * textmodes/tex-mode.el (tex-common-initialization) | ||
| 14 | (latex-complete-bibtex-keys, tex-shell, tex-main-file) | ||
| 15 | (doctex-mode, plain-tex-mode, latex-mode): | ||
| 16 | * textmodes/texinfo.el (texinfo-mode): Use setq-local. | ||
| 17 | |||
| 1 | 2012-12-01 Kirk Kelsey <kirk.kelsey@0x4b.net> | 18 | 2012-12-01 Kirk Kelsey <kirk.kelsey@0x4b.net> |
| 2 | 19 | ||
| 3 | * vc/vc-hg.el (vc-hg-next-revision): | 20 | * vc/vc-hg.el (vc-hg-next-revision): |
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index bc61a24d9dc..81adab53c93 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -195,45 +195,33 @@ score-mode.el. KEYWORDS-CASE-INSENSITIVE non-nil means that for | |||
| 195 | font-lock keywords will not be case sensitive." | 195 | font-lock keywords will not be case sensitive." |
| 196 | (when lisp-syntax | 196 | (when lisp-syntax |
| 197 | (set-syntax-table lisp-mode-syntax-table)) | 197 | (set-syntax-table lisp-mode-syntax-table)) |
| 198 | (make-local-variable 'paragraph-ignore-fill-prefix) | 198 | (setq-local paragraph-ignore-fill-prefix t) |
| 199 | (setq paragraph-ignore-fill-prefix t) | 199 | (setq-local fill-paragraph-function 'lisp-fill-paragraph) |
| 200 | (make-local-variable 'fill-paragraph-function) | ||
| 201 | (setq fill-paragraph-function 'lisp-fill-paragraph) | ||
| 202 | ;; Adaptive fill mode gets the fill wrong for a one-line paragraph made of | 200 | ;; Adaptive fill mode gets the fill wrong for a one-line paragraph made of |
| 203 | ;; a single docstring. Let's fix it here. | 201 | ;; a single docstring. Let's fix it here. |
| 204 | (set (make-local-variable 'adaptive-fill-function) | 202 | (setq-local adaptive-fill-function |
| 205 | (lambda () (if (looking-at "\\s-+\"[^\n\"]+\"\\s-*$") ""))) | 203 | (lambda () (if (looking-at "\\s-+\"[^\n\"]+\"\\s-*$") ""))) |
| 206 | ;; Adaptive fill mode gets in the way of auto-fill, | 204 | ;; Adaptive fill mode gets in the way of auto-fill, |
| 207 | ;; and should make no difference for explicit fill | 205 | ;; and should make no difference for explicit fill |
| 208 | ;; because lisp-fill-paragraph should do the job. | 206 | ;; because lisp-fill-paragraph should do the job. |
| 209 | ;; I believe that newcomment's auto-fill code properly deals with it -stef | 207 | ;; I believe that newcomment's auto-fill code properly deals with it -stef |
| 210 | ;;(set (make-local-variable 'adaptive-fill-mode) nil) | 208 | ;;(set (make-local-variable 'adaptive-fill-mode) nil) |
| 211 | (make-local-variable 'indent-line-function) | 209 | (setq-local indent-line-function 'lisp-indent-line) |
| 212 | (setq indent-line-function 'lisp-indent-line) | 210 | (setq-local outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(") |
| 213 | (make-local-variable 'outline-regexp) | 211 | (setq-local outline-level 'lisp-outline-level) |
| 214 | (setq outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(") | 212 | (setq-local comment-start ";") |
| 215 | (make-local-variable 'outline-level) | ||
| 216 | (setq outline-level 'lisp-outline-level) | ||
| 217 | (make-local-variable 'comment-start) | ||
| 218 | (setq comment-start ";") | ||
| 219 | (make-local-variable 'comment-start-skip) | ||
| 220 | ;; Look within the line for a ; following an even number of backslashes | 213 | ;; Look within the line for a ; following an even number of backslashes |
| 221 | ;; after either a non-backslash or the line beginning. | 214 | ;; after either a non-backslash or the line beginning. |
| 222 | (setq comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") | 215 | (setq-local comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") |
| 223 | (make-local-variable 'font-lock-comment-start-skip) | ||
| 224 | ;; Font lock mode uses this only when it KNOWS a comment is starting. | 216 | ;; Font lock mode uses this only when it KNOWS a comment is starting. |
| 225 | (setq font-lock-comment-start-skip ";+ *") | 217 | (setq-local font-lock-comment-start-skip ";+ *") |
| 226 | (make-local-variable 'comment-add) | 218 | (setq-local comment-add 1) ;default to `;;' in comment-region |
| 227 | (setq comment-add 1) ;default to `;;' in comment-region | 219 | (setq-local comment-column 40) |
| 228 | (make-local-variable 'comment-column) | ||
| 229 | (setq comment-column 40) | ||
| 230 | ;; Don't get confused by `;' in doc strings when paragraph-filling. | 220 | ;; Don't get confused by `;' in doc strings when paragraph-filling. |
| 231 | (set (make-local-variable 'comment-use-global-state) t) | 221 | (setq-local comment-use-global-state t) |
| 232 | (make-local-variable 'imenu-generic-expression) | 222 | (setq-local imenu-generic-expression lisp-imenu-generic-expression) |
| 233 | (setq imenu-generic-expression lisp-imenu-generic-expression) | 223 | (setq-local multibyte-syntax-as-symbol t) |
| 234 | (make-local-variable 'multibyte-syntax-as-symbol) | 224 | (setq-local syntax-begin-function 'beginning-of-defun) |
| 235 | (setq multibyte-syntax-as-symbol t) | ||
| 236 | (set (make-local-variable 'syntax-begin-function) 'beginning-of-defun) | ||
| 237 | (setq font-lock-defaults | 225 | (setq font-lock-defaults |
| 238 | `((lisp-font-lock-keywords | 226 | `((lisp-font-lock-keywords |
| 239 | lisp-font-lock-keywords-1 lisp-font-lock-keywords-2) | 227 | lisp-font-lock-keywords-1 lisp-font-lock-keywords-2) |
| @@ -519,10 +507,9 @@ or to switch back to an existing one. | |||
| 519 | Entry to this mode calls the value of `lisp-mode-hook' | 507 | Entry to this mode calls the value of `lisp-mode-hook' |
| 520 | if that value is non-nil." | 508 | if that value is non-nil." |
| 521 | (lisp-mode-variables nil t) | 509 | (lisp-mode-variables nil t) |
| 522 | (set (make-local-variable 'find-tag-default-function) 'lisp-find-tag-default) | 510 | (setq-local find-tag-default-function 'lisp-find-tag-default) |
| 523 | (make-local-variable 'comment-start-skip) | 511 | (setq-local comment-start-skip |
| 524 | (setq comment-start-skip | 512 | "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") |
| 525 | "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") | ||
| 526 | (setq imenu-case-fold-search t)) | 513 | (setq imenu-case-fold-search t)) |
| 527 | 514 | ||
| 528 | (defun lisp-find-tag-default () | 515 | (defun lisp-find-tag-default () |
diff --git a/lisp/progmodes/autoconf.el b/lisp/progmodes/autoconf.el index ac3a7282952..5deb60f9e41 100644 --- a/lisp/progmodes/autoconf.el +++ b/lisp/progmodes/autoconf.el | |||
| @@ -78,22 +78,19 @@ searching backwards at another AC_... command." | |||
| 78 | ;;;###autoload | 78 | ;;;###autoload |
| 79 | (define-derived-mode autoconf-mode prog-mode "Autoconf" | 79 | (define-derived-mode autoconf-mode prog-mode "Autoconf" |
| 80 | "Major mode for editing Autoconf configure.ac files." | 80 | "Major mode for editing Autoconf configure.ac files." |
| 81 | (set (make-local-variable 'parens-require-spaces) nil) ; for M4 arg lists | 81 | (setq-local parens-require-spaces nil) ; for M4 arg lists |
| 82 | (set (make-local-variable 'defun-prompt-regexp) | 82 | (setq-local defun-prompt-regexp "^[ \t]*A[CM]_\\(\\sw\\|\\s_\\)+") |
| 83 | "^[ \t]*A[CM]_\\(\\sw\\|\\s_\\)+") | 83 | (setq-local comment-start "dnl ") |
| 84 | (set (make-local-variable 'comment-start) "dnl ") | 84 | (setq-local comment-start-skip "\\(?:\\(\\W\\|\\`\\)dnl\\|#\\) +") |
| 85 | (set (make-local-variable 'comment-start-skip) | 85 | (setq-local syntax-propertize-function |
| 86 | "\\(?:\\(\\W\\|\\`\\)dnl\\|#\\) +") | 86 | (syntax-propertize-rules ("\\<dnl\\>" (0 "<")))) |
| 87 | (set (make-local-variable 'syntax-propertize-function) | 87 | (setq-local font-lock-defaults |
| 88 | (syntax-propertize-rules ("\\<dnl\\>" (0 "<")))) | 88 | `(autoconf-font-lock-keywords nil nil (("_" . "w")))) |
| 89 | (set (make-local-variable 'font-lock-defaults) | 89 | (setq-local imenu-generic-expression autoconf-imenu-generic-expression) |
| 90 | `(autoconf-font-lock-keywords nil nil (("_" . "w")))) | 90 | (setq-local imenu-syntax-alist '(("_" . "w"))) |
| 91 | (set (make-local-variable 'imenu-generic-expression) | 91 | (setq-local indent-line-function #'indent-relative) |
| 92 | autoconf-imenu-generic-expression) | 92 | (setq-local add-log-current-defun-function |
| 93 | (set (make-local-variable 'imenu-syntax-alist) '(("_" . "w"))) | 93 | #'autoconf-current-defun-function)) |
| 94 | (set (make-local-variable 'indent-line-function) #'indent-relative) | ||
| 95 | (set (make-local-variable 'add-log-current-defun-function) | ||
| 96 | #'autoconf-current-defun-function)) | ||
| 97 | 94 | ||
| 98 | (provide 'autoconf-mode) | 95 | (provide 'autoconf-mode) |
| 99 | (provide 'autoconf) | 96 | (provide 'autoconf) |
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 33ef7607671..e6bba6a6609 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el | |||
| @@ -3306,29 +3306,21 @@ If one hasn't been set, or if it's stale, prompt for a new one." | |||
| 3306 | (define-derived-mode js-mode prog-mode "Javascript" | 3306 | (define-derived-mode js-mode prog-mode "Javascript" |
| 3307 | "Major mode for editing JavaScript." | 3307 | "Major mode for editing JavaScript." |
| 3308 | :group 'js | 3308 | :group 'js |
| 3309 | (setq-local indent-line-function 'js-indent-line) | ||
| 3310 | (setq-local beginning-of-defun-function 'js-beginning-of-defun) | ||
| 3311 | (setq-local end-of-defun-function 'js-end-of-defun) | ||
| 3312 | (setq-local open-paren-in-column-0-is-defun-start nil) | ||
| 3313 | (setq-local font-lock-defaults (list js--font-lock-keywords)) | ||
| 3314 | (setq-local syntax-propertize-function #'js-syntax-propertize) | ||
| 3309 | 3315 | ||
| 3310 | (set (make-local-variable 'indent-line-function) 'js-indent-line) | 3316 | (setq-local parse-sexp-ignore-comments t) |
| 3311 | (set (make-local-variable 'beginning-of-defun-function) | 3317 | (setq-local parse-sexp-lookup-properties t) |
| 3312 | 'js-beginning-of-defun) | 3318 | (setq-local which-func-imenu-joiner-function #'js--which-func-joiner) |
| 3313 | (set (make-local-variable 'end-of-defun-function) | ||
| 3314 | 'js-end-of-defun) | ||
| 3315 | |||
| 3316 | (set (make-local-variable 'open-paren-in-column-0-is-defun-start) nil) | ||
| 3317 | (set (make-local-variable 'font-lock-defaults) | ||
| 3318 | (list js--font-lock-keywords)) | ||
| 3319 | (set (make-local-variable 'syntax-propertize-function) | ||
| 3320 | #'js-syntax-propertize) | ||
| 3321 | |||
| 3322 | (set (make-local-variable 'parse-sexp-ignore-comments) t) | ||
| 3323 | (set (make-local-variable 'parse-sexp-lookup-properties) t) | ||
| 3324 | (set (make-local-variable 'which-func-imenu-joiner-function) | ||
| 3325 | #'js--which-func-joiner) | ||
| 3326 | 3319 | ||
| 3327 | ;; Comments | 3320 | ;; Comments |
| 3328 | (set (make-local-variable 'comment-start) "// ") | 3321 | (setq-local comment-start "// ") |
| 3329 | (set (make-local-variable 'comment-end) "") | 3322 | (setq-local comment-end "") |
| 3330 | (set (make-local-variable 'fill-paragraph-function) | 3323 | (setq-local fill-paragraph-function 'js-c-fill-paragraph) |
| 3331 | 'js-c-fill-paragraph) | ||
| 3332 | 3324 | ||
| 3333 | ;; Parse cache | 3325 | ;; Parse cache |
| 3334 | (add-hook 'before-change-functions #'js--flush-caches t t) | 3326 | (add-hook 'before-change-functions #'js--flush-caches t t) |
| @@ -3338,8 +3330,7 @@ If one hasn't been set, or if it's stale, prompt for a new one." | |||
| 3338 | 3330 | ||
| 3339 | ;; Imenu | 3331 | ;; Imenu |
| 3340 | (setq imenu-case-fold-search nil) | 3332 | (setq imenu-case-fold-search nil) |
| 3341 | (set (make-local-variable 'imenu-create-index-function) | 3333 | (setq imenu-create-index-function #'js--imenu-create-index) |
| 3342 | #'js--imenu-create-index) | ||
| 3343 | 3334 | ||
| 3344 | ;; for filling, pretend we're cc-mode | 3335 | ;; for filling, pretend we're cc-mode |
| 3345 | (setq c-comment-prefix-regexp "//+\\|\\**" | 3336 | (setq c-comment-prefix-regexp "//+\\|\\**" |
| @@ -3350,10 +3341,10 @@ If one hasn't been set, or if it's stale, prompt for a new one." | |||
| 3350 | c-comment-start-regexp "/[*/]\\|\\s!" | 3341 | c-comment-start-regexp "/[*/]\\|\\s!" |
| 3351 | comment-start-skip "\\(//+\\|/\\*+\\)\\s *") | 3342 | comment-start-skip "\\(//+\\|/\\*+\\)\\s *") |
| 3352 | 3343 | ||
| 3353 | (set (make-local-variable 'electric-indent-chars) | 3344 | (setq-local electric-indent-chars |
| 3354 | (append "{}():;," electric-indent-chars)) ;FIXME: js2-mode adds "[]*". | 3345 | (append "{}():;," electric-indent-chars)) ;FIXME: js2-mode adds "[]*". |
| 3355 | (set (make-local-variable 'electric-layout-rules) | 3346 | (setq-local electric-layout-rules |
| 3356 | '((?\; . after) (?\{ . after) (?\} . before))) | 3347 | '((?\; . after) (?\{ . after) (?\} . before))) |
| 3357 | 3348 | ||
| 3358 | (let ((c-buffer-is-cc-mode t)) | 3349 | (let ((c-buffer-is-cc-mode t)) |
| 3359 | ;; FIXME: These are normally set by `c-basic-common-init'. Should | 3350 | ;; FIXME: These are normally set by `c-basic-common-init'. Should |
| @@ -3365,8 +3356,7 @@ If one hasn't been set, or if it's stale, prompt for a new one." | |||
| 3365 | (make-local-variable 'adaptive-fill-regexp) | 3356 | (make-local-variable 'adaptive-fill-regexp) |
| 3366 | (c-setup-paragraph-variables)) | 3357 | (c-setup-paragraph-variables)) |
| 3367 | 3358 | ||
| 3368 | (set (make-local-variable 'syntax-begin-function) | 3359 | (setq-local syntax-begin-function #'js--syntax-begin-function) |
| 3369 | #'js--syntax-begin-function) | ||
| 3370 | 3360 | ||
| 3371 | ;; Important to fontify the whole buffer syntactically! If we don't, | 3361 | ;; Important to fontify the whole buffer syntactically! If we don't, |
| 3372 | ;; then we might have regular expression literals that aren't marked | 3362 | ;; then we might have regular expression literals that aren't marked |
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 2f4419ba2ea..8e8cd74c7be 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el | |||
| @@ -879,41 +879,42 @@ Makefile mode can be configured by modifying the following variables: | |||
| 879 | (make-local-variable 'makefile-need-macro-pickup) | 879 | (make-local-variable 'makefile-need-macro-pickup) |
| 880 | 880 | ||
| 881 | ;; Font lock. | 881 | ;; Font lock. |
| 882 | (set (make-local-variable 'font-lock-defaults) | 882 | (setq-local font-lock-defaults |
| 883 | ;; SYNTAX-BEGIN set to backward-paragraph to avoid slow-down | 883 | ;; Set SYNTAX-BEGIN to backward-paragraph to avoid |
| 884 | ;; near the end of a large buffer, due to parse-partial-sexp's | 884 | ;; slow-down near the end of a large buffer, due to |
| 885 | ;; trying to parse all the way till the beginning of buffer. | 885 | ;; `parse-partial-sexp' trying to parse all the way till |
| 886 | '(makefile-font-lock-keywords | 886 | ;; the beginning of buffer. |
| 887 | nil nil | 887 | '(makefile-font-lock-keywords |
| 888 | ((?$ . ".")) | 888 | nil nil |
| 889 | backward-paragraph)) | 889 | ((?$ . ".")) |
| 890 | (set (make-local-variable 'syntax-propertize-function) | 890 | backward-paragraph)) |
| 891 | makefile-syntax-propertize-function) | 891 | (setq-local syntax-propertize-function |
| 892 | makefile-syntax-propertize-function) | ||
| 892 | 893 | ||
| 893 | ;; Add-log. | 894 | ;; Add-log. |
| 894 | (set (make-local-variable 'add-log-current-defun-function) | 895 | (setq-local add-log-current-defun-function |
| 895 | 'makefile-add-log-defun) | 896 | 'makefile-add-log-defun) |
| 896 | 897 | ||
| 897 | ;; Imenu. | 898 | ;; Imenu. |
| 898 | (set (make-local-variable 'imenu-generic-expression) | 899 | (setq-local imenu-generic-expression |
| 899 | makefile-imenu-generic-expression) | 900 | makefile-imenu-generic-expression) |
| 900 | 901 | ||
| 901 | ;; Dabbrev. | 902 | ;; Dabbrev. |
| 902 | (set (make-local-variable 'dabbrev-abbrev-skip-leading-regexp) "\\$") | 903 | (setq-local dabbrev-abbrev-skip-leading-regexp "\\$") |
| 903 | 904 | ||
| 904 | ;; Other abbrevs. | 905 | ;; Other abbrevs. |
| 905 | (setq local-abbrev-table makefile-mode-abbrev-table) | 906 | (setq local-abbrev-table makefile-mode-abbrev-table) |
| 906 | 907 | ||
| 907 | ;; Filling. | 908 | ;; Filling. |
| 908 | (set (make-local-variable 'fill-paragraph-function) 'makefile-fill-paragraph) | 909 | (setq-local fill-paragraph-function 'makefile-fill-paragraph) |
| 909 | 910 | ||
| 910 | ;; Comment stuff. | 911 | ;; Comment stuff. |
| 911 | (set (make-local-variable 'comment-start) "#") | 912 | (setq-local comment-start "#") |
| 912 | (set (make-local-variable 'comment-end) "") | 913 | (setq-local comment-end "") |
| 913 | (set (make-local-variable 'comment-start-skip) "#+[ \t]*") | 914 | (setq-local comment-start-skip "#+[ \t]*") |
| 914 | 915 | ||
| 915 | ;; Make sure TAB really inserts \t. | 916 | ;; Make sure TAB really inserts \t. |
| 916 | (set (make-local-variable 'indent-line-function) 'indent-to-left-margin) | 917 | (setq-local indent-line-function 'indent-to-left-margin) |
| 917 | 918 | ||
| 918 | ;; Real TABs are important in makefiles | 919 | ;; Real TABs are important in makefiles |
| 919 | (setq indent-tabs-mode t)) | 920 | (setq indent-tabs-mode t)) |
| @@ -934,8 +935,7 @@ Makefile mode can be configured by modifying the following variables: | |||
| 934 | ;;;###autoload | 935 | ;;;###autoload |
| 935 | (define-derived-mode makefile-makepp-mode makefile-mode "Makeppfile" | 936 | (define-derived-mode makefile-makepp-mode makefile-mode "Makeppfile" |
| 936 | "An adapted `makefile-mode' that knows about makepp." | 937 | "An adapted `makefile-mode' that knows about makepp." |
| 937 | (set (make-local-variable 'makefile-rule-action-regex) | 938 | (setq-local makefile-rule-action-regex makefile-makepp-rule-action-regex) |
| 938 | makefile-makepp-rule-action-regex) | ||
| 939 | (setq font-lock-defaults | 939 | (setq font-lock-defaults |
| 940 | `(makefile-makepp-font-lock-keywords ,@(cdr font-lock-defaults)) | 940 | `(makefile-makepp-font-lock-keywords ,@(cdr font-lock-defaults)) |
| 941 | imenu-generic-expression | 941 | imenu-generic-expression |
| @@ -945,11 +945,9 @@ Makefile mode can be configured by modifying the following variables: | |||
| 945 | ;;;###autoload | 945 | ;;;###autoload |
| 946 | (define-derived-mode makefile-bsdmake-mode makefile-mode "BSDmakefile" | 946 | (define-derived-mode makefile-bsdmake-mode makefile-mode "BSDmakefile" |
| 947 | "An adapted `makefile-mode' that knows about BSD make." | 947 | "An adapted `makefile-mode' that knows about BSD make." |
| 948 | (set (make-local-variable 'makefile-dependency-regex) | 948 | (setq-local makefile-dependency-regex makefile-bsdmake-dependency-regex) |
| 949 | makefile-bsdmake-dependency-regex) | 949 | (setq-local makefile-dependency-skip "^:!") |
| 950 | (set (make-local-variable 'makefile-dependency-skip) "^:!") | 950 | (setq-local makefile-rule-action-regex makefile-bsdmake-rule-action-regex) |
| 951 | (set (make-local-variable 'makefile-rule-action-regex) | ||
| 952 | makefile-bsdmake-rule-action-regex) | ||
| 953 | (setq font-lock-defaults | 951 | (setq font-lock-defaults |
| 954 | `(makefile-bsdmake-font-lock-keywords ,@(cdr font-lock-defaults)))) | 952 | `(makefile-bsdmake-font-lock-keywords ,@(cdr font-lock-defaults)))) |
| 955 | 953 | ||
| @@ -957,7 +955,7 @@ Makefile mode can be configured by modifying the following variables: | |||
| 957 | (define-derived-mode makefile-imake-mode makefile-mode "Imakefile" | 955 | (define-derived-mode makefile-imake-mode makefile-mode "Imakefile" |
| 958 | "An adapted `makefile-mode' that knows about imake." | 956 | "An adapted `makefile-mode' that knows about imake." |
| 959 | :syntax-table makefile-imake-mode-syntax-table | 957 | :syntax-table makefile-imake-mode-syntax-table |
| 960 | (set (make-local-variable 'syntax-propertize-function) nil) | 958 | (setq-local syntax-propertize-function nil) |
| 961 | (setq font-lock-defaults | 959 | (setq font-lock-defaults |
| 962 | `(makefile-imake-font-lock-keywords ,@(cdr font-lock-defaults)))) | 960 | `(makefile-imake-font-lock-keywords ,@(cdr font-lock-defaults)))) |
| 963 | 961 | ||
| @@ -1501,8 +1499,8 @@ Insertion takes place at point." | |||
| 1501 | (pop-to-buffer browser-buffer) | 1499 | (pop-to-buffer browser-buffer) |
| 1502 | (makefile-browser-fill targets macros) | 1500 | (makefile-browser-fill targets macros) |
| 1503 | (shrink-window-if-larger-than-buffer) | 1501 | (shrink-window-if-larger-than-buffer) |
| 1504 | (set (make-local-variable 'makefile-browser-selection-vector) | 1502 | (setq-local makefile-browser-selection-vector |
| 1505 | (make-vector (+ (length targets) (length macros)) nil)) | 1503 | (make-vector (+ (length targets) (length macros)) nil)) |
| 1506 | (makefile-browser-start-interaction)))) | 1504 | (makefile-browser-start-interaction)))) |
| 1507 | 1505 | ||
| 1508 | (defun makefile-switch-to-browser () | 1506 | (defun makefile-switch-to-browser () |
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index d2f7fc7a059..f8ae0030cf0 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el | |||
| @@ -631,15 +631,15 @@ Various indentation styles: K&R BSD BLK GNU LW | |||
| 631 | 631 | ||
| 632 | Turning on Perl mode runs the normal hook `perl-mode-hook'." | 632 | Turning on Perl mode runs the normal hook `perl-mode-hook'." |
| 633 | :abbrev-table perl-mode-abbrev-table | 633 | :abbrev-table perl-mode-abbrev-table |
| 634 | (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter)) | 634 | (setq-local paragraph-start (concat "$\\|" page-delimiter)) |
| 635 | (set (make-local-variable 'paragraph-separate) paragraph-start) | 635 | (setq-local paragraph-separate paragraph-start) |
| 636 | (set (make-local-variable 'paragraph-ignore-fill-prefix) t) | 636 | (setq-local paragraph-ignore-fill-prefix t) |
| 637 | (set (make-local-variable 'indent-line-function) #'perl-indent-line) | 637 | (setq-local indent-line-function #'perl-indent-line) |
| 638 | (set (make-local-variable 'comment-start) "# ") | 638 | (setq-local comment-start "# ") |
| 639 | (set (make-local-variable 'comment-end) "") | 639 | (setq-local comment-end "") |
| 640 | (set (make-local-variable 'comment-start-skip) "\\(^\\|\\s-\\);?#+ *") | 640 | (setq-local comment-start-skip "\\(^\\|\\s-\\);?#+ *") |
| 641 | (set (make-local-variable 'comment-indent-function) #'perl-comment-indent) | 641 | (setq-local comment-indent-function #'perl-comment-indent) |
| 642 | (set (make-local-variable 'parse-sexp-ignore-comments) t) | 642 | (setq-local parse-sexp-ignore-comments t) |
| 643 | ;; Tell font-lock.el how to handle Perl. | 643 | ;; Tell font-lock.el how to handle Perl. |
| 644 | (setq font-lock-defaults '((perl-font-lock-keywords | 644 | (setq font-lock-defaults '((perl-font-lock-keywords |
| 645 | perl-font-lock-keywords-1 | 645 | perl-font-lock-keywords-1 |
| @@ -647,22 +647,20 @@ Turning on Perl mode runs the normal hook `perl-mode-hook'." | |||
| 647 | nil nil ((?\_ . "w")) nil | 647 | nil nil ((?\_ . "w")) nil |
| 648 | (font-lock-syntactic-face-function | 648 | (font-lock-syntactic-face-function |
| 649 | . perl-font-lock-syntactic-face-function))) | 649 | . perl-font-lock-syntactic-face-function))) |
| 650 | (set (make-local-variable 'syntax-propertize-function) | 650 | (setq-local syntax-propertize-function #'perl-syntax-propertize-function) |
| 651 | #'perl-syntax-propertize-function) | ||
| 652 | (add-hook 'syntax-propertize-extend-region-functions | 651 | (add-hook 'syntax-propertize-extend-region-functions |
| 653 | #'syntax-propertize-multiline 'append 'local) | 652 | #'syntax-propertize-multiline 'append 'local) |
| 654 | ;; Electricity. | 653 | ;; Electricity. |
| 655 | ;; FIXME: setup electric-layout-rules. | 654 | ;; FIXME: setup electric-layout-rules. |
| 656 | (set (make-local-variable 'electric-indent-chars) | 655 | (setq-local electric-indent-chars |
| 657 | (append '(?\{ ?\} ?\; ?\:) electric-indent-chars)) | 656 | (append '(?\{ ?\} ?\; ?\:) electric-indent-chars)) |
| 658 | (add-hook 'electric-indent-functions #'perl-electric-noindent-p nil t) | 657 | (add-hook 'electric-indent-functions #'perl-electric-noindent-p nil t) |
| 659 | ;; Tell imenu how to handle Perl. | 658 | ;; Tell imenu how to handle Perl. |
| 660 | (set (make-local-variable 'imenu-generic-expression) | 659 | (setq-local imenu-generic-expression perl-imenu-generic-expression) |
| 661 | perl-imenu-generic-expression) | ||
| 662 | (setq imenu-case-fold-search nil) | 660 | (setq imenu-case-fold-search nil) |
| 663 | ;; Setup outline-minor-mode. | 661 | ;; Setup outline-minor-mode. |
| 664 | (set (make-local-variable 'outline-regexp) perl-outline-regexp) | 662 | (setq-local outline-regexp perl-outline-regexp) |
| 665 | (set (make-local-variable 'outline-level) 'perl-outline-level)) | 663 | (setq-local outline-level 'perl-outline-level)) |
| 666 | 664 | ||
| 667 | ;; This is used by indent-for-comment | 665 | ;; This is used by indent-for-comment |
| 668 | ;; to decide how much to indent a comment in Perl code | 666 | ;; to decide how much to indent a comment in Perl code |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 5af14e51f49..243b712febb 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -1497,42 +1497,41 @@ with your script for an edit-interpret-debug cycle." | |||
| 1497 | (make-local-variable 'sh-shell-file) | 1497 | (make-local-variable 'sh-shell-file) |
| 1498 | (make-local-variable 'sh-shell) | 1498 | (make-local-variable 'sh-shell) |
| 1499 | 1499 | ||
| 1500 | (set (make-local-variable 'skeleton-pair-default-alist) | 1500 | (setq-local skeleton-pair-default-alist |
| 1501 | sh-skeleton-pair-default-alist) | 1501 | sh-skeleton-pair-default-alist) |
| 1502 | (set (make-local-variable 'skeleton-end-hook) | 1502 | (setq-local skeleton-end-hook |
| 1503 | (lambda () (or (eolp) (newline) (indent-relative)))) | 1503 | (lambda () (or (eolp) (newline) (indent-relative)))) |
| 1504 | 1504 | ||
| 1505 | (set (make-local-variable 'paragraph-start) (concat page-delimiter "\\|$")) | 1505 | (setq-local paragraph-start (concat page-delimiter "\\|$")) |
| 1506 | (set (make-local-variable 'paragraph-separate) paragraph-start) | 1506 | (setq-local paragraph-separate paragraph-start) |
| 1507 | (set (make-local-variable 'comment-start) "# ") | 1507 | (setq-local comment-start "# ") |
| 1508 | (set (make-local-variable 'comment-start-skip) "#+[\t ]*") | 1508 | (setq-local comment-start-skip "#+[\t ]*") |
| 1509 | (set (make-local-variable 'local-abbrev-table) sh-mode-abbrev-table) | 1509 | (setq-local local-abbrev-table sh-mode-abbrev-table) |
| 1510 | (set (make-local-variable 'comint-dynamic-complete-functions) | 1510 | (setq-local comint-dynamic-complete-functions |
| 1511 | sh-dynamic-complete-functions) | 1511 | sh-dynamic-complete-functions) |
| 1512 | (add-hook 'completion-at-point-functions 'comint-completion-at-point nil t) | 1512 | (add-hook 'completion-at-point-functions 'comint-completion-at-point nil t) |
| 1513 | ;; we can't look if previous line ended with `\' | 1513 | ;; we can't look if previous line ended with `\' |
| 1514 | (set (make-local-variable 'comint-prompt-regexp) "^[ \t]*") | 1514 | (setq-local comint-prompt-regexp "^[ \t]*") |
| 1515 | (set (make-local-variable 'imenu-case-fold-search) nil) | 1515 | (setq-local imenu-case-fold-search nil) |
| 1516 | (set (make-local-variable 'font-lock-defaults) | 1516 | (setq font-lock-defaults |
| 1517 | `((sh-font-lock-keywords | 1517 | `((sh-font-lock-keywords |
| 1518 | sh-font-lock-keywords-1 sh-font-lock-keywords-2) | 1518 | sh-font-lock-keywords-1 sh-font-lock-keywords-2) |
| 1519 | nil nil | 1519 | nil nil |
| 1520 | ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil | 1520 | ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil |
| 1521 | (font-lock-syntactic-face-function | 1521 | (font-lock-syntactic-face-function |
| 1522 | . sh-font-lock-syntactic-face-function))) | 1522 | . sh-font-lock-syntactic-face-function))) |
| 1523 | (set (make-local-variable 'syntax-propertize-function) | 1523 | (setq-local syntax-propertize-function #'sh-syntax-propertize-function) |
| 1524 | #'sh-syntax-propertize-function) | ||
| 1525 | (add-hook 'syntax-propertize-extend-region-functions | 1524 | (add-hook 'syntax-propertize-extend-region-functions |
| 1526 | #'syntax-propertize-multiline 'append 'local) | 1525 | #'syntax-propertize-multiline 'append 'local) |
| 1527 | (sh-electric-here-document-mode 1) | 1526 | (sh-electric-here-document-mode 1) |
| 1528 | (set (make-local-variable 'skeleton-pair-alist) '((?` _ ?`))) | 1527 | (setq-local skeleton-pair-alist '((?` _ ?`))) |
| 1529 | (set (make-local-variable 'skeleton-pair-filter-function) 'sh-quoted-p) | 1528 | (setq-local skeleton-pair-filter-function 'sh-quoted-p) |
| 1530 | (set (make-local-variable 'skeleton-further-elements) | 1529 | (setq-local skeleton-further-elements |
| 1531 | '((< '(- (min sh-indentation (current-column)))))) | 1530 | '((< '(- (min sh-indentation (current-column)))))) |
| 1532 | (set (make-local-variable 'skeleton-filter-function) 'sh-feature) | 1531 | (setq-local skeleton-filter-function 'sh-feature) |
| 1533 | (set (make-local-variable 'skeleton-newline-indent-rigidly) t) | 1532 | (setq-local skeleton-newline-indent-rigidly t) |
| 1534 | (set (make-local-variable 'defun-prompt-regexp) | 1533 | (setq-local defun-prompt-regexp |
| 1535 | (concat "^\\(function[ \t]\\|[[:alnum:]]+[ \t]+()[ \t]+\\)")) | 1534 | (concat "^\\(function[ \t]\\|[[:alnum:]]+[ \t]+()[ \t]+\\)")) |
| 1536 | ;; Parse or insert magic number for exec, and set all variables depending | 1535 | ;; Parse or insert magic number for exec, and set all variables depending |
| 1537 | ;; on the shell thus determined. | 1536 | ;; on the shell thus determined. |
| 1538 | (sh-set-shell | 1537 | (sh-set-shell |
| @@ -2104,19 +2103,19 @@ Calls the value of `sh-set-shell-hook' if set." | |||
| 2104 | (executable-set-magic shell (sh-feature sh-shell-arg) | 2103 | (executable-set-magic shell (sh-feature sh-shell-arg) |
| 2105 | no-query-flag insert-flag))) | 2104 | no-query-flag insert-flag))) |
| 2106 | (setq mode-line-process (format "[%s]" sh-shell)) | 2105 | (setq mode-line-process (format "[%s]" sh-shell)) |
| 2107 | (set (make-local-variable 'sh-shell-variables) nil) | 2106 | (setq-local sh-shell-variables nil) |
| 2108 | (set (make-local-variable 'sh-shell-variables-initialized) nil) | 2107 | (setq-local sh-shell-variables-initialized nil) |
| 2109 | (set (make-local-variable 'imenu-generic-expression) | 2108 | (setq-local imenu-generic-expression |
| 2110 | (sh-feature sh-imenu-generic-expression)) | 2109 | (sh-feature sh-imenu-generic-expression)) |
| 2111 | (let ((tem (sh-feature sh-mode-syntax-table-input))) | 2110 | (let ((tem (sh-feature sh-mode-syntax-table-input))) |
| 2112 | (when tem | 2111 | (when tem |
| 2113 | (set (make-local-variable 'sh-mode-syntax-table) | 2112 | (setq-local sh-mode-syntax-table |
| 2114 | (apply 'sh-mode-syntax-table tem)) | 2113 | (apply 'sh-mode-syntax-table tem)) |
| 2115 | (set-syntax-table sh-mode-syntax-table))) | 2114 | (set-syntax-table sh-mode-syntax-table))) |
| 2116 | (dolist (var (sh-feature sh-variables)) | 2115 | (dolist (var (sh-feature sh-variables)) |
| 2117 | (sh-remember-variable var)) | 2116 | (sh-remember-variable var)) |
| 2118 | (if (set (make-local-variable 'sh-indent-supported-here) | 2117 | (if (setq-local sh-indent-supported-here |
| 2119 | (sh-feature sh-indent-supported)) | 2118 | (sh-feature sh-indent-supported)) |
| 2120 | (progn | 2119 | (progn |
| 2121 | (message "Setting up indent for shell type %s" sh-shell) | 2120 | (message "Setting up indent for shell type %s" sh-shell) |
| 2122 | (if sh-use-smie | 2121 | (if sh-use-smie |
| @@ -2127,16 +2126,16 @@ Calls the value of `sh-set-shell-hook' if set." | |||
| 2127 | (funcall mksym "rules") | 2126 | (funcall mksym "rules") |
| 2128 | :forward-token (funcall mksym "forward-token") | 2127 | :forward-token (funcall mksym "forward-token") |
| 2129 | :backward-token (funcall mksym "backward-token"))) | 2128 | :backward-token (funcall mksym "backward-token"))) |
| 2130 | (set (make-local-variable 'parse-sexp-lookup-properties) t) | 2129 | (setq-local parse-sexp-lookup-properties t) |
| 2131 | (set (make-local-variable 'sh-kw-alist) (sh-feature sh-kw)) | 2130 | (setq-local sh-kw-alist (sh-feature sh-kw)) |
| 2132 | (let ((regexp (sh-feature sh-kws-for-done))) | 2131 | (let ((regexp (sh-feature sh-kws-for-done))) |
| 2133 | (if regexp | 2132 | (if regexp |
| 2134 | (set (make-local-variable 'sh-regexp-for-done) | 2133 | (setq-local sh-regexp-for-done |
| 2135 | (sh-mkword-regexpr (regexp-opt regexp t))))) | 2134 | (sh-mkword-regexpr (regexp-opt regexp t))))) |
| 2136 | (message "setting up indent stuff") | 2135 | (message "setting up indent stuff") |
| 2137 | ;; sh-mode has already made indent-line-function local | 2136 | ;; sh-mode has already made indent-line-function local |
| 2138 | ;; but do it in case this is called before that. | 2137 | ;; but do it in case this is called before that. |
| 2139 | (set (make-local-variable 'indent-line-function) 'sh-indent-line)) | 2138 | (setq-local indent-line-function 'sh-indent-line)) |
| 2140 | (if sh-make-vars-local | 2139 | (if sh-make-vars-local |
| 2141 | (sh-make-vars-local)) | 2140 | (sh-make-vars-local)) |
| 2142 | (message "Indentation setup for shell type %s" sh-shell)) | 2141 | (message "Indentation setup for shell type %s" sh-shell)) |
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index d50aadef25b..ba104e7b394 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el | |||
| @@ -266,22 +266,21 @@ | |||
| 266 | ;;;###autoload | 266 | ;;;###autoload |
| 267 | (define-derived-mode css-mode fundamental-mode "CSS" | 267 | (define-derived-mode css-mode fundamental-mode "CSS" |
| 268 | "Major mode to edit Cascading Style Sheets." | 268 | "Major mode to edit Cascading Style Sheets." |
| 269 | (set (make-local-variable 'font-lock-defaults) css-font-lock-defaults) | 269 | (setq-local font-lock-defaults css-font-lock-defaults) |
| 270 | (set (make-local-variable 'comment-start) "/*") | 270 | (setq-local comment-start "/*") |
| 271 | (set (make-local-variable 'comment-start-skip) "/\\*+[ \t]*") | 271 | (setq-local comment-start-skip "/\\*+[ \t]*") |
| 272 | (set (make-local-variable 'comment-end) "*/") | 272 | (setq-local comment-end "*/") |
| 273 | (set (make-local-variable 'comment-end-skip) "[ \t]*\\*+/") | 273 | (setq-local comment-end-skip "[ \t]*\\*+/") |
| 274 | (set (make-local-variable 'forward-sexp-function) 'css-forward-sexp) | 274 | (setq-local forward-sexp-function 'css-forward-sexp) |
| 275 | (set (make-local-variable 'parse-sexp-ignore-comments) t) | 275 | (setq-local parse-sexp-ignore-comments t) |
| 276 | (set (make-local-variable 'indent-line-function) 'css-indent-line) | 276 | (setq-local indent-line-function 'css-indent-line) |
| 277 | (set (make-local-variable 'fill-paragraph-function) | 277 | (setq-local fill-paragraph-function 'css-fill-paragraph) |
| 278 | 'css-fill-paragraph) | ||
| 279 | (when css-electric-keys | 278 | (when css-electric-keys |
| 280 | (let ((fc (make-char-table 'auto-fill-chars))) | 279 | (let ((fc (make-char-table 'auto-fill-chars))) |
| 281 | (set-char-table-parent fc auto-fill-chars) | 280 | (set-char-table-parent fc auto-fill-chars) |
| 282 | (dolist (c css-electric-keys) | 281 | (dolist (c css-electric-keys) |
| 283 | (aset fc c 'indent-according-to-mode)) | 282 | (aset fc c 'indent-according-to-mode)) |
| 284 | (set (make-local-variable 'auto-fill-chars) fc)))) | 283 | (setq-local auto-fill-chars fc)))) |
| 285 | 284 | ||
| 286 | (defvar comment-continue) | 285 | (defvar comment-continue) |
| 287 | 286 | ||
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index ed031664246..820822222af 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el | |||
| @@ -463,47 +463,39 @@ Do \\[describe-key] on the following bindings to discover what they do. | |||
| 463 | ;; A start or end tag by itself on a line separates a paragraph. | 463 | ;; A start or end tag by itself on a line separates a paragraph. |
| 464 | ;; This is desirable because SGML discards a newline that appears | 464 | ;; This is desirable because SGML discards a newline that appears |
| 465 | ;; immediately after a start tag or immediately before an end tag. | 465 | ;; immediately after a start tag or immediately before an end tag. |
| 466 | (set (make-local-variable 'paragraph-start) (concat "[ \t]*$\\|\ | 466 | (setq-local paragraph-start (concat "[ \t]*$\\|\ |
| 467 | \[ \t]*</?\\(" sgml-name-re sgml-attrs-re "\\)?>")) | 467 | \[ \t]*</?\\(" sgml-name-re sgml-attrs-re "\\)?>")) |
| 468 | (set (make-local-variable 'paragraph-separate) | 468 | (setq-local paragraph-separate (concat paragraph-start "$")) |
| 469 | (concat paragraph-start "$")) | 469 | (setq-local adaptive-fill-regexp "[ \t]*") |
| 470 | (set (make-local-variable 'adaptive-fill-regexp) "[ \t]*") | ||
| 471 | (add-hook 'fill-nobreak-predicate 'sgml-fill-nobreak nil t) | 470 | (add-hook 'fill-nobreak-predicate 'sgml-fill-nobreak nil t) |
| 472 | (set (make-local-variable 'indent-line-function) 'sgml-indent-line) | 471 | (setq-local indent-line-function 'sgml-indent-line) |
| 473 | (set (make-local-variable 'comment-start) "<!-- ") | 472 | (setq-local comment-start "<!-- ") |
| 474 | (set (make-local-variable 'comment-end) " -->") | 473 | (setq-local comment-end " -->") |
| 475 | (set (make-local-variable 'comment-indent-function) 'sgml-comment-indent) | 474 | (setq-local comment-indent-function 'sgml-comment-indent) |
| 476 | (set (make-local-variable 'comment-line-break-function) | 475 | (setq-local comment-line-break-function 'sgml-comment-indent-new-line) |
| 477 | 'sgml-comment-indent-new-line) | 476 | (setq-local skeleton-further-elements '((completion-ignore-case t))) |
| 478 | (set (make-local-variable 'skeleton-further-elements) | 477 | (setq-local skeleton-end-hook |
| 479 | '((completion-ignore-case t))) | 478 | (lambda () |
| 480 | (set (make-local-variable 'skeleton-end-hook) | 479 | (or (eolp) |
| 481 | (lambda () | 480 | (not (or (eq v2 '\n) (eq (car-safe v2) '\n))) |
| 482 | (or (eolp) | 481 | (newline-and-indent)))) |
| 483 | (not (or (eq v2 '\n) (eq (car-safe v2) '\n))) | 482 | (setq font-lock-defaults '((sgml-font-lock-keywords |
| 484 | (newline-and-indent)))) | 483 | sgml-font-lock-keywords-1 |
| 485 | (set (make-local-variable 'font-lock-defaults) | 484 | sgml-font-lock-keywords-2) |
| 486 | '((sgml-font-lock-keywords | 485 | nil t)) |
| 487 | sgml-font-lock-keywords-1 | 486 | (setq-local syntax-propertize-function sgml-syntax-propertize-function) |
| 488 | sgml-font-lock-keywords-2) | 487 | (setq-local facemenu-add-face-function 'sgml-mode-facemenu-add-face-function) |
| 489 | nil t)) | 488 | (setq-local sgml-xml-mode (sgml-xml-guess)) |
| 490 | (set (make-local-variable 'syntax-propertize-function) | 489 | (unless sgml-xml-mode |
| 491 | sgml-syntax-propertize-function) | 490 | (setq-local skeleton-transformation-function sgml-transformation-function)) |
| 492 | (set (make-local-variable 'facemenu-add-face-function) | ||
| 493 | 'sgml-mode-facemenu-add-face-function) | ||
| 494 | (set (make-local-variable 'sgml-xml-mode) (sgml-xml-guess)) | ||
| 495 | (if sgml-xml-mode | ||
| 496 | () | ||
| 497 | (set (make-local-variable 'skeleton-transformation-function) | ||
| 498 | sgml-transformation-function)) | ||
| 499 | ;; This will allow existing comments within declarations to be | 491 | ;; This will allow existing comments within declarations to be |
| 500 | ;; recognized. | 492 | ;; recognized. |
| 501 | ;; I can't find a clear description of SGML/XML comments, but it seems that | 493 | ;; I can't find a clear description of SGML/XML comments, but it seems that |
| 502 | ;; the only reliable ones are <!-- ... --> although it's not clear what | 494 | ;; the only reliable ones are <!-- ... --> although it's not clear what |
| 503 | ;; "..." can contain. It used to accept -- ... -- as well, but that was | 495 | ;; "..." can contain. It used to accept -- ... -- as well, but that was |
| 504 | ;; apparently a mistake. | 496 | ;; apparently a mistake. |
| 505 | (set (make-local-variable 'comment-start-skip) "<!--[ \t]*") | 497 | (setq-local comment-start-skip "<!--[ \t]*") |
| 506 | (set (make-local-variable 'comment-end-skip) "[ \t]*--[ \t\n]*>") | 498 | (setq-local comment-end-skip "[ \t]*--[ \t\n]*>") |
| 507 | ;; This definition has an HTML leaning but probably fits well for other modes. | 499 | ;; This definition has an HTML leaning but probably fits well for other modes. |
| 508 | (setq imenu-generic-expression | 500 | (setq imenu-generic-expression |
| 509 | `((nil | 501 | `((nil |
| @@ -982,10 +974,10 @@ With prefix argument ARG, repeat this ARG times." | |||
| 982 | (unwind-protect | 974 | (unwind-protect |
| 983 | (save-excursion | 975 | (save-excursion |
| 984 | (goto-char (point-min)) | 976 | (goto-char (point-min)) |
| 985 | (if (set (make-local-variable 'sgml-tags-invisible) | 977 | (if (setq-local sgml-tags-invisible |
| 986 | (if arg | 978 | (if arg |
| 987 | (>= (prefix-numeric-value arg) 0) | 979 | (>= (prefix-numeric-value arg) 0) |
| 988 | (not sgml-tags-invisible))) | 980 | (not sgml-tags-invisible))) |
| 989 | (while (re-search-forward sgml-tag-name-re nil t) | 981 | (while (re-search-forward sgml-tag-name-re nil t) |
| 990 | (setq string | 982 | (setq string |
| 991 | (cdr (assq (intern-soft (downcase (match-string 1))) | 983 | (cdr (assq (intern-soft (downcase (match-string 1))) |
| @@ -1564,8 +1556,7 @@ Add this to `sgml-mode-hook' for convenience." | |||
| 1564 | (goto-char (point-min)) | 1556 | (goto-char (point-min)) |
| 1565 | (if (re-search-forward "^\\([ \t]+\\)<" 500 'noerror) | 1557 | (if (re-search-forward "^\\([ \t]+\\)<" 500 'noerror) |
| 1566 | (progn | 1558 | (progn |
| 1567 | (set (make-local-variable 'sgml-basic-offset) | 1559 | (setq-local sgml-basic-offset (1- (current-column))) |
| 1568 | (1- (current-column))) | ||
| 1569 | (message "Guessed sgml-basic-offset = %d" | 1560 | (message "Guessed sgml-basic-offset = %d" |
| 1570 | sgml-basic-offset) | 1561 | sgml-basic-offset) |
| 1571 | )))) | 1562 | )))) |
| @@ -1979,33 +1970,28 @@ To work around that, do: | |||
| 1979 | (eval-after-load \"sgml-mode\" '(aset sgml-char-names ?' nil)) | 1970 | (eval-after-load \"sgml-mode\" '(aset sgml-char-names ?' nil)) |
| 1980 | 1971 | ||
| 1981 | \\{html-mode-map}" | 1972 | \\{html-mode-map}" |
| 1982 | (set (make-local-variable 'sgml-display-text) html-display-text) | 1973 | (setq-local sgml-display-text html-display-text) |
| 1983 | (set (make-local-variable 'sgml-tag-face-alist) html-tag-face-alist) | 1974 | (setq-local sgml-tag-face-alist html-tag-face-alist) |
| 1984 | (make-local-variable 'sgml-tag-alist) | 1975 | (setq-local sgml-tag-alist html-tag-alist) |
| 1985 | (make-local-variable 'sgml-face-tag-alist) | 1976 | (setq-local sgml-face-tag-alist html-face-tag-alist) |
| 1986 | (make-local-variable 'sgml-tag-help) | 1977 | (setq-local sgml-tag-help html-tag-help) |
| 1987 | (make-local-variable 'outline-regexp) | 1978 | (setq-local outline-regexp "^.*<[Hh][1-6]\\>") |
| 1988 | (make-local-variable 'outline-heading-end-regexp) | 1979 | (setq-local outline-heading-end-regexp "</[Hh][1-6]>") |
| 1989 | (make-local-variable 'outline-level) | 1980 | (setq-local outline-level |
| 1990 | (make-local-variable 'sentence-end-base) | 1981 | (lambda () (char-before (match-end 0)))) |
| 1991 | (setq sentence-end-base "[.?!][]\"'”)}]*\\(<[^>]*>\\)*" | 1982 | (setq-local sentence-end-base "[.?!][]\"'”)}]*\\(<[^>]*>\\)*") |
| 1992 | sgml-tag-alist html-tag-alist | 1983 | |
| 1993 | sgml-face-tag-alist html-face-tag-alist | ||
| 1994 | sgml-tag-help html-tag-help | ||
| 1995 | outline-regexp "^.*<[Hh][1-6]\\>" | ||
| 1996 | outline-heading-end-regexp "</[Hh][1-6]>" | ||
| 1997 | outline-level (lambda () | ||
| 1998 | (char-before (match-end 0)))) | ||
| 1999 | (setq imenu-create-index-function 'html-imenu-index) | 1984 | (setq imenu-create-index-function 'html-imenu-index) |
| 2000 | (set (make-local-variable 'sgml-empty-tags) | 1985 | |
| 2001 | ;; From HTML-4.01's loose.dtd, parsed with `sgml-parse-dtd', | 1986 | (setq-local sgml-empty-tags |
| 2002 | ;; plus manual addition of "wbr". | 1987 | ;; From HTML-4.01's loose.dtd, parsed with |
| 2003 | '("area" "base" "basefont" "br" "col" "frame" "hr" "img" "input" | 1988 | ;; `sgml-parse-dtd', plus manual addition of "wbr". |
| 2004 | "isindex" "link" "meta" "param" "wbr")) | 1989 | '("area" "base" "basefont" "br" "col" "frame" "hr" "img" "input" |
| 2005 | (set (make-local-variable 'sgml-unclosed-tags) | 1990 | "isindex" "link" "meta" "param" "wbr")) |
| 2006 | ;; From HTML-4.01's loose.dtd, parsed with `sgml-parse-dtd'. | 1991 | (setq-local sgml-unclosed-tags |
| 2007 | '("body" "colgroup" "dd" "dt" "head" "html" "li" "option" | 1992 | ;; From HTML-4.01's loose.dtd, parsed with `sgml-parse-dtd'. |
| 2008 | "p" "tbody" "td" "tfoot" "th" "thead" "tr")) | 1993 | '("body" "colgroup" "dd" "dt" "head" "html" "li" "option" |
| 1994 | "p" "tbody" "td" "tfoot" "th" "thead" "tr")) | ||
| 2009 | ;; It's for the user to decide if it defeats it or not -stef | 1995 | ;; It's for the user to decide if it defeats it or not -stef |
| 2010 | ;; (make-local-variable 'imenu-sort-function) | 1996 | ;; (make-local-variable 'imenu-sort-function) |
| 2011 | ;; (setq imenu-sort-function nil) ; sorting the menu defeats the purpose | 1997 | ;; (setq imenu-sort-function nil) ; sorting the menu defeats the purpose |
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 062f43be57b..c4fe0d629b4 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -1062,10 +1062,10 @@ tex-show-queue-command | |||
| 1062 | Entering Plain-tex mode runs the hook `text-mode-hook', then the hook | 1062 | Entering Plain-tex mode runs the hook `text-mode-hook', then the hook |
| 1063 | `tex-mode-hook', and finally the hook `plain-tex-mode-hook'. When the | 1063 | `tex-mode-hook', and finally the hook `plain-tex-mode-hook'. When the |
| 1064 | special subshell is initiated, the hook `tex-shell-hook' is run." | 1064 | special subshell is initiated, the hook `tex-shell-hook' is run." |
| 1065 | (set (make-local-variable 'tex-command) tex-run-command) | 1065 | (setq-local tex-command tex-run-command) |
| 1066 | (set (make-local-variable 'tex-start-of-header) "%\\*\\*start of header") | 1066 | (setq-local tex-start-of-header "%\\*\\*start of header") |
| 1067 | (set (make-local-variable 'tex-end-of-header) "%\\*\\*end of header") | 1067 | (setq-local tex-end-of-header "%\\*\\*end of header") |
| 1068 | (set (make-local-variable 'tex-trailer) "\\bye\n")) | 1068 | (setq-local tex-trailer "\\bye\n")) |
| 1069 | 1069 | ||
| 1070 | ;;;###autoload | 1070 | ;;;###autoload |
| 1071 | (define-derived-mode latex-mode tex-mode "LaTeX" | 1071 | (define-derived-mode latex-mode tex-mode "LaTeX" |
| @@ -1108,11 +1108,10 @@ tex-show-queue-command | |||
| 1108 | Entering Latex mode runs the hook `text-mode-hook', then | 1108 | Entering Latex mode runs the hook `text-mode-hook', then |
| 1109 | `tex-mode-hook', and finally `latex-mode-hook'. When the special | 1109 | `tex-mode-hook', and finally `latex-mode-hook'. When the special |
| 1110 | subshell is initiated, `tex-shell-hook' is run." | 1110 | subshell is initiated, `tex-shell-hook' is run." |
| 1111 | (set (make-local-variable 'tex-command) latex-run-command) | 1111 | (setq-local tex-command latex-run-command) |
| 1112 | (set (make-local-variable 'tex-start-of-header) | 1112 | (setq-local tex-start-of-header "\\\\document\\(style\\|class\\)") |
| 1113 | "\\\\document\\(style\\|class\\)") | 1113 | (setq-local tex-end-of-header "\\\\begin\\s-*{document}") |
| 1114 | (set (make-local-variable 'tex-end-of-header) "\\\\begin\\s-*{document}") | 1114 | (setq-local tex-trailer "\\end{document}\n") |
| 1115 | (set (make-local-variable 'tex-trailer) "\\end{document}\n") | ||
| 1116 | ;; A line containing just $$ is treated as a paragraph separator. | 1115 | ;; A line containing just $$ is treated as a paragraph separator. |
| 1117 | ;; A line starting with $$ starts a paragraph, | 1116 | ;; A line starting with $$ starts a paragraph, |
| 1118 | ;; but does not separate paragraphs if it has more stuff on it. | 1117 | ;; but does not separate paragraphs if it has more stuff on it. |
| @@ -1138,18 +1137,17 @@ subshell is initiated, `tex-shell-hook' is run." | |||
| 1138 | "marginpar" "parbox" "caption")) | 1137 | "marginpar" "parbox" "caption")) |
| 1139 | "\\|\\$\\$\\|[a-z]*\\(space\\|skip\\|page[a-z]*\\)" | 1138 | "\\|\\$\\$\\|[a-z]*\\(space\\|skip\\|page[a-z]*\\)" |
| 1140 | "\\>\\)[ \t]*\\($\\|%\\)\\)")) | 1139 | "\\>\\)[ \t]*\\($\\|%\\)\\)")) |
| 1141 | (set (make-local-variable 'imenu-create-index-function) | 1140 | (setq-local imenu-create-index-function 'latex-imenu-create-index) |
| 1142 | 'latex-imenu-create-index) | 1141 | (setq-local tex-face-alist tex-latex-face-alist) |
| 1143 | (set (make-local-variable 'tex-face-alist) tex-latex-face-alist) | ||
| 1144 | (add-hook 'fill-nobreak-predicate 'latex-fill-nobreak-predicate nil t) | 1142 | (add-hook 'fill-nobreak-predicate 'latex-fill-nobreak-predicate nil t) |
| 1145 | (set (make-local-variable 'indent-line-function) 'latex-indent) | 1143 | (setq-local indent-line-function 'latex-indent) |
| 1146 | (set (make-local-variable 'fill-indent-according-to-mode) t) | 1144 | (setq-local fill-indent-according-to-mode t) |
| 1147 | (add-hook 'completion-at-point-functions | 1145 | (add-hook 'completion-at-point-functions |
| 1148 | 'latex-complete-data nil 'local) | 1146 | 'latex-complete-data nil 'local) |
| 1149 | (set (make-local-variable 'outline-regexp) latex-outline-regexp) | 1147 | (setq-local outline-regexp latex-outline-regexp) |
| 1150 | (set (make-local-variable 'outline-level) 'latex-outline-level) | 1148 | (setq-local outline-level 'latex-outline-level) |
| 1151 | (set (make-local-variable 'forward-sexp-function) 'latex-forward-sexp) | 1149 | (setq-local forward-sexp-function 'latex-forward-sexp) |
| 1152 | (set (make-local-variable 'skeleton-end-hook) nil)) | 1150 | (setq-local skeleton-end-hook nil)) |
| 1153 | 1151 | ||
| 1154 | ;;;###autoload | 1152 | ;;;###autoload |
| 1155 | (define-derived-mode slitex-mode latex-mode "SliTeX" | 1153 | (define-derived-mode slitex-mode latex-mode "SliTeX" |
| @@ -1198,39 +1196,35 @@ Entering SliTeX mode runs the hook `text-mode-hook', then the hook | |||
| 1198 | 1196 | ||
| 1199 | (defun tex-common-initialization () | 1197 | (defun tex-common-initialization () |
| 1200 | ;; Regexp isearch should accept newline and formfeed as whitespace. | 1198 | ;; Regexp isearch should accept newline and formfeed as whitespace. |
| 1201 | (set (make-local-variable 'search-whitespace-regexp) "[ \t\r\n\f]+") | 1199 | (setq-local search-whitespace-regexp "[ \t\r\n\f]+") |
| 1202 | ;; A line containing just $$ is treated as a paragraph separator. | 1200 | ;; A line containing just $$ is treated as a paragraph separator. |
| 1203 | (set (make-local-variable 'paragraph-start) | 1201 | (setq-local paragraph-start "[ \t]*$\\|[\f\\\\%]\\|[ \t]*\\$\\$") |
| 1204 | "[ \t]*$\\|[\f\\\\%]\\|[ \t]*\\$\\$") | ||
| 1205 | ;; A line starting with $$ starts a paragraph, | 1202 | ;; A line starting with $$ starts a paragraph, |
| 1206 | ;; but does not separate paragraphs if it has more stuff on it. | 1203 | ;; but does not separate paragraphs if it has more stuff on it. |
| 1207 | (set (make-local-variable 'paragraph-separate) | 1204 | (setq-local paragraph-separate "[ \t]*$\\|[\f\\\\%]\\|[ \t]*\\$\\$[ \t]*$") |
| 1208 | "[ \t]*$\\|[\f\\\\%]\\|[ \t]*\\$\\$[ \t]*$") | 1205 | (setq-local comment-start "%") |
| 1209 | (set (make-local-variable 'comment-start) "%") | 1206 | (setq-local comment-add 1) |
| 1210 | (set (make-local-variable 'comment-add) 1) | 1207 | (setq-local comment-start-skip |
| 1211 | (set (make-local-variable 'comment-start-skip) | 1208 | "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(%+ *\\)") |
| 1212 | "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(%+ *\\)") | 1209 | (setq-local parse-sexp-ignore-comments t) |
| 1213 | (set (make-local-variable 'parse-sexp-ignore-comments) t) | 1210 | (setq-local compare-windows-whitespace 'tex-categorize-whitespace) |
| 1214 | (set (make-local-variable 'compare-windows-whitespace) | 1211 | (setq-local facemenu-add-face-function 'tex-facemenu-add-face-function) |
| 1215 | 'tex-categorize-whitespace) | 1212 | (setq-local facemenu-end-add-face "}") |
| 1216 | (set (make-local-variable 'facemenu-add-face-function) | 1213 | (setq-local facemenu-remove-face-function t) |
| 1217 | 'tex-facemenu-add-face-function) | 1214 | (setq-local font-lock-defaults |
| 1218 | (set (make-local-variable 'facemenu-end-add-face) "}") | 1215 | '((tex-font-lock-keywords tex-font-lock-keywords-1 |
| 1219 | (set (make-local-variable 'facemenu-remove-face-function) t) | 1216 | tex-font-lock-keywords-2 tex-font-lock-keywords-3) |
| 1220 | (set (make-local-variable 'font-lock-defaults) | 1217 | nil nil nil nil |
| 1221 | '((tex-font-lock-keywords tex-font-lock-keywords-1 | 1218 | ;; Who ever uses that anyway ??? |
| 1222 | tex-font-lock-keywords-2 tex-font-lock-keywords-3) | 1219 | (font-lock-mark-block-function . mark-paragraph) |
| 1223 | nil nil nil nil | 1220 | (font-lock-syntactic-face-function |
| 1224 | ;; Who ever uses that anyway ??? | 1221 | . tex-font-lock-syntactic-face-function) |
| 1225 | (font-lock-mark-block-function . mark-paragraph) | 1222 | (font-lock-unfontify-region-function |
| 1226 | (font-lock-syntactic-face-function | 1223 | . tex-font-lock-unfontify-region))) |
| 1227 | . tex-font-lock-syntactic-face-function) | 1224 | (setq-local syntax-propertize-function |
| 1228 | (font-lock-unfontify-region-function | 1225 | (syntax-propertize-rules latex-syntax-propertize-rules)) |
| 1229 | . tex-font-lock-unfontify-region))) | ||
| 1230 | (set (make-local-variable 'syntax-propertize-function) | ||
| 1231 | (syntax-propertize-rules latex-syntax-propertize-rules)) | ||
| 1232 | ;; TABs in verbatim environments don't do what you think. | 1226 | ;; TABs in verbatim environments don't do what you think. |
| 1233 | (set (make-local-variable 'indent-tabs-mode) nil) | 1227 | (setq-local indent-tabs-mode nil) |
| 1234 | ;; Other vars that should be buffer-local. | 1228 | ;; Other vars that should be buffer-local. |
| 1235 | (make-local-variable 'tex-command) | 1229 | (make-local-variable 'tex-command) |
| 1236 | (make-local-variable 'tex-start-of-header) | 1230 | (make-local-variable 'tex-start-of-header) |
| @@ -1523,8 +1517,7 @@ Puts point on a blank line between them." | |||
| 1523 | (looking-at bibtex-reference-key)) | 1517 | (looking-at bibtex-reference-key)) |
| 1524 | (push (match-string-no-properties 0) keys))))) | 1518 | (push (match-string-no-properties 0) keys))))) |
| 1525 | ;; Fill the cache. | 1519 | ;; Fill the cache. |
| 1526 | (set (make-local-variable 'latex-complete-bibtex-cache) | 1520 | (setq-local latex-complete-bibtex-cache (list files key keys))) |
| 1527 | (list files key keys))) | ||
| 1528 | (complete-with-action action keys key pred))))) | 1521 | (complete-with-action action keys key pred))))) |
| 1529 | 1522 | ||
| 1530 | (defun latex-complete-envnames () | 1523 | (defun latex-complete-envnames () |
| @@ -1885,8 +1878,7 @@ Mark is left at original location." | |||
| 1885 | ;; The utility functions: | 1878 | ;; The utility functions: |
| 1886 | 1879 | ||
| 1887 | (define-derived-mode tex-shell shell-mode "TeX-Shell" | 1880 | (define-derived-mode tex-shell shell-mode "TeX-Shell" |
| 1888 | (set (make-local-variable 'compilation-error-regexp-alist) | 1881 | (setq-local compilation-error-regexp-alist tex-error-regexp-alist) |
| 1889 | tex-error-regexp-alist) | ||
| 1890 | (compilation-shell-minor-mode t)) | 1882 | (compilation-shell-minor-mode t)) |
| 1891 | 1883 | ||
| 1892 | ;;;###autoload | 1884 | ;;;###autoload |
| @@ -2099,8 +2091,7 @@ of the current buffer." | |||
| 2099 | (with-no-warnings | 2091 | (with-no-warnings |
| 2100 | (when (boundp 'TeX-master) | 2092 | (when (boundp 'TeX-master) |
| 2101 | (cond ((stringp TeX-master) | 2093 | (cond ((stringp TeX-master) |
| 2102 | (make-local-variable 'tex-main-file) | 2094 | (setq-local tex-main-file TeX-master)) |
| 2103 | (setq tex-main-file TeX-master)) | ||
| 2104 | ((and (eq TeX-master t) buffer-file-name) | 2095 | ((and (eq TeX-master t) buffer-file-name) |
| 2105 | (file-relative-name buffer-file-name))))) | 2096 | (file-relative-name buffer-file-name))))) |
| 2106 | ;; Try to guess the main file. | 2097 | ;; Try to guess the main file. |
| @@ -2870,8 +2861,8 @@ There might be text before point." | |||
| 2870 | (cons (car x) 'doctex-font-lock-syntactic-face-function)) | 2861 | (cons (car x) 'doctex-font-lock-syntactic-face-function)) |
| 2871 | (_ x))) | 2862 | (_ x))) |
| 2872 | (cdr font-lock-defaults)))) | 2863 | (cdr font-lock-defaults)))) |
| 2873 | (set (make-local-variable 'syntax-propertize-function) | 2864 | (setq-local syntax-propertize-function |
| 2874 | (syntax-propertize-rules doctex-syntax-propertize-rules))) | 2865 | (syntax-propertize-rules doctex-syntax-propertize-rules))) |
| 2875 | 2866 | ||
| 2876 | (run-hooks 'tex-mode-load-hook) | 2867 | (run-hooks 'tex-mode-load-hook) |
| 2877 | 2868 | ||
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el index 4e7715dcea9..91405ba0744 100644 --- a/lisp/textmodes/texinfo.el +++ b/lisp/textmodes/texinfo.el | |||
| @@ -33,6 +33,15 @@ | |||
| 33 | ;;; Code: | 33 | ;;; Code: |
| 34 | 34 | ||
| 35 | (eval-when-compile (require 'tex-mode)) | 35 | (eval-when-compile (require 'tex-mode)) |
| 36 | (declare-function tex-buffer "tex-mode" ()) | ||
| 37 | (declare-function tex-region "tex-mode" (beg end)) | ||
| 38 | (declare-function tex-send-command "tex-mode") | ||
| 39 | (declare-function tex-recenter-output-buffer "tex-mode" (linenum)) | ||
| 40 | (declare-function tex-print "tex-mode" (&optional alt)) | ||
| 41 | (declare-function tex-view "tex-mode" ()) | ||
| 42 | (declare-function tex-shell-running "tex-mode" ()) | ||
| 43 | (declare-function tex-kill-job "tex-mode" ()) | ||
| 44 | |||
| 36 | (defvar outline-heading-alist) | 45 | (defvar outline-heading-alist) |
| 37 | 46 | ||
| 38 | (defgroup texinfo nil | 47 | (defgroup texinfo nil |
| @@ -571,66 +580,50 @@ be the first node in the file. | |||
| 571 | 580 | ||
| 572 | Entering Texinfo mode calls the value of `text-mode-hook', and then the | 581 | Entering Texinfo mode calls the value of `text-mode-hook', and then the |
| 573 | value of `texinfo-mode-hook'." | 582 | value of `texinfo-mode-hook'." |
| 574 | (set (make-local-variable 'page-delimiter) | 583 | (setq-local page-delimiter |
| 575 | (concat | 584 | (concat "^@node [ \t]*[Tt]op\\|^@\\(" |
| 576 | "^@node [ \t]*[Tt]op\\|^@\\(" | 585 | texinfo-chapter-level-regexp |
| 577 | texinfo-chapter-level-regexp | 586 | "\\)\\>")) |
| 578 | "\\)\\>")) | 587 | (setq-local require-final-newline mode-require-final-newline) |
| 579 | (make-local-variable 'require-final-newline) | 588 | (setq-local indent-tabs-mode nil) |
| 580 | (setq require-final-newline mode-require-final-newline) | 589 | (setq-local paragraph-separate |
| 581 | (make-local-variable 'indent-tabs-mode) | 590 | (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-separate)) |
| 582 | (setq indent-tabs-mode nil) | 591 | (setq-local paragraph-start (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-start)) |
| 583 | (make-local-variable 'paragraph-separate) | 592 | (setq-local sentence-end-base "\\(@\\(end\\)?dots{}\\|[.?!]\\)[]\"'”)}]*") |
| 584 | (setq paragraph-separate | 593 | (setq-local fill-column 70) |
| 585 | (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-separate)) | 594 | (setq-local comment-start "@c ") |
| 586 | (make-local-variable 'paragraph-start) | 595 | (setq-local comment-start-skip "@c +\\|@comment +") |
| 587 | (setq paragraph-start (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-start)) | 596 | (setq-local words-include-escapes t) |
| 588 | (set (make-local-variable 'sentence-end-base) | 597 | (setq-local imenu-generic-expression texinfo-imenu-generic-expression) |
| 589 | "\\(@\\(end\\)?dots{}\\|[.?!]\\)[]\"'”)}]*") | ||
| 590 | (make-local-variable 'fill-column) | ||
| 591 | (setq fill-column 70) | ||
| 592 | (make-local-variable 'comment-start) | ||
| 593 | (setq comment-start "@c ") | ||
| 594 | (make-local-variable 'comment-start-skip) | ||
| 595 | (setq comment-start-skip "@c +\\|@comment +") | ||
| 596 | (make-local-variable 'words-include-escapes) | ||
| 597 | (setq words-include-escapes t) | ||
| 598 | (make-local-variable 'imenu-generic-expression) | ||
| 599 | (setq imenu-generic-expression texinfo-imenu-generic-expression) | ||
| 600 | (setq imenu-case-fold-search nil) | 598 | (setq imenu-case-fold-search nil) |
| 601 | (make-local-variable 'font-lock-defaults) | ||
| 602 | (setq font-lock-defaults | 599 | (setq font-lock-defaults |
| 603 | '(texinfo-font-lock-keywords nil nil nil backward-paragraph)) | 600 | '(texinfo-font-lock-keywords nil nil nil backward-paragraph)) |
| 604 | (set (make-local-variable 'syntax-propertize-function) | 601 | (setq-local syntax-propertize-function texinfo-syntax-propertize-function) |
| 605 | texinfo-syntax-propertize-function) | 602 | (setq-local parse-sexp-lookup-properties t) |
| 606 | (set (make-local-variable 'parse-sexp-lookup-properties) t) | ||
| 607 | 603 | ||
| 608 | ;; Outline settings. | 604 | ;; Outline settings. |
| 609 | (set (make-local-variable 'outline-heading-alist) | 605 | (setq-local outline-heading-alist |
| 610 | ;; We should merge outline-heading-alist and texinfo-section-list | 606 | ;; We should merge `outline-heading-alist' and |
| 611 | ;; but in the mean time, let's just generate one from the other. | 607 | ;; `texinfo-section-list'. But in the mean time, let's |
| 612 | (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x))) | 608 | ;; just generate one from the other. |
| 613 | texinfo-section-list)) | 609 | (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x))) |
| 614 | (set (make-local-variable 'outline-regexp) | 610 | texinfo-section-list)) |
| 615 | (concat (regexp-opt (mapcar 'car outline-heading-alist) t) | 611 | (setq-local outline-regexp |
| 616 | "\\>")) | 612 | (concat (regexp-opt (mapcar 'car outline-heading-alist) t) |
| 617 | 613 | "\\>")) | |
| 618 | (make-local-variable 'tex-start-of-header) | 614 | |
| 619 | (setq tex-start-of-header "%\\*\\*start") | 615 | (setq-local tex-start-of-header "%\\*\\*start") |
| 620 | (make-local-variable 'tex-end-of-header) | 616 | (setq-local tex-end-of-header "%\\*\\*end") |
| 621 | (setq tex-end-of-header "%\\*\\*end") | 617 | (setq-local tex-first-line-header-regexp "^\\\\input") |
| 622 | (make-local-variable 'tex-first-line-header-regexp) | 618 | (setq-local tex-trailer "@bye\n") |
| 623 | (setq tex-first-line-header-regexp "^\\\\input") | 619 | |
| 624 | (make-local-variable 'tex-trailer) | 620 | ;; Prevent filling certain lines, in addition to ones specified by |
| 625 | (setq tex-trailer "@bye\n") | 621 | ;; the user. |
| 626 | 622 | (setq-local auto-fill-inhibit-regexp | |
| 627 | ;; Prevent filling certain lines, in addition to ones specified | 623 | (let ((prevent-filling "^@\\(def\\|multitable\\)")) |
| 628 | ;; by the user. | 624 | (if (null auto-fill-inhibit-regexp) |
| 629 | (let ((prevent-filling "^@\\(def\\|multitable\\)")) | 625 | prevent-filling |
| 630 | (set (make-local-variable 'auto-fill-inhibit-regexp) | 626 | (concat auto-fill-inhibit-regexp "\\|" prevent-filling))))) |
| 631 | (if (null auto-fill-inhibit-regexp) | ||
| 632 | prevent-filling | ||
| 633 | (concat auto-fill-inhibit-regexp "\\|" prevent-filling))))) | ||
| 634 | 627 | ||
| 635 | 628 | ||
| 636 | 629 | ||