branch: externals/auctex commit 33cee842a2a53b4f3fed5a66792a555b4c95bd2e Author: Tassilo Horn <t...@gnu.org> Commit: Tassilo Horn <t...@gnu.org>
Allow TeX-command-sequence to process the region * tex-buf.el (TeX-command-sequence): Add argument for processing the region file instead of the master file. --- ChangeLog | 3 +++ tex-buf.el | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index dde5951..99973b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2015-09-01 Tassilo Horn <t...@gnu.org> + * tex-buf.el (TeX-command-sequence): Add argument for processing + the region file instead of the master file. + * tex.el (TeX--if-macro-fboundp): New portability macro. (VirTeX-common-initialization): Use it. diff --git a/tex-buf.el b/tex-buf.el index a341727..c670fd7 100644 --- a/tex-buf.el +++ b/tex-buf.el @@ -584,7 +584,7 @@ It is set in `TeX-command-sequence' and used in `TeX-command-sequence-sentinel' to call again `TeX-command-sequence' with the appropriate command argument.") -(defun TeX-command-sequence (command &optional reset) +(defun TeX-command-sequence (command &optional reset file-fn) "Run a sequence of TeX commands defined by COMMAND. The COMMAND argument may be @@ -614,7 +614,12 @@ total in any case. It ends when `TeX-command-Show' is the command to be run. A non-nil value for the optional argument RESET means this is the -first run of the function and some variables need to be reset." +first run of the function and some variables need to be reset. + +FILE-FN is a function of zero arguments returning the current +filename. Valid choices are `TeX-master-file' (default if +omitted) and `TeX-region-file'." + (setq file-fn (or file-fn #'TeX-master-file)) (if (null command) (message "No command to run.") (let (cmd process) @@ -629,9 +634,9 @@ first run of the function and some variables need to be reset." (setq cmd (funcall command) TeX-command-sequence-command command)) (t - (setq cmd (TeX-command-default (TeX-master-file)) + (setq cmd (TeX-command-default (funcall file-fn)) TeX-command-sequence-command t))) - (TeX-command cmd 'TeX-master-file 0) + (TeX-command cmd file-fn 0) (when reset (setq TeX-command-sequence-count-same-command 1 TeX-command-sequence-count 1