[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] [elpa] externals/auctex ff688b9 33/80: Stop depreciated u
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] [elpa] externals/auctex ff688b9 33/80: Stop depreciated usage of undeclared dynamic variable |
Date: |
Wed, 16 Oct 2019 11:07:12 -0400 (EDT) |
branch: externals/auctex
commit ff688b98e8837387ca5a22f8ff2d57f8bf8fffcd
Author: Ikumi Keita <address@hidden>
Commit: Ikumi Keita <address@hidden>
Stop depreciated usage of undeclared dynamic variable
* tex-buf.el (TeX--master-or-region-file-with-extra-quotes): Redefine
as template. On accepting one of `TeX-master-file', `TeX-region-file'
or `TeX-active-master' as its first argument, it becomes a wrapper for
those three, like previous definition.
(TeX-command-expand): Arrage in accord with the above change.
With these two changes, we no longer need implicit dynamic binding of
non-special variable `orig-file'.
* tex.el (TeX-expand-list-builtin): Update supplementary comment for
"%T".
---
tex-buf.el | 53 +++++++++++++++++++++++++++++++++++++----------------
tex.el | 5 +++--
2 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/tex-buf.el b/tex-buf.el
index e89df51..0849198 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -1,6 +1,6 @@
;;; tex-buf.el --- External commands for AUCTeX.
-;; Copyright (C) 1991-1999, 2001-2018 Free Software Foundation, Inc.
+;; Copyright (C) 1991-1999, 2001-2019 Free Software Foundation, Inc.
;; Maintainer: address@hidden
;; Keywords: tex, wp
@@ -547,8 +547,6 @@ without further expansion."
(let (pat
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
@@ -572,6 +570,24 @@ without further expansion."
(functionp expansion))
(apply expansion arguments))
((boundp expansion)
+ (if (eq expansion 'file)
+ ;; `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)))
(setq expansion-res
(apply (symbol-value expansion) arguments))
(when (eq expansion 'file)
@@ -587,24 +603,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', `TeX-region-file' or
-`TeX-active-master' to be used in `TeX-command-expand'.
-It is assumed that `orig-file' has dynamic binding of the value
-of `TeX-master-file', `TeX-region-file' or `TeX-active-master'.
-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\")"
+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)
diff --git a/tex.el b/tex.el
index 684b6f7..0fda0d5 100644
--- a/tex.el
+++ b/tex.el
@@ -555,8 +555,9 @@ string."
(concat TeX-command-text " \"\input\""))
"")))
;; The fourth argument of t is actually for wrapper function
- ;; `TeX--master-or-region-file-with-extra-quotes', temporally set
- ;; as value of `file' in `TeX-command-expand'.
+ ;; 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)
- [AUCTeX-diffs] [elpa] externals/auctex 1b6e513 22/80: ; Use `LaTeX-extract-key-value-label', (continued)
- [AUCTeX-diffs] [elpa] externals/auctex 1b6e513 22/80: ; Use `LaTeX-extract-key-value-label', Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex ab57cb0 21/80: Add new function `LaTeX-extract-key-value-label', Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex ddd7894 20/80: ; Fix last commit, Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex af15814 42/80: ; * style/babel.el: Fix typo, remove code remainder., Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex 8530cd0 45/80: Support cleveref labels, Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex 4611580 32/80: * tex-jp.el (AUCTeX-jp): Add keyword :link to info node., Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex a9eb155 37/80: Fix regression, Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex 4776fd0 25/80: ; Remove compatibility code for older emacsen, Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex 400b002 28/80: Remove obsolete codes, Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex a8bbd1f 31/80: ; Fix document, Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex ff688b9 33/80: Stop depreciated usage of undeclared dynamic variable,
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex 945ffaf 40/80: Update style/babel.el to package version 3.31, Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex 1b88eda 38/80: Fix autoload generation code (bug#35758), Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex b141ded 27/80: Remove compatibility code for xemacs, Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex 92c090d 30/80: Fix treatment of class and package options, Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex 36d06e2 44/80: ; * tests/latex/preview-latex-test.el: Fix typo., Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex 686366e 48/80: ; Add Emacs 24 compatibility to the previous commit, Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex cdb98c6 34/80: Fix last commit, Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex 0a9407c 47/80: Conform to `delete-selection-mode' (bug#36385), Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex 90fcbd4 41/80: Make navigation function robust, Tassilo Horn, 2019/10/16
- [AUCTeX-diffs] [elpa] externals/auctex f127145 60/80: * context.el (ConTeXt-environment): Fix docstring., Tassilo Horn, 2019/10/16