Commit 725b7428 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(tex-first-line-header-regexp): New variable.

(tex-region): Sometimes include the file's first line.
parent d34c1b05
......@@ -41,6 +41,13 @@ You can make this `/tmp' if your TEXINPUTS has no relative directories in it
and you don't try to apply \\[tex-region] or \\[tex-buffer] when there are
`\\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.
......@@ -1010,6 +1017,14 @@ The value of `tex-command' specifies the command to use to run TeX."
(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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment