branch: externals/auctex
commit 9e1aa85d6d7ee84a12503a1dee62785c12e64ac1
Author: Ikumi Keita <[email protected]>
Commit: Ikumi Keita <[email protected]>
Make preview-latex parsing robust to fix Bug#20773, Bug#27088
* preview.el.in (TeX-inline-preview-internal): Set environment
variable max_print_line to sufficiently large value of 1000 so that
LaTeX process does not insert newline in lines necessary to identify
Bounding Boxes.
---
preview.el.in | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/preview.el.in b/preview.el.in
index 8bde248..e09ef9a 100644
--- a/preview.el.in
+++ b/preview.el.in
@@ -3537,19 +3537,25 @@ internal parameters, STR may be a log to insert into
the current log."
((preview-format-name (shell-quote-argument
(preview-dump-file-name
(file-name-nondirectory master))))
+ (process-environment process-environment)
(process
- (TeX-run-command
- "Preview-LaTeX"
- (if (consp (cdr dumped-cons))
- (preview-do-replacements
- command
- (append preview-undump-replacements
- ;; Since the command options provided in
- ;; (TeX-engine-alist) are dropped, give them
- ;; back.
- (list (list "\\`\\([^ ]+\\)"
- (TeX-command-expand "%(PDF)%(latex)" nil)))))
- command) file)))
+ (progn
+ ;; Fix Bug#20773, Bug#27088.
+ ;; Make LaTeX not to insert newline in lines necessary to
+ ;; identify Bounding Boxes.
+ (setenv "max_print_line" "1000")
+ (TeX-run-command
+ "Preview-LaTeX"
+ (if (consp (cdr dumped-cons))
+ (preview-do-replacements
+ command
+ (append preview-undump-replacements
+ ;; Since the command options provided in
+ ;; (TeX-engine-alist) are dropped, give them
+ ;; back.
+ (list (list "\\`\\([^ ]+\\)"
+ (TeX-command-expand "%(PDF)%(latex)"
nil)))))
+ command) file))))
(condition-case err
(progn
(when str