[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 3b1ffcd 30/48: TL 2018 non-ascii file name fix f
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 3b1ffcd 30/48: TL 2018 non-ascii file name fix for preview-latex |
Date: |
Sun, 16 Sep 2018 01:47:25 -0400 (EDT) |
branch: externals/auctex
commit 3b1ffcd8c3387f67fd9be5e1da73d780dffbdd51
Author: Ikumi Keita <address@hidden>
Commit: Ikumi Keita <address@hidden>
TL 2018 non-ascii file name fix for preview-latex
* preview.el.in (preview-LaTeX-command): Wrap file name after implicit
\input in \detokenize{}.
(preview-cache-preamble): Arrange the ini file code so that non-ascii
file name can be used with generated format file. Be careful not to
lose capability of handling file name with space.
(preview-undump-replacements): Use new TeX macro defined in the above
ini file code to accept even unusual file name with non-ascii
character or space.
Delegate quoting of format name to `TeX-inline-preview-internal' so
that non-ascii character will not be quoted twice.
(TeX-inline-preview-internal): Adjust to the above change.
---
preview.el.in | 29 ++++++++++++++++++++++-------
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/preview.el.in b/preview.el.in
index 9f061c0..c6c8eaf 100644
--- a/preview.el.in
+++ b/preview.el.in
@@ -2217,7 +2217,14 @@ list of LaTeX commands is inserted just before
\\begin{document}."
(defcustom preview-LaTeX-command '("%`%l \"\\nonstopmode\\nofiles\
\\PassOptionsToPackage{" ("," . preview-required-option-list) "}{preview}\
\\AtBeginDocument{\\ifx\\ifPreview\\undefined"
-preview-default-preamble "\\fi}\"%' %t")
+preview-default-preamble "\\fi}\"%' \"{\\detokenize{\" %t \"}}\"")
+ ;; Since TeXLive 2018, the default encoding for LaTeX files has been
+ ;; changed to UTF-8 if used with classic TeX or pdfTeX. I.e.,
+ ;; \usepackage[utf8]{inputenc} is enabled by default in (pdf)latex.
+ ;; c.f. LaTeX News issue 28
+ ;; Due to this change, \detokenize is required to recognize
+ ;; non-ascii characters in the file name when \input is supplemented
+ ;; implicitly by %`-%' pair.
"*Command used for starting a preview.
See description of `TeX-command-list' for details."
:group 'preview-latex
@@ -3272,8 +3279,12 @@ This is passed through `preview-do-replacements'."
(defcustom preview-undump-replacements
'(("\\`\\([^ ]+\\)\
- .*? \"\\\\input\" \\(.*\\)\\'"
- . ("\\1 -interaction=nonstopmode \"&" preview-format-name "\" \\2")))
+ .*? \"\\\\input\" \"{\\\\detokenize{\" \\(.*\\) \"}}\"\\'"
+ . ("\\1 -interaction=nonstopmode " preview-format-name
+ " \"/AUCTEXINPUT{\" \\2 \"}\"")))
+ ;; See the ini file code below in `preview-cache-preamble' for the
+ ;; wierd /AUCTEXINPUT construct. In short, it is crafted so that
+ ;; dumped format file can read file of non-ascii name.
"Use a dumped format for reading preamble."
:group 'preview-latex
:type '(repeat
@@ -3317,8 +3328,11 @@ If FORMAT-CONS is non-nil, a previous format may get
reused."
;; in the tools bundle is an empty file.
(write-region "\\ifx\\pdfoutput\\undefined\\else\
\\let\\PREVIEWdump\\dump\\def\\dump{%
-\\edef\\next{{\\catcode`\\ 9 \\pdfoutput=\\the\\pdfoutput\\relax\
-\\the\\everyjob}}\\everyjob\\next\\catcode`\\ 10
\\let\\dump\\PREVIEWdump\\dump}\\fi\\input mylatex.ltx \\relax\n" nil dump-file)
+\\edef\\next{{\\pdfoutput=\\the\\pdfoutput\\relax\
+\\the\\everyjob}}\\everyjob\\next\\catcode`\\ 10 %
+\\catcode`/ 0 %
+\\def\\AUCTEXINPUT##1{\\catcode`/ 12\\relax\\catcode`\\
9\\relax\\input{\\detokenize{##1}}}%
+\\let\\dump\\PREVIEWdump\\dump}\\fi\\input mylatex.ltx \\relax%\n" nil
dump-file)
(TeX-save-document master)
(prog1
(preview-generate-preview
@@ -3505,8 +3519,9 @@ internal parameters, STR may be a log to insert into the
current log."
(set-buffer commandbuff)
(let*
((preview-format-name (shell-quote-argument
- (preview-dump-file-name
- (file-name-nondirectory master))))
+ (concat "&"
+ (preview-dump-file-name
+ (file-name-nondirectory master)))))
(process-environment (copy-sequence process-environment))
(process
(progn
- [elpa] externals/auctex 15d3d97 08/48: Quote %b expansion string for SumatraPDF, (continued)
- [elpa] externals/auctex 15d3d97 08/48: Quote %b expansion string for SumatraPDF, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 68095a3 15/48: Fix previous removal of xemacs compatibility code, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 59fa964 05/48: Resolve conflict of argument spec between regexp and literal, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 94378c1 09/48: Correct record in changes.texi, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 00f0e0e 13/48: ; * tex.el (TeX-expand-list): Fix docstring (bug#31217)., Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 59a9e5b 10/48: Correct how `TeX-record-buffer' is used, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex c64a0e1 27/48: Quote %b expansion string for Zathura, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 4775f96 21/48: ; * tex-jp.el (japanese-TeX-self-insert-command): Silence byte compiler., Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 96ba113 23/48: Support UTF-8 with BOM in Japanese TeX documents, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex d5f98ae 32/48: ; Fix typos, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 3b1ffcd 30/48: TL 2018 non-ascii file name fix for preview-latex,
Tassilo Horn <=
- [elpa] externals/auctex 0d8f8a2 14/48: Prevent spurious newlines to be added, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 527bcb2 16/48: ; * doc/auctex.texi (Processor Options): Add note of case in an option., Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 7371b46 07/48: Add support for dvipdfmx to \includegraphics, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 4afd633 11/48: Update key=val options to geometry package v5.8, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 6a17a52 24/48: ; * doc/changes.texi (News in 12.2): Add news about removed option., Tassilo Horn, 2018/09/16
- [elpa] externals/auctex ff08d38 28/48: Fix region compilation with \usepackage[utf8]{inputenc}, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex cad042f 31/48: Add note and test about the change involving non-ascii file name, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 5ce08ab 33/48: Raise robustness of call of dvipng command, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 3741b8c 26/48: Prepare for UTF-8 with BOM, Tassilo Horn, 2018/09/16
- [elpa] externals/auctex 4816092 36/48: Fix possible endless loop, Tassilo Horn, 2018/09/16