From 4af2fc3435a45ae2c40e1a6afa107cd5e501bf72624d8621d4800bcd361ca8e7 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 14 Aug 2020 10:57:09 +0000 Subject: [PATCH] Update to 12.2 to avoid obsolete (process-kill-without-query) OBS-URL: https://build.opensuse.org/package/show/editors/emacs-auctex?expand=0&rev=46 --- auctex-12.1.tar.gz | 3 - auctex-12.2.tar.gz | 3 + auctex-12.2.tar.gz.sig | Bin 0 -> 566 bytes dvips.patch | 2 +- emacs-auctex.changes | 66 ++++++++++ emacs-auctex.spec | 13 +- utf8-names-3b1ffcd8.patch | 81 ------------ utf8-names-a8ea1273.patch | 223 -------------------------------- utf8-names-fix-boo1135326.patch | 110 ---------------- 9 files changed, 74 insertions(+), 427 deletions(-) delete mode 100644 auctex-12.1.tar.gz create mode 100644 auctex-12.2.tar.gz create mode 100644 auctex-12.2.tar.gz.sig delete mode 100644 utf8-names-3b1ffcd8.patch delete mode 100644 utf8-names-a8ea1273.patch delete mode 100644 utf8-names-fix-boo1135326.patch diff --git a/auctex-12.1.tar.gz b/auctex-12.1.tar.gz deleted file mode 100644 index 1d30af8..0000000 --- a/auctex-12.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c95cca4d70a9783617f7b5035c5e2c77438fa35d2505555d40190ac2652a5db4 -size 1476296 diff --git a/auctex-12.2.tar.gz b/auctex-12.2.tar.gz new file mode 100644 index 0000000..cf8b253 --- /dev/null +++ b/auctex-12.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59677958aa76c7a15cf62f098524f79b1cdb74d24bcdf36448ecbb5911d07893 +size 1511396 diff --git a/auctex-12.2.tar.gz.sig b/auctex-12.2.tar.gz.sig new file mode 100644 index 0000000000000000000000000000000000000000000000000000000000000000..993d35008aa788a94a6a50d1b3f60440f30641f8ca2c93a3bb6b473b7a157ac8 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+1&E$u~RX{L*hL9FDC6G4yXxf>|Q zQF+H|*mo8(ryP$RLA@kcWv>dJJ_=H$4>S}9Z>_Y%nrL|hvN3Ff`Lbk`d+ zy0i9F^)i!wMJX@&s6!QzJ=8Xu2Abh%?^0tsNP$##ksr^$~hS zR~1PV&fF*JU4b7SUBfi-wN<54>mgRUPWKzzbsiA+YW&Aoj;FcA=bka^rRrHQ(s~+R zfTxR0z50RJEAMT584u(uY`x8?RGM^VBvsTJFIQhT7$0=Ua4H65GGZ`z>JQhm@@@r?NJ2UYZMX!7pA6wG+emw?^lnGT?$ldCxU8IlzxQrh zBDu3cVxsmwa;<8Au-~+B0pEU4M}Tb%G&RCN0Gc_B`fjiiI?iv#=MJ;umx-DSYV7RC Ew@}g(SpWb4 literal 0 HcmV?d00001 diff --git a/dvips.patch b/dvips.patch index 4863449..e8e63b8 100644 --- a/dvips.patch +++ b/dvips.patch @@ -1,6 +1,6 @@ --- tex.el +++ tex.el 2015-11-14 12:10:30.386677534 +0200 -@@ -345,7 +345,7 @@ +@@ -354,7 +354,7 @@ ;; TeX-print-command. (defcustom TeX-print-command diff --git a/emacs-auctex.changes b/emacs-auctex.changes index 3820fb3..d97b395 100644 --- a/emacs-auctex.changes +++ b/emacs-auctex.changes @@ -1,3 +1,69 @@ +------------------------------------------------------------------- +Fri Aug 14 10:03:53 UTC 2020 - Dr. Werner Fink + +- Update to 12.2 to avoid obsolete (process-kill-without-query) + * AUCTeX reflects the changes in LaTeX2e 2019-10-01 release. + 'filecontents' environment now takes an optional argument and can + be used anywhere in a document. The macros '\Ref' and + '\labelformat' are moved from 'varioref.sty' to LaTeX kernel. + amsmath has a new macro '\overunderset'. + * A new method is implemented in preview-latex to adjust the + foreground colors of generated images to those of Emacs, when the + LaTeX command produces PDF. The traditional method became invalid + because of the change introduced in Ghostscript 9.27. + Unfortunately, the new method doesn't work due to a bug in + Ghostscript 9.27 and is valid only for Ghostscript > 9.27. There + is also a fallback method for gs 9.27 users which displays plain + "black on white" images. For successful function of preview-latex, + the users are encouraged to set up the new user option + 'preview-pdf-color-adjust-method' to choose appropriate option + among the three: new, traditional and fallback method. + * AUCTeX has support for the Flymake package in Emacs 26 or newer. + To enable, call 'M-x flymake-mode RET' or add this to your '.emacs' + file: + (add-hook 'LaTeX-mode-hook #'flymake-mode) + * The way the option 'TeX-record-buffer' is used was corrected. It + was used in just the opposite way as the document says. Erase the + customization if you have customized this option since it now acts + in reverse to your expectation. + * A former customize option 'japanese-TeX-command-list' is removed. + Use 'japanese-TeX-engine-default', or if it's really necessary, + customize 'TeX-command-list' directly if the task which the option + used to carry is required. + * Support for standard LaTeX without e-TeX extension is now very + limited. It doesn't work if raw TeX code is put on the command + line to invoke latex command. It also fails for region compilation + ('C-c C-r' and so on) with documents of non-ascii file name. In + addition, it no longer works with preview-latex. We consider this + incompatibility is permissible because e-TeX extension is enabled + for standard LaTeX by default long ago. LaTeX variants such as + XeLaTeX and LuaLaTeX are not affected. + * Key binds in Texinfo mode are improved. Typing '$', '^', '_' and + '\' now just self-inserts without pointless side effects in Texinfo + mode. + In addition, the option 'TeX-electric-escape' is now effective in + Texinfo mode. When it is enabled, typing '@' will invoke + 'TeX-electric-macro' offering completion in similar style with + other TeX modes of AUCTeX. + * Fontification support for 'biblatex' package is improved and + updated to macros provided by package version 3.12. For qualified + lists, at least 2 mandatory arguments are fontified. + * Support for column specifiers 'w' and 'W' provided by 'array' + package is added to 'array.el'. The correct counting of columns + only works when the 'align' parameter is enclosed in braces, e.g., + 'w{l}{3cm}'. The short version 'wl{3cm}' is not supported. + * Entries for 'PDF Tools' are added in + 'TeX-view-program-list-builtin' for Windows and macOS. This viewer + can be configured under these operating systems with an entry like + this in an init file: + (setq TeX-view-program-selection '((output-pdf "PDF Tools"))) + * Several other bugs were fixed, many minor features were added. +- Drop patches which seem now obsolete + * utf8-names-3b1ffcd8.patch + * utf8-names-a8ea1273.patch + * utf8-names-fix-boo1135326.patch +- Correct line number in patch dvips.patch + ------------------------------------------------------------------- Tue Dec 3 12:28:00 UTC 2019 - Dr. Werner Fink diff --git a/emacs-auctex.spec b/emacs-auctex.spec index d3344ae..403e038 100644 --- a/emacs-auctex.spec +++ b/emacs-auctex.spec @@ -1,7 +1,7 @@ # # spec file for package emacs-auctex # -# Copyright (c) 2019 SUSE LLC +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -36,19 +36,17 @@ BuildRequires: texlive-collection-latexextra BuildRequires: texlive-tex BuildRequires: texlive-texinfo %endif -Version: 12.1 +Version: 12.2 Release: 0 Summary: AUC TeX: An Emacs Extension License: GPL-2.0-or-later Group: Productivity/Editors/Emacs -Source: http://ftp.gnu.org/pub/gnu/auctex/auctex-%{version}.tar.gz +Source0: http://ftp.gnu.org/pub/gnu/auctex/auctex-%{version}.tar.gz +Source1: http://ftp.gnu.org/pub/gnu/auctex/auctex-%{version}.tar.gz.sig URL: http://www.gnu.org/software/auctex # Allows to select printer instance # PATCH-FEATURE-UPSTREAM dvips.patch Patch0: dvips.patch -Patch10: utf8-names-3b1ffcd8.patch -Patch11: utf8-names-a8ea1273.patch -Patch12: utf8-names-fix-boo1135326.patch BuildArch: noarch %description @@ -71,9 +69,6 @@ you cannot use this package for XEmacs. %prep %setup -n auctex-%{version} %patch0 -%patch10 -%patch11 -%patch12 %build unset ${!LC_*} diff --git a/utf8-names-3b1ffcd8.patch b/utf8-names-3b1ffcd8.patch deleted file mode 100644 index 7174aa7..0000000 --- a/utf8-names-3b1ffcd8.patch +++ /dev/null @@ -1,81 +0,0 @@ -Based on 3b1ffcd8c3387f67fd9be5e1da73d780dffbdd51 Mon Sep 17 00:00:00 2001 -From: Ikumi Keita -Date: Mon, 28 May 2018 14:46:52 +0900 -Subject: [PATCH] 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 | 31 +++++++++++++++++++++++-------- - 1 file changed, 23 insertions(+), 8 deletions(-) - ---- preview.el.in -+++ preview.el.in 2018-07-25 08:32:38.554859129 +0000 -@@ -2227,7 +2227,14 @@ list of LaTeX commands is inserted just - (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 -@@ -3302,8 +3309,12 @@ This is passed through `preview-do-repla - - (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 -@@ -3347,8 +3358,11 @@ If FORMAT-CONS is non-nil, a previous fo - ;; 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 -@@ -3535,9 +3549,10 @@ internal parameters, STR may be a log to - (set-buffer commandbuff) - (let* - ((preview-format-name (shell-quote-argument -- (preview-dump-file-name -- (file-name-nondirectory master)))) -- (process-environment process-environment) -+ (concat "&" -+ (preview-dump-file-name -+ (file-name-nondirectory master))))) -+ (process-environment (copy-sequence process-environment)) - (process - (progn - ;; Fix Bug#20773, Bug#27088. diff --git a/utf8-names-a8ea1273.patch b/utf8-names-a8ea1273.patch deleted file mode 100644 index b631f80..0000000 --- a/utf8-names-a8ea1273.patch +++ /dev/null @@ -1,223 +0,0 @@ -Based on a8ea1273fd95da5702fe95ad3f41d151b621bc72 Mon Sep 17 00:00:00 2001 -From: Ikumi Keita -Date: Mon, 28 May 2018 14:39:26 +0900 -Subject: [PATCH] Accept non-ascii file name in accord with change in TL 2018 - -* tex.el (TeX-expand-list-builtin): Add new entry %T. Same as %t, -except to enclose with \detokenize{} for non UTF-8 LaTeX when \input -is supplmented. -Adjust the entries %` and %' so that \input is supplemented only when -any TeX code is present between them and leave the bind to -`TeX-command-text' for later examination. -The bind to `TeX-command-pos' is no longer retained. -(TeX-command-list): Use %T for "LaTeX". -Adjust "TeX" and "AmSTeX" as the same with "LaTeX" in the aspect that -user can supply one's own TeX code, as well as any command line -options, through `TeX-command-extra-options'. -* tex-buf.el (TeX--master-or-region-file-with-extra-quotes): New -function to act as a wrapper of `TeX-master-file' and -`TeX-region-file' inside `TeX-command-expand'. -(TeX-command-expand): Use the above function as the value of `file' -and get rid of tricky temporal overriding of `file' with lambda form. -(TeX-region-create): Make the first line parsing of %&FORMAT -construct, if any, to be valid even for region compilation. -Discard text properties when constructing the content of _region_.tex. -Drop bind check for `buffer-file-coding-system'. -* tests/tex/command-expansion.el (TeX-command-expansion): Reflect the -change that \input is not necessarily supplemented now by %`-%' pair -in `TeX-command-expand'. ---- - tex-buf.el | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++---------- - tex.el | 38 +++++++++++++++++------------ - 2 files changed, 88 insertions(+), 28 deletions(-) - ---- tex-buf.el -+++ tex-buf.el 2018-07-25 08:47:13.599124117 +0000 -@@ -554,12 +554,8 @@ without further expansion." - (let (pat - pos ;;FIXME: Should this be dynamically scoped? - entry TeX-command-text TeX-command-pos -- ;; FIXME: This variable appears to be unused! -- (file `(lambda (&rest args) -- (shell-quote-argument -- (concat (and (stringp TeX-command-pos) TeX-command-pos) -- (apply #',file args) -- (and (stringp TeX-command-pos) TeX-command-pos))))) -+ (orig-file file) -+ (file #'TeX--master-or-region-file-with-extra-quotes) - expansion-res case-fold-search string expansion arguments) - (setq list (cons - (list "%%" (lambda nil -@@ -597,6 +593,47 @@ without further expansion." - (replace-match string t t command))))) - command) - -+(defun TeX--master-or-region-file-with-extra-quotes -+ (&optional extension nondirectory ask extra) -+ "Return file name with quote for shell. -+Wrapper for `TeX-master-file' or `TeX-region-file' to be used in -+`TeX-command-expand'. -+It is assumed that `orig-file' has dynamic binding of the value of -+`TeX-master-file' or `TeX-region-file'. Pass EXTENSION, NONDIRECTORY -+and ASK to that function as-is, and arrange the returned file name for -+use with command shell. -+Enclose the file name with space within quotes `\"' first when -+\" \\input\" is supplemented (indicated by dynamically binded -+variable `TeX-command-text' having string value.) -+Enclose the file name within \\detokenize{} when the following three -+conditions are met: -+1. compiling with standard (pdf)LaTeX or upLaTeX -+2. \" \\input\" is supplemented -+3. EXTRA is non-nil. (default when expanding \"%T\")" -+ (shell-quote-argument -+ (let* ((raw (funcall orig-file extension nondirectory ask)) -+ ;; String `TeX-command-text' means that the file name is -+ ;; given through \input command. -+ (quote-for-space (if (and (stringp TeX-command-text) -+ (string-match " " raw)) -+ "\"" ""))) -+ (format -+ (if (and extra -+ (stringp TeX-command-text) -+ (memq major-mode '(latex-mode doctex-mode)) -+ (memq TeX-engine '(default uptex))) -+ ;; 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 precedes. -+ "\\detokenize{ %s }" "%s") -+ (concat quote-for-space raw quote-for-space))))) -+ - (defun TeX-check-files (derived originals extensions) - "Check if DERIVED is newer than any of the ORIGINALS. - Try each original with each member of EXTENSIONS, in all directories -@@ -2104,8 +2141,10 @@ original file." - (if (not (re-search-forward TeX-header-end nil t)) - "" - (re-search-forward "[\r\n]" nil t) -- (buffer-substring (point-min) (point))))))))) -+ (buffer-substring-no-properties -+ (point-min) (point))))))))) - (header-offset 0) -+ first-line - ;; We search for the trailer from the master file, if it is - ;; not present in the region. - (trailer-offset 0) -@@ -2125,21 +2164,36 @@ original file." - ;;(beginning-of-line 1) - (re-search-backward "[\r\n]" nil t) - (setq trailer-offset (TeX-current-offset)) -- (buffer-substring (point) (point-max)))))))))) -+ (buffer-substring-no-properties -+ (point) (point-max)))))))))) - ;; file name should be relative to master - (setq original (TeX-quote-filename (file-relative-name - original (TeX-master-directory))) - master-name (TeX-quote-filename master-name)) -+ -+ ;; If the first line begins with "%&", put that line separately on -+ ;; the very first line of the region file so that the first line -+ ;; parsing will work. -+ (setq first-line (if (and (> (length header) 1) -+ (string= (substring header 0 2) "%&")) -+ ;; This would work even if header has no newline. -+ (substring header 0 (string-match "\n" header)) -+ "")) -+ (unless (string= first-line "") -+ ;; Remove first-line from header. -+ (setq header (substring header (length first-line))) -+ (setq first-line (concat first-line "\n"))) -+ - (with-current-buffer file-buffer - (setq buffer-read-only t - buffer-undo-list t) - (setq original-content (buffer-string)) - (let ((inhibit-read-only t)) - (erase-buffer) -- (when (boundp 'buffer-file-coding-system) -- (setq buffer-file-coding-system -- (with-current-buffer master-buffer buffer-file-coding-system))) -- (insert "\\message{ !name(" master-name ")}" -+ (setq buffer-file-coding-system -+ (with-current-buffer master-buffer buffer-file-coding-system)) -+ (insert first-line -+ "\\message{ !name(" master-name ")}" - header - TeX-region-extra - "\n\\message{ !name(" original ") !offset(") ---- tex.el -+++ tex.el 2018-07-25 08:47:13.599124117 +0000 -@@ -121,10 +121,10 @@ If nil, none is specified." - ;; `TeX-expand-list-builtin' for a description of the % escapes - - (defcustom TeX-command-list -- '(("TeX" "%(PDF)%(tex) %(file-line-error) %(extraopts) %`%S%(PDFout)%(mode)%' %t" -+ '(("TeX" "%(PDF)%(tex) %(file-line-error) %`%(extraopts) %S%(PDFout)%(mode)%' %t" - TeX-run-TeX nil - (plain-tex-mode ams-tex-mode texinfo-mode) :help "Run plain TeX") -- ("LaTeX" "%`%l%(mode)%' %t" -+ ("LaTeX" "%`%l%(mode)%' %T" - TeX-run-TeX nil - (latex-mode doctex-mode) :help "Run LaTeX") - ;; Not part of standard TeX. -@@ -132,7 +132,7 @@ If nil, none is specified." - (texinfo-mode) :help "Run Makeinfo with Info output") - ("Makeinfo HTML" "makeinfo %(extraopts) --html %t" TeX-run-compile nil - (texinfo-mode) :help "Run Makeinfo with HTML output") -- ("AmSTeX" "amstex %(PDFout) %(extraopts) %`%S%(mode)%' %t" -+ ("AmSTeX" "amstex %(PDFout) %`%(extraopts) %S%(mode)%' %t" - TeX-run-TeX nil (ams-tex-mode) :help "Run AMSTeX") - ;; support for ConTeXt --pg - ;; first version of ConTeXt to support nonstopmode: 2003.2.10 -@@ -503,8 +503,19 @@ string." - ;; `file' means to call `TeX-master-file' or `TeX-region-file' - ("%s" file nil t) - ("%t" file t t) -+ ;; If any TeX codes appear in the interval between %` and %', move -+ ;; all of them after the interval and supplement " \input". The -+ ;; appearance is marked by leaving the bind to `TeX-command-text' -+ ;; with the TeX codes. -+ ;; Rule: -+ ;; 1. %` and %' must appear in pair. -+ ;; 2. %` and %' must not appear more than once in one command -+ ;; line string (including the results of %-expansion). -+ ;; 3. Each TeX codes between %` and %' must be enclosed in -+ ;; double quotes and preceded by a space. - ("%`" (lambda nil -- (setq TeX-command-pos t TeX-command-text ""))) -+ (setq TeX-command-pos t TeX-command-text nil) -+ "")) - (" \"\\" (lambda nil - (if (eq TeX-command-pos t) - (setq TeX-command-pos pos -@@ -528,18 +539,13 @@ string." - TeX-command-pos t) - (setq pos (1+ pos))))) - ("%'" (lambda nil -- (prog1 -- (if (stringp TeX-command-text) -- (progn -- (setq pos (+ pos (length TeX-command-text) 9) -- TeX-command-pos -- (and (string-match " " -- (funcall file t t)) -- "\"")) -- (concat TeX-command-text " \"\\input\"")) -- (setq TeX-command-pos nil) -- "") -- (setq TeX-command-text nil)))) -+ (setq TeX-command-pos nil) -+ (if (stringp TeX-command-text) -+ (progn -+ (setq pos (+ pos (length TeX-command-text) 9)) -+ (concat TeX-command-text " \"\\input\"")) -+ ""))) -+ ("%T" TeX--master-or-region-file-with-extra-quotes t t nil t) - ("%n" TeX-current-line) - ("%d" file "dvi" t) - ("%f" file "ps" t) diff --git a/utf8-names-fix-boo1135326.patch b/utf8-names-fix-boo1135326.patch deleted file mode 100644 index eb43a85..0000000 --- a/utf8-names-fix-boo1135326.patch +++ /dev/null @@ -1,110 +0,0 @@ ---- tex-buf.el -+++ tex-buf.el 2019-06-21 13:02:03.572805297 +0000 -@@ -555,7 +555,6 @@ without further expansion." - pos ;;FIXME: Should this be dynamically scoped? - entry TeX-command-text TeX-command-pos - (orig-file file) -- (file #'TeX--master-or-region-file-with-extra-quotes) - expansion-res case-fold-search string expansion arguments) - (setq list (cons - (list "%%" (lambda nil -@@ -563,6 +562,17 @@ without further expansion." - "%")) - (or list (TeX-expand-list))) - pat (regexp-opt (mapcar #'car list))) -+ ;; `TeX-command-expand' is called with `file' argument being one -+ ;; of `TeX-master-file', `TeX-region-file' and -+ ;; `TeX-active-master'. The return value of these functions -+ ;; sometimes needs suitable "decorations" for an argument for -+ ;; underlying shell or latex executable, or both, when the -+ ;; relavant file name involves some special characters such as -+ ;; space and multibyte characters. Hence embed that function in a -+ ;; template prepared for that purpose. -+ (setq file (apply-partially -+ #'TeX--master-or-region-file-with-extra-quotes -+ file)) - (while (setq pos (string-match pat command pos)) - (setq string (match-string 0 command) - entry (assoc string list) -@@ -594,24 +604,29 @@ without further expansion." - command) - - (defun TeX--master-or-region-file-with-extra-quotes -- (&optional extension nondirectory ask extra) -+ (file-fn &optional extension nondirectory ask extra) - "Return file name with quote for shell. --Wrapper for `TeX-master-file' or `TeX-region-file' to be used in --`TeX-command-expand'. --It is assumed that `orig-file' has dynamic binding of the value of --`TeX-master-file' or `TeX-region-file'. Pass EXTENSION, NONDIRECTORY --and ASK to that function as-is, and arrange the returned file name for --use with command shell. --Enclose the file name with space within quotes `\"' first when --\" \\input\" is supplemented (indicated by dynamically binded --variable `TeX-command-text' having string value.) --Enclose the file name within \\detokenize{} when the following three -+Helper function of `TeX-command-expand'. -+ -+This is a kind of template. How to use: -+Fix, by `apply-partially', the first argument FILE-FN as one of -+the three functions `TeX-master-file', `TeX-region-file' or -+`TeX-active-master'. Then the result is just a wrapper for that -+function suitable in `TeX-command-expand'. -+ -+As a wrapper described above, it passes EXTENSION, NONDIRECTORY -+and ASK to the \"bare\" function as-is, and arranges the returned -+file name for use with command shell. I.e. it encloses the file -+name with space within quotes `\"' first when \" \\input\" is -+supplemented (indicated by dynamically binded variable -+`TeX-command-text' having string value.) It also encloses the -+file name within \\detokenize{} when the following three - conditions are met: - 1. compiling with standard (pdf)LaTeX or upLaTeX - 2. \" \\input\" is supplemented - 3. EXTRA is non-nil. (default when expanding \"%T\")" - (shell-quote-argument -- (let* ((raw (funcall orig-file extension nondirectory ask)) -+ (let* ((raw (funcall file-fn extension nondirectory ask)) - ;; String `TeX-command-text' means that the file name is - ;; given through \input command. - (quote-for-space (if (and (stringp TeX-command-text) -@@ -2031,14 +2046,22 @@ command." - (with-current-buffer TeX-command-buffer - (TeX-process-buffer (TeX-active-master))))) - --(defun TeX-active-master (&optional extension nondirectory) -+(defun TeX-active-master (&optional extension nondirectory _ignore) - "The master file currently being compiled. - - If optional argument EXTENSION is non-nil, add that file extension to - the name. Special value t means use `TeX-default-extension'. - - If optional second argument NONDIRECTORY is non-nil, do not include --the directory." -+the directory. -+ -+The compatibility argument IGNORE is ignored." -+ ;; The third argument `_ignore' is kept for symmetry with -+ ;; `TeX-master-file's third argument `ask'. For example, it's used -+ ;; in `TeX--master-or-region-file-with-extra-quotes', where we don't -+ ;; know which function has to be called. Keep this in mind should -+ ;; you want to use another argument here. -+ ;; See also the similar comment in `TeX-region-file'. - (if TeX-current-process-region-p - (TeX-region-file extension nondirectory) - (TeX-master-file extension nondirectory))) ---- tex.el -+++ tex.el 2019-06-21 12:58:20.442057420 +0000 -@@ -545,7 +545,11 @@ string." - (setq pos (+ pos (length TeX-command-text) 9)) - (concat TeX-command-text " \"\\input\"")) - ""))) -- ("%T" TeX--master-or-region-file-with-extra-quotes t t nil t) -+ ;; The fourth argument of t is actually for wrapper function -+ ;; provided by `TeX--master-or-region-file-with-extra-quotes'. -+ ;; See its doc string as well as the comments in -+ ;; `TeX-command-expand'. -+ ("%T" file t t nil t) - ("%n" TeX-current-line) - ("%d" file "dvi" t) - ("%f" file "ps" t)