>From address@hidden Fri Sep 22 14:52:07 2017 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PATCH] Make preview-latex parsing robust to fix Bug#20773, Bug#27088 X-Mercurial-Node: 47711b2553dcbf4858a1b4f53d63e82a3003bca8 X-Mercurial-Series-Index: 1 X-Mercurial-Series-Total: 1 Message-Id: X-Mercurial-Series-Id: User-Agent: Mercurial-patchbomb/4.3.1 Date: Fri, 22 Sep 2017 14:52:07 +0900 From: Ikumi Keita To: dummy * 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. diff --git a/preview.el.in b/preview.el.in --- a/preview.el.in +++ b/preview.el.in @@ -3537,19 +3537,25 @@ ((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