branch: externals/auctex commit 0f8901dc5dff4687def1250983ff1a66d2322db5 Author: Ikumi Keita <ik...@ikumi.que.jp> Commit: Ikumi Keita <ik...@ikumi.que.jp>
Set up outline mode variables early (bug#69254) * latex.el (LaTeX-mode-cleanup): (LaTeX-common-initialization): Revert the fix for bug#65750 partially so that call to outline mode in `LaTeX-mode-hook' works. * context.el (ConTeXt-mode-common-initialization): (ConTeXt-mode-cleanup): * tex-info.el: (Texinfo-mode): (Texinfo-mode-cleanup): Follow the above change for LaTeX mode. --- context.el | 10 +++------- latex.el | 23 ++++++----------------- tex-info.el | 26 ++++++-------------------- 3 files changed, 15 insertions(+), 44 deletions(-) diff --git a/context.el b/context.el index 5ee0217d91..86991ccf93 100644 --- a/context.el +++ b/context.el @@ -1875,9 +1875,8 @@ that is, you do _not_ have to cater for this yourself by adding \\\\\\=' or $." ;; Outline support (require 'outline) (set (make-local-variable 'outline-level) #'ConTeXt-outline-level) - ;; Moved after `run-mode-hooks'. (bug#65750) - ;; (set (make-local-variable 'outline-regexp) (ConTeXt-outline-regexp t)) - ;;(make-local-variable 'outline-heading-end-regexp) + (set (make-local-variable 'outline-regexp) (ConTeXt-outline-regexp t)) + (make-local-variable 'outline-heading-end-regexp) (setq TeX-header-end (ConTeXt-header-end) TeX-trailer-start (ConTeXt-trailer-start)) @@ -1913,10 +1912,7 @@ Run after mode hooks and file local variables application." "[ \t]*\\(" (ConTeXt-paragraph-commands-regexp) "\\|" "\\$\\$\\|" ; Plain TeX display math - "$\\)")) - - (or (local-variable-p 'outline-regexp) - (setq-local outline-regexp (ConTeXt-outline-regexp t)))) + "$\\)"))) (defun context-guess-current-interface () "Guess what ConTeXt interface the current buffer is using." diff --git a/latex.el b/latex.el index 83de0e84f4..de70c7f57d 100644 --- a/latex.el +++ b/latex.el @@ -8268,16 +8268,6 @@ Run after mode hooks and file local variables application." (if (bound-and-true-p filladapt-mode) (turn-off-filladapt-mode)) - ;; Don't overwrite the value the user set by hooks or file - ;; (directory) local variables. - (or (local-variable-p 'outline-regexp) - (setq-local outline-regexp (LaTeX-outline-regexp t))) - (or (local-variable-p 'outline-heading-alist) - (setq outline-heading-alist - (mapcar (lambda (x) - (cons (concat "\\" (nth 0 x)) (nth 1 x))) - LaTeX-section-list))) - ;; Keep `LaTeX-paragraph-commands-regexp' in sync with ;; `LaTeX-paragraph-commands' in case the latter is updated by ;; hooks or file (directory) local variables. @@ -8441,13 +8431,12 @@ function would return non-nil and `(match-string 1)' would return (require 'outline) (set (make-local-variable 'outline-level) #'LaTeX-outline-level) - ;; Moved after `run-mode-hooks'. (bug#65750) - ;; (set (make-local-variable 'outline-regexp) (LaTeX-outline-regexp t)) - ;; (when (boundp 'outline-heading-alist) - ;; (setq outline-heading-alist - ;; (mapcar (lambda (x) - ;; (cons (concat "\\" (nth 0 x)) (nth 1 x))) - ;; LaTeX-section-list))) + (set (make-local-variable 'outline-regexp) (LaTeX-outline-regexp t)) + (when (boundp 'outline-heading-alist) + (setq outline-heading-alist + (mapcar (lambda (x) + (cons (concat "\\" (nth 0 x)) (nth 1 x))) + LaTeX-section-list))) (setq-local TeX-auto-full-regexp-list (delete-dups (append LaTeX-auto-regexp-list diff --git a/tex-info.el b/tex-info.el index fc10f0184f..9f919ee309 100644 --- a/tex-info.el +++ b/tex-info.el @@ -31,9 +31,6 @@ (require 'texinfo) -;; Silence the compiler for variables: -(defvar outline-heading-alist) - ;;; Environments: (defvar Texinfo-environment-list '(("cartouche") ("command") ("copying") ("defcv") ("deffn") ("defivar") @@ -672,13 +669,12 @@ value of `Texinfo-mode-hook'." (set (make-local-variable 'syntax-propertize-function) texinfo-syntax-propertize-function) - ;; Moved after `run-mode-hooks'. (bug#65750) - ;; (setq-local outline-heading-alist - ;; (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 outline-heading-alist + (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) + "\\>")) ;; Mostly AUCTeX stuff (set (make-local-variable 'TeX-command-current) #'TeX-command-master) @@ -873,16 +869,6 @@ Run after mode hooks and file local variables application." texinfo-chapter-level-regexp "\\)"))) - ;; Outline settings. - (or (local-variable-p 'outline-heading-alist) - (setq-local outline-heading-alist - (mapcar (lambda (x) (cons (concat "@" (car x)) (cadr x))) - texinfo-section-list))) - (or (local-variable-p 'outline-regexp) - (setq-local outline-regexp - (concat (regexp-opt (mapcar #'car outline-heading-alist) t) - "\\>"))) - (or (local-variable-p 'TeX-complete-list) (setq-local TeX-complete-list (list (list "@\\([a-zA-Z]*\\)" 1 #'TeX-symbol-list-filtered nil)