aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1996-12-29 19:41:52 +0000
committerRichard M. Stallman1996-12-29 19:41:52 +0000
commit725b742881c44f70e8122bb924e04f7ecc2e0236 (patch)
tree9794bb5a79a9c6ffc59c1a509049f813cc20db76 /lisp
parentd34c1b05eb99917703bd464ef286de9bd15b8048 (diff)
downloademacs-725b742881c44f70e8122bb924e04f7ecc2e0236.tar.gz
emacs-725b742881c44f70e8122bb924e04f7ecc2e0236.zip
(tex-first-line-header-regexp): New variable.
(tex-region): Sometimes include the file's first line.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/textmodes/tex-mode.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 4f19edcdc2f..c20c6b9f18d 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -42,6 +42,13 @@ and you don't try to apply \\[tex-region] or \\[tex-buffer] when there are
42`\\input' commands with relative directories.") 42`\\input' commands with relative directories.")
43 43
44;;;###autoload 44;;;###autoload
45(defvar tex-first-line-header-regexp nil
46 "Regexp for matching a first line which `tex-region' should include.
47If this is non-nil, it should be a regular expression string;
48if it matches the first line of the file,
49`tex-region' always includes the first line in the TeX run.")
50
51;;;###autoload
45(defvar tex-main-file nil 52(defvar tex-main-file nil
46 "*The main TeX source file which includes this buffer's file. 53 "*The main TeX source file which includes this buffer's file.
47The command `tex-buffer' runs TeX on `tex-main-file'if that is non-nil.") 54The command `tex-buffer' runs TeX on `tex-main-file'if that is non-nil.")
@@ -1010,6 +1017,14 @@ The value of `tex-command' specifies the command to use to run TeX."
1010 (hbeg (point-min)) (hend (point-min)) 1017 (hbeg (point-min)) (hend (point-min))
1011 (default-directory zap-directory)) 1018 (default-directory zap-directory))
1012 (goto-char (point-min)) 1019 (goto-char (point-min))
1020
1021 ;; Maybe copy first line, such as `\input texinfo', to temp file.
1022 (and tex-first-line-header-regexp
1023 (looking-at tex-first-line-header-regexp)
1024 (write-region (point)
1025 (progn (forward-line 1) (point))
1026 tex-out-file nil nil))
1027
1013 ;; Initialize the temp file with either the header or nothing 1028 ;; Initialize the temp file with either the header or nothing
1014 (if (re-search-forward tex-start-of-header search-end t) 1029 (if (re-search-forward tex-start-of-header search-end t)
1015 (progn 1030 (progn