diff options
author | Chong Yidong <cyd@gnu.org> | 2012-12-01 12:09:55 +0800 |
---|---|---|
committer | Chong Yidong <cyd@gnu.org> | 2012-12-01 12:09:55 +0800 |
commit | 92eadba57fe86a49d67a7e3d797e3180ca0f6ae7 (patch) | |
tree | 0b6588412e5b894cd2ee09e08fda5e52201d5ba9 /lisp/textmodes | |
parent | 75b4f59c279cbab4ad6a056b39f876b9a7518267 (diff) | |
download | emacs-92eadba57fe86a49d67a7e3d797e3180ca0f6ae7.tar.gz |
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.
Diffstat (limited to 'lisp/textmodes')
-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 |
4 files changed, 155 insertions, 186 deletions
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 @@ ;;;###autoload (define-derived-mode css-mode fundamental-mode "CSS" "Major mode to edit Cascading Style Sheets." - (set (make-local-variable 'font-lock-defaults) css-font-lock-defaults) - (set (make-local-variable 'comment-start) "/*") - (set (make-local-variable 'comment-start-skip) "/\\*+[ \t]*") - (set (make-local-variable 'comment-end) "*/") - (set (make-local-variable 'comment-end-skip) "[ \t]*\\*+/") - (set (make-local-variable 'forward-sexp-function) 'css-forward-sexp) - (set (make-local-variable 'parse-sexp-ignore-comments) t) - (set (make-local-variable 'indent-line-function) 'css-indent-line) - (set (make-local-variable 'fill-paragraph-function) - 'css-fill-paragraph) + (setq-local font-lock-defaults css-font-lock-defaults) + (setq-local comment-start "/*") + (setq-local comment-start-skip "/\\*+[ \t]*") + (setq-local comment-end "*/") + (setq-local comment-end-skip "[ \t]*\\*+/") + (setq-local forward-sexp-function 'css-forward-sexp) + (setq-local parse-sexp-ignore-comments t) + (setq-local indent-line-function 'css-indent-line) + (setq-local fill-paragraph-function 'css-fill-paragraph) (when css-electric-keys (let ((fc (make-char-table 'auto-fill-chars))) (set-char-table-parent fc auto-fill-chars) (dolist (c css-electric-keys) (aset fc c 'indent-according-to-mode)) - (set (make-local-variable 'auto-fill-chars) fc)))) + (setq-local auto-fill-chars fc)))) (defvar comment-continue) 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. ;; A start or end tag by itself on a line separates a paragraph. ;; This is desirable because SGML discards a newline that appears ;; immediately after a start tag or immediately before an end tag. - (set (make-local-variable 'paragraph-start) (concat "[ \t]*$\\|\ + (setq-local paragraph-start (concat "[ \t]*$\\|\ \[ \t]*</?\\(" sgml-name-re sgml-attrs-re "\\)?>")) - (set (make-local-variable 'paragraph-separate) - (concat paragraph-start "$")) - (set (make-local-variable 'adaptive-fill-regexp) "[ \t]*") + (setq-local paragraph-separate (concat paragraph-start "$")) + (setq-local adaptive-fill-regexp "[ \t]*") (add-hook 'fill-nobreak-predicate 'sgml-fill-nobreak nil t) - (set (make-local-variable 'indent-line-function) 'sgml-indent-line) - (set (make-local-variable 'comment-start) "<!-- ") - (set (make-local-variable 'comment-end) " -->") - (set (make-local-variable 'comment-indent-function) 'sgml-comment-indent) - (set (make-local-variable 'comment-line-break-function) - 'sgml-comment-indent-new-line) - (set (make-local-variable 'skeleton-further-elements) - '((completion-ignore-case t))) - (set (make-local-variable 'skeleton-end-hook) - (lambda () - (or (eolp) - (not (or (eq v2 '\n) (eq (car-safe v2) '\n))) - (newline-and-indent)))) - (set (make-local-variable 'font-lock-defaults) - '((sgml-font-lock-keywords - sgml-font-lock-keywords-1 - sgml-font-lock-keywords-2) - nil t)) - (set (make-local-variable 'syntax-propertize-function) - sgml-syntax-propertize-function) - (set (make-local-variable 'facemenu-add-face-function) - 'sgml-mode-facemenu-add-face-function) - (set (make-local-variable 'sgml-xml-mode) (sgml-xml-guess)) - (if sgml-xml-mode - () - (set (make-local-variable 'skeleton-transformation-function) - sgml-transformation-function)) + (setq-local indent-line-function 'sgml-indent-line) + (setq-local comment-start "<!-- ") + (setq-local comment-end " -->") + (setq-local comment-indent-function 'sgml-comment-indent) + (setq-local comment-line-break-function 'sgml-comment-indent-new-line) + (setq-local skeleton-further-elements '((completion-ignore-case t))) + (setq-local skeleton-end-hook + (lambda () + (or (eolp) + (not (or (eq v2 '\n) (eq (car-safe v2) '\n))) + (newline-and-indent)))) + (setq font-lock-defaults '((sgml-font-lock-keywords + sgml-font-lock-keywords-1 + sgml-font-lock-keywords-2) + nil t)) + (setq-local syntax-propertize-function sgml-syntax-propertize-function) + (setq-local facemenu-add-face-function 'sgml-mode-facemenu-add-face-function) + (setq-local sgml-xml-mode (sgml-xml-guess)) + (unless sgml-xml-mode + (setq-local skeleton-transformation-function sgml-transformation-function)) ;; This will allow existing comments within declarations to be ;; recognized. ;; I can't find a clear description of SGML/XML comments, but it seems that ;; the only reliable ones are <!-- ... --> although it's not clear what ;; "..." can contain. It used to accept -- ... -- as well, but that was ;; apparently a mistake. - (set (make-local-variable 'comment-start-skip) "<!--[ \t]*") - (set (make-local-variable 'comment-end-skip) "[ \t]*--[ \t\n]*>") + (setq-local comment-start-skip "<!--[ \t]*") + (setq-local comment-end-skip "[ \t]*--[ \t\n]*>") ;; This definition has an HTML leaning but probably fits well for other modes. (setq imenu-generic-expression `((nil @@ -982,10 +974,10 @@ With prefix argument ARG, repeat this ARG times." (unwind-protect (save-excursion (goto-char (point-min)) - (if (set (make-local-variable 'sgml-tags-invisible) - (if arg - (>= (prefix-numeric-value arg) 0) - (not sgml-tags-invisible))) + (if (setq-local sgml-tags-invisible + (if arg + (>= (prefix-numeric-value arg) 0) + (not sgml-tags-invisible))) (while (re-search-forward sgml-tag-name-re nil t) (setq string (cdr (assq (intern-soft (downcase (match-string 1))) @@ -1564,8 +1556,7 @@ Add this to `sgml-mode-hook' for convenience." (goto-char (point-min)) (if (re-search-forward "^\\([ \t]+\\)<" 500 'noerror) (progn - (set (make-local-variable 'sgml-basic-offset) - (1- (current-column))) + (setq-local sgml-basic-offset (1- (current-column))) (message "Guessed sgml-basic-offset = %d" sgml-basic-offset) )))) @@ -1979,33 +1970,28 @@ To work around that, do: (eval-after-load \"sgml-mode\" '(aset sgml-char-names ?' nil)) \\{html-mode-map}" - (set (make-local-variable 'sgml-display-text) html-display-text) - (set (make-local-variable 'sgml-tag-face-alist) html-tag-face-alist) - (make-local-variable 'sgml-tag-alist) - (make-local-variable 'sgml-face-tag-alist) - (make-local-variable 'sgml-tag-help) - (make-local-variable 'outline-regexp) - (make-local-variable 'outline-heading-end-regexp) - (make-local-variable 'outline-level) - (make-local-variable 'sentence-end-base) - (setq sentence-end-base "[.?!][]\"'”)}]*\\(<[^>]*>\\)*" - 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]\\>" - outline-heading-end-regexp "</[Hh][1-6]>" - outline-level (lambda () - (char-before (match-end 0)))) + (setq-local sgml-display-text html-display-text) + (setq-local sgml-tag-face-alist html-tag-face-alist) + (setq-local sgml-tag-alist html-tag-alist) + (setq-local sgml-face-tag-alist html-face-tag-alist) + (setq-local sgml-tag-help html-tag-help) + (setq-local outline-regexp "^.*<[Hh][1-6]\\>") + (setq-local outline-heading-end-regexp "</[Hh][1-6]>") + (setq-local outline-level + (lambda () (char-before (match-end 0)))) + (setq-local sentence-end-base "[.?!][]\"'”)}]*\\(<[^>]*>\\)*") + (setq imenu-create-index-function 'html-imenu-index) - (set (make-local-variable 'sgml-empty-tags) - ;; From HTML-4.01's loose.dtd, parsed with `sgml-parse-dtd', - ;; plus manual addition of "wbr". - '("area" "base" "basefont" "br" "col" "frame" "hr" "img" "input" - "isindex" "link" "meta" "param" "wbr")) - (set (make-local-variable 'sgml-unclosed-tags) - ;; From HTML-4.01's loose.dtd, parsed with `sgml-parse-dtd'. - '("body" "colgroup" "dd" "dt" "head" "html" "li" "option" - "p" "tbody" "td" "tfoot" "th" "thead" "tr")) + + (setq-local sgml-empty-tags + ;; From HTML-4.01's loose.dtd, parsed with + ;; `sgml-parse-dtd', plus manual addition of "wbr". + '("area" "base" "basefont" "br" "col" "frame" "hr" "img" "input" + "isindex" "link" "meta" "param" "wbr")) + (setq-local sgml-unclosed-tags + ;; From HTML-4.01's loose.dtd, parsed with `sgml-parse-dtd'. + '("body" "colgroup" "dd" "dt" "head" "html" "li" "option" + "p" "tbody" "td" "tfoot" "th" "thead" "tr")) ;; It's for the user to decide if it defeats it or not -stef ;; (make-local-variable 'imenu-sort-function) ;; (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 Entering Plain-tex mode runs the hook `text-mode-hook', then the hook `tex-mode-hook', and finally the hook `plain-tex-mode-hook'. When the special subshell is initiated, the hook `tex-shell-hook' is run." - (set (make-local-variable 'tex-command) tex-run-command) - (set (make-local-variable 'tex-start-of-header) "%\\*\\*start of header") - (set (make-local-variable 'tex-end-of-header) "%\\*\\*end of header") - (set (make-local-variable 'tex-trailer) "\\bye\n")) + (setq-local tex-command tex-run-command) + (setq-local tex-start-of-header "%\\*\\*start of header") + (setq-local tex-end-of-header "%\\*\\*end of header") + (setq-local tex-trailer "\\bye\n")) ;;;###autoload (define-derived-mode latex-mode tex-mode "LaTeX" @@ -1108,11 +1108,10 @@ tex-show-queue-command Entering Latex mode runs the hook `text-mode-hook', then `tex-mode-hook', and finally `latex-mode-hook'. When the special subshell is initiated, `tex-shell-hook' is run." - (set (make-local-variable 'tex-command) latex-run-command) - (set (make-local-variable 'tex-start-of-header) - "\\\\document\\(style\\|class\\)") - (set (make-local-variable 'tex-end-of-header) "\\\\begin\\s-*{document}") - (set (make-local-variable 'tex-trailer) "\\end{document}\n") + (setq-local tex-command latex-run-command) + (setq-local tex-start-of-header "\\\\document\\(style\\|class\\)") + (setq-local tex-end-of-header "\\\\begin\\s-*{document}") + (setq-local tex-trailer "\\end{document}\n") ;; A line containing just $$ is treated as a paragraph separator. ;; A line starting with $$ starts a paragraph, ;; but does not separate paragraphs if it has more stuff on it. @@ -1138,18 +1137,17 @@ subshell is initiated, `tex-shell-hook' is run." "marginpar" "parbox" "caption")) "\\|\\$\\$\\|[a-z]*\\(space\\|skip\\|page[a-z]*\\)" "\\>\\)[ \t]*\\($\\|%\\)\\)")) - (set (make-local-variable 'imenu-create-index-function) - 'latex-imenu-create-index) - (set (make-local-variable 'tex-face-alist) tex-latex-face-alist) + (setq-local imenu-create-index-function 'latex-imenu-create-index) + (setq-local tex-face-alist tex-latex-face-alist) (add-hook 'fill-nobreak-predicate 'latex-fill-nobreak-predicate nil t) - (set (make-local-variable 'indent-line-function) 'latex-indent) - (set (make-local-variable 'fill-indent-according-to-mode) t) + (setq-local indent-line-function 'latex-indent) + (setq-local fill-indent-according-to-mode t) (add-hook 'completion-at-point-functions 'latex-complete-data nil 'local) - (set (make-local-variable 'outline-regexp) latex-outline-regexp) - (set (make-local-variable 'outline-level) 'latex-outline-level) - (set (make-local-variable 'forward-sexp-function) 'latex-forward-sexp) - (set (make-local-variable 'skeleton-end-hook) nil)) + (setq-local outline-regexp latex-outline-regexp) + (setq-local outline-level 'latex-outline-level) + (setq-local forward-sexp-function 'latex-forward-sexp) + (setq-local skeleton-end-hook nil)) ;;;###autoload (define-derived-mode slitex-mode latex-mode "SliTeX" @@ -1198,39 +1196,35 @@ Entering SliTeX mode runs the hook `text-mode-hook', then the hook (defun tex-common-initialization () ;; Regexp isearch should accept newline and formfeed as whitespace. - (set (make-local-variable 'search-whitespace-regexp) "[ \t\r\n\f]+") + (setq-local search-whitespace-regexp "[ \t\r\n\f]+") ;; A line containing just $$ is treated as a paragraph separator. - (set (make-local-variable 'paragraph-start) - "[ \t]*$\\|[\f\\\\%]\\|[ \t]*\\$\\$") + (setq-local paragraph-start "[ \t]*$\\|[\f\\\\%]\\|[ \t]*\\$\\$") ;; A line starting with $$ starts a paragraph, ;; but does not separate paragraphs if it has more stuff on it. - (set (make-local-variable 'paragraph-separate) - "[ \t]*$\\|[\f\\\\%]\\|[ \t]*\\$\\$[ \t]*$") - (set (make-local-variable 'comment-start) "%") - (set (make-local-variable 'comment-add) 1) - (set (make-local-variable 'comment-start-skip) - "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(%+ *\\)") - (set (make-local-variable 'parse-sexp-ignore-comments) t) - (set (make-local-variable 'compare-windows-whitespace) - 'tex-categorize-whitespace) - (set (make-local-variable 'facemenu-add-face-function) - 'tex-facemenu-add-face-function) - (set (make-local-variable 'facemenu-end-add-face) "}") - (set (make-local-variable 'facemenu-remove-face-function) t) - (set (make-local-variable 'font-lock-defaults) - '((tex-font-lock-keywords tex-font-lock-keywords-1 - tex-font-lock-keywords-2 tex-font-lock-keywords-3) - nil nil nil nil - ;; Who ever uses that anyway ??? - (font-lock-mark-block-function . mark-paragraph) - (font-lock-syntactic-face-function - . tex-font-lock-syntactic-face-function) - (font-lock-unfontify-region-function - . tex-font-lock-unfontify-region))) - (set (make-local-variable 'syntax-propertize-function) - (syntax-propertize-rules latex-syntax-propertize-rules)) + (setq-local paragraph-separate "[ \t]*$\\|[\f\\\\%]\\|[ \t]*\\$\\$[ \t]*$") + (setq-local comment-start "%") + (setq-local comment-add 1) + (setq-local comment-start-skip + "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(%+ *\\)") + (setq-local parse-sexp-ignore-comments t) + (setq-local compare-windows-whitespace 'tex-categorize-whitespace) + (setq-local facemenu-add-face-function 'tex-facemenu-add-face-function) + (setq-local facemenu-end-add-face "}") + (setq-local facemenu-remove-face-function t) + (setq-local font-lock-defaults + '((tex-font-lock-keywords tex-font-lock-keywords-1 + tex-font-lock-keywords-2 tex-font-lock-keywords-3) + nil nil nil nil + ;; Who ever uses that anyway ??? + (font-lock-mark-block-function . mark-paragraph) + (font-lock-syntactic-face-function + . tex-font-lock-syntactic-face-function) + (font-lock-unfontify-region-function + . tex-font-lock-unfontify-region))) + (setq-local syntax-propertize-function + (syntax-propertize-rules latex-syntax-propertize-rules)) ;; TABs in verbatim environments don't do what you think. - (set (make-local-variable 'indent-tabs-mode) nil) + (setq-local indent-tabs-mode nil) ;; Other vars that should be buffer-local. (make-local-variable 'tex-command) (make-local-variable 'tex-start-of-header) @@ -1523,8 +1517,7 @@ Puts point on a blank line between them." (looking-at bibtex-reference-key)) (push (match-string-no-properties 0) keys))))) ;; Fill the cache. - (set (make-local-variable 'latex-complete-bibtex-cache) - (list files key keys))) + (setq-local latex-complete-bibtex-cache (list files key keys))) (complete-with-action action keys key pred))))) (defun latex-complete-envnames () @@ -1885,8 +1878,7 @@ Mark is left at original location." ;; The utility functions: (define-derived-mode tex-shell shell-mode "TeX-Shell" - (set (make-local-variable 'compilation-error-regexp-alist) - tex-error-regexp-alist) + (setq-local compilation-error-regexp-alist tex-error-regexp-alist) (compilation-shell-minor-mode t)) ;;;###autoload @@ -2099,8 +2091,7 @@ of the current buffer." (with-no-warnings (when (boundp 'TeX-master) (cond ((stringp TeX-master) - (make-local-variable 'tex-main-file) - (setq tex-main-file TeX-master)) + (setq-local tex-main-file TeX-master)) ((and (eq TeX-master t) buffer-file-name) (file-relative-name buffer-file-name))))) ;; Try to guess the main file. @@ -2870,8 +2861,8 @@ There might be text before point." (cons (car x) 'doctex-font-lock-syntactic-face-function)) (_ x))) (cdr font-lock-defaults)))) - (set (make-local-variable 'syntax-propertize-function) - (syntax-propertize-rules doctex-syntax-propertize-rules))) + (setq-local syntax-propertize-function + (syntax-propertize-rules doctex-syntax-propertize-rules))) (run-hooks 'tex-mode-load-hook) 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 @@ ;;; Code: (eval-when-compile (require 'tex-mode)) +(declare-function tex-buffer "tex-mode" ()) +(declare-function tex-region "tex-mode" (beg end)) +(declare-function tex-send-command "tex-mode") +(declare-function tex-recenter-output-buffer "tex-mode" (linenum)) +(declare-function tex-print "tex-mode" (&optional alt)) +(declare-function tex-view "tex-mode" ()) +(declare-function tex-shell-running "tex-mode" ()) +(declare-function tex-kill-job "tex-mode" ()) + (defvar outline-heading-alist) (defgroup texinfo nil @@ -571,66 +580,50 @@ be the first node in the file. Entering Texinfo mode calls the value of `text-mode-hook', and then the value of `texinfo-mode-hook'." - (set (make-local-variable 'page-delimiter) - (concat - "^@node [ \t]*[Tt]op\\|^@\\(" - texinfo-chapter-level-regexp - "\\)\\>")) - (make-local-variable 'require-final-newline) - (setq require-final-newline mode-require-final-newline) - (make-local-variable 'indent-tabs-mode) - (setq indent-tabs-mode nil) - (make-local-variable 'paragraph-separate) - (setq paragraph-separate - (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-separate)) - (make-local-variable 'paragraph-start) - (setq paragraph-start (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-start)) - (set (make-local-variable 'sentence-end-base) - "\\(@\\(end\\)?dots{}\\|[.?!]\\)[]\"'”)}]*") - (make-local-variable 'fill-column) - (setq fill-column 70) - (make-local-variable 'comment-start) - (setq comment-start "@c ") - (make-local-variable 'comment-start-skip) - (setq comment-start-skip "@c +\\|@comment +") - (make-local-variable 'words-include-escapes) - (setq words-include-escapes t) - (make-local-variable 'imenu-generic-expression) - (setq imenu-generic-expression texinfo-imenu-generic-expression) + (setq-local page-delimiter + (concat "^@node [ \t]*[Tt]op\\|^@\\(" + texinfo-chapter-level-regexp + "\\)\\>")) + (setq-local require-final-newline mode-require-final-newline) + (setq-local indent-tabs-mode nil) + (setq-local paragraph-separate + (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-separate)) + (setq-local paragraph-start (concat "\b\\|@[a-zA-Z]*[ \n]\\|" paragraph-start)) + (setq-local sentence-end-base "\\(@\\(end\\)?dots{}\\|[.?!]\\)[]\"'”)}]*") + (setq-local fill-column 70) + (setq-local comment-start "@c ") + (setq-local comment-start-skip "@c +\\|@comment +") + (setq-local words-include-escapes t) + (setq-local imenu-generic-expression texinfo-imenu-generic-expression) (setq imenu-case-fold-search nil) - (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(texinfo-font-lock-keywords nil nil nil backward-paragraph)) - (set (make-local-variable 'syntax-propertize-function) - texinfo-syntax-propertize-function) - (set (make-local-variable 'parse-sexp-lookup-properties) t) + (setq-local syntax-propertize-function texinfo-syntax-propertize-function) + (setq-local parse-sexp-lookup-properties t) ;; Outline settings. - (set (make-local-variable 'outline-heading-alist) - ;; We should merge outline-heading-alist and texinfo-section-list - ;; but in the mean time, let's just generate one from the other. - (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x))) - texinfo-section-list)) - (set (make-local-variable 'outline-regexp) - (concat (regexp-opt (mapcar 'car outline-heading-alist) t) - "\\>")) - - (make-local-variable 'tex-start-of-header) - (setq tex-start-of-header "%\\*\\*start") - (make-local-variable 'tex-end-of-header) - (setq tex-end-of-header "%\\*\\*end") - (make-local-variable 'tex-first-line-header-regexp) - (setq tex-first-line-header-regexp "^\\\\input") - (make-local-variable 'tex-trailer) - (setq tex-trailer "@bye\n") - - ;; Prevent filling certain lines, in addition to ones specified - ;; by the user. - (let ((prevent-filling "^@\\(def\\|multitable\\)")) - (set (make-local-variable 'auto-fill-inhibit-regexp) - (if (null auto-fill-inhibit-regexp) - prevent-filling - (concat auto-fill-inhibit-regexp "\\|" prevent-filling))))) + (setq-local outline-heading-alist + ;; We should merge `outline-heading-alist' and + ;; `texinfo-section-list'. But in the mean time, let's + ;; just generate one from the other. + (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x))) + texinfo-section-list)) + (setq-local outline-regexp + (concat (regexp-opt (mapcar 'car outline-heading-alist) t) + "\\>")) + + (setq-local tex-start-of-header "%\\*\\*start") + (setq-local tex-end-of-header "%\\*\\*end") + (setq-local tex-first-line-header-regexp "^\\\\input") + (setq-local tex-trailer "@bye\n") + + ;; Prevent filling certain lines, in addition to ones specified by + ;; the user. + (setq-local auto-fill-inhibit-regexp + (let ((prevent-filling "^@\\(def\\|multitable\\)")) + (if (null auto-fill-inhibit-regexp) + prevent-filling + (concat auto-fill-inhibit-regexp "\\|" prevent-filling))))) |