Hi, I noticed in the wishlist that it might be nice to have this. The other one, TeX-trailer-end should be (eobp), if the trailer is everything that is not parsed at the end of the file? But this is impossible to put in a regular expression, unfortunately.
ChangeLog entries for all patches: 2013-01-28 Mads Jensen <[email protected]> * doc/todo.texi (Wishlist): Remove "Completion for sboxes", and `TeX-header-start'. * latex.el (LaTeX-common-initialization): Initialize `TeX-header-start' to `LaTeX-header-start'. (LaTeX-header-start): New variable. * tex.el (TeX-header-start): New variable. (TeX-trailer-start): Set this to a value. Please keep me in CC. -- Med Venlig Hilsen / Kind Regards, Mads Jensen Rubinsteinsvej 31,st.th DK-2450 Kbh. SV Denmark +45 6168 8518 My brain is my second favorite organ. -- Woody Allen
Index: latex.el
===================================================================
RCS file: /sources/auctex/auctex/latex.el,v
retrieving revision 5.482
diff -u -r5.482 latex.el
--- latex.el 28 Jan 2013 08:35:44 -0000 5.482
+++ latex.el 28 Jan 2013 12:36:40 -0000
@@ -5178,6 +5178,11 @@
:type '(repeat regexp)
:group 'TeX-command)
+(defvar LaTeX-header-start
+ (concat "^[^%\n]*" (regexp-quote TeX-esc) "document\\(class\\|style\\)\\([[^]+]\\)?"
+ "\\({[^}]+}\\)")
+ "Default start of header marker for LaTeX documents.")
+
(defvar LaTeX-header-end
(concat "^[^%\n]*" (regexp-quote TeX-esc) "begin *"
TeX-grop "document" TeX-grcl)
@@ -5224,6 +5229,7 @@
(setq LaTeX-largest-level (LaTeX-section-level "section")))
(setq TeX-header-end LaTeX-header-end
+ TeX-header-start LaTeX-header-start
TeX-trailer-start LaTeX-trailer-start)
(require 'outline)
Index: tex.el
===================================================================
RCS file: /sources/auctex/auctex/tex.el,v
retrieving revision 5.705
diff -u -r5.705 tex.el
--- tex.el 13 Jan 2013 11:05:48 -0000 5.705
+++ tex.el 28 Jan 2013 12:27:54 -0000
@@ -700,7 +700,7 @@
(defun TeX-read-string (prompt &optional initial-input history default-value)
(read-string prompt initial-input history default-value t))
-
+
(defun TeX-mark-active ()
;; In FSF 19 mark-active indicates if mark is active.
mark-active)
@@ -1754,7 +1754,7 @@
(unless (local-variable-p 'TeX-PDF-mode (current-buffer))
(TeX-PDF-mode (if arg 1 0))
(setq TeX-PDF-mode-parsed t))))
-
+
(defun TeX-PDF-mode-on ()
"Use only from parsing routines."
(TeX-PDF-mode-parsed t))
@@ -1811,7 +1811,8 @@
:group 'TeX-command-name
:type 'string)
-(defvar TeX-trailer-start nil
+(defvar TeX-trailer-start
+ "^[^%\n]*" (regexp-quote TeX-esc) "\\(endinput\\|bye\\)")
"Regular expression delimiting start of trailer in a TeX file.")
(make-variable-buffer-local 'TeX-trailer-start)
@@ -1821,6 +1822,11 @@
(make-variable-buffer-local 'TeX-header-end)
+(defvar TeX-header-start nil
+ "Regular expression delimiting start of header in a TeX file.")
+
+ (make-variable-buffer-local 'TeX-header-start)
+
(defvar TeX-command-default nil
"The default command for `TeX-command' in the current major mode.")
@@ -1878,7 +1884,7 @@
(when (or (not TeX-clean-confirm)
(condition-case nil
(dired-mark-pop-up " *Deletions*" 'delete
- (if (> (length files) 1)
+ (if (> (length files) 1)
files
(cons t files))
'y-or-n-p "Delete files? ")
@@ -2990,7 +2996,7 @@
(setq ispell-parser 'tex)
(make-local-variable 'ispell-tex-p)
(setq ispell-tex-p t)
-
+
;; Redefine some standard variables
(make-local-variable 'paragraph-start)
(make-local-variable 'paragraph-separate)
@@ -4142,7 +4148,7 @@
(define-key map "\C-c?" 'TeX-doc)
(define-key map "\C-c\C-i" 'TeX-goto-info-page)
(define-key map "\r" 'TeX-newline)
-
+
;; From tex.el
(define-key map "\"" 'TeX-insert-quote)
(define-key map "$" 'TeX-insert-dollar)
@@ -4156,14 +4162,14 @@
(define-key map "^" 'TeX-insert-sub-or-superscript)
(define-key map "_" 'TeX-insert-sub-or-superscript)
(define-key map "\e\t" 'TeX-complete-symbol) ;*** Emacs 19 way
-
+
(define-key map "\C-c'" 'TeX-comment-or-uncomment-paragraph) ;*** Old way
(define-key map "\C-c:" 'TeX-comment-or-uncomment-region) ;*** Old way
(define-key map "\C-c\"" 'TeX-uncomment) ;*** Old way
-
+
(define-key map "\C-c;" 'TeX-comment-or-uncomment-region)
(define-key map "\C-c%" 'TeX-comment-or-uncomment-paragraph)
-
+
(define-key map "\C-c\C-t\C-p" 'TeX-PDF-mode)
(define-key map "\C-c\C-t\C-i" 'TeX-interactive-mode)
(define-key map "\C-c\C-t\C-s" 'TeX-source-correlate-mode)
@@ -5572,7 +5578,7 @@
(regexp (concat "\\`\\("
(mapconcat (lambda (dir)
(regexp-quote
- (expand-file-name
+ (expand-file-name
(file-name-as-directory dir))))
(append (when (file-name-directory name)
(list (file-name-directory name)))
Index: todo.texi
===================================================================
RCS file: /sources/auctex/auctex/doc/todo.texi,v
retrieving revision 1.26
diff -u -r1.26 todo.texi
--- todo.texi 17 Jan 2013 07:29:38 -0000 1.26
+++ todo.texi 28 Jan 2013 12:37:25 -0000
@@ -252,17 +252,14 @@
@end table
@item
-Completion for sboxes.
-
-@item
Outline should be (better) supported in @TeX{} mode.
At least, support headers, trailers, as well as TeX-outline-extra.
@item
-@code{TeX-header-start} and @code{TeX-trailer-end}.
+@code{TeX-trailer-end}.
-We might want these, just for fun (and outlines)
+We might want this, just for fun (and outlines)
@item
Plain @TeX{} and @LaTeX{} specific header and trailer expressions.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ auctex-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/auctex-devel
