changeset 16777:b655268ba44f

(tex-first-line-header-regexp): New variable. (tex-region): Sometimes include the file's first line.
author Richard M. Stallman <rms@gnu.org>
date Sun, 29 Dec 1996 19:41:52 +0000
parents b998fe0016d5
children e08944e83eb7
files lisp/textmodes/tex-mode.el
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/tex-mode.el	Sun Dec 29 18:59:24 1996 +0000
+++ b/lisp/textmodes/tex-mode.el	Sun Dec 29 19:41:52 1996 +0000
@@ -42,6 +42,13 @@
 `\\input' commands with relative directories.")
 
 ;;;###autoload
+(defvar tex-first-line-header-regexp nil
+  "Regexp for matching a first line which `tex-region' should include.
+If this is non-nil, it should be a regular expression string;
+if it matches the first line of the file,
+`tex-region' always includes the first line in the TeX run.")
+
+;;;###autoload
 (defvar tex-main-file nil
   "*The main TeX source file which includes this buffer's file.
 The command `tex-buffer' runs TeX on `tex-main-file'if that is non-nil.")
@@ -1010,6 +1017,14 @@
 	      (hbeg (point-min)) (hend (point-min))
 	      (default-directory zap-directory))
 	  (goto-char (point-min))
+          
+          ;; Maybe copy first line, such as `\input texinfo', to temp file.
+	  (and tex-first-line-header-regexp
+	       (looking-at tex-first-line-header-regexp)
+	       (write-region (point) 
+			     (progn (forward-line 1) (point))
+			     tex-out-file nil nil))
+
 	  ;; Initialize the temp file with either the header or nothing
 	  (if (re-search-forward tex-start-of-header search-end t)
 	      (progn