[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 647a8fc 29/78: Fixes for "run-all" on current se
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 647a8fc 29/78: Fixes for "run-all" on current section |
Date: |
Mon, 19 Oct 2015 09:10:49 +0000 |
branch: externals/auctex
commit 647a8fc8a5678eab472daadc43f9b1c5e9e01264
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>
Fixes for "run-all" on current section
* tex-buf.el (TeX-command-sequence-file-function): New variable.
(TeX-command-sequence): Use it.
(LaTeX-command-section-boundaries): Recognize end of document as
ultimate boundary.
(LaTeX-command-section): Signal an error if not in a LaTeX buffer.
(LaTeX-command-run-all-section): Ditto.
---
ChangeLog | 7 +++++++
tex-buf.el | 45 +++++++++++++++++++++++++++------------------
2 files changed, 34 insertions(+), 18 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9dec281..7ddb7cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,13 @@
2015-09-04 Tassilo Horn <address@hidden>
+ * tex-buf.el (TeX-command-sequence-file-function): New variable.
+ (TeX-command-sequence): Use it.
+ (LaTeX-command-section-boundaries): Recognize end of document as
+ ultimate boundary.
+ (LaTeX-command-section): Signal an error if not in a LaTeX buffer.
+ (LaTeX-command-run-all-section): Ditto.
+
* tex.el: Add autoloads for the new commands.
* tex-buf.el (TeX-region-update): New function.
diff --git a/tex-buf.el b/tex-buf.el
index 6afe51e..c13a87e 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -581,6 +581,9 @@ ORIGINALS which are modified but not saved yet."
(defvar TeX-command-sequence-sentinel nil
"Sentinel for `TeX-command-sequence'.")
+(defvar TeX-command-sequence-file-function nil
+ "File function for `TeX-command-sequence'.")
+
(defvar TeX-command-sequence-command nil
"Command argument for `TeX-command-sequence'.
@@ -623,7 +626,7 @@ 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))
+ (setq TeX-command-sequence-file-function (or file-fn #'TeX-master-file))
(if (null command)
(message "No command to run.")
(let (cmd process)
@@ -638,9 +641,10 @@ omitted) and `TeX-region-file'."
(setq cmd (funcall command)
TeX-command-sequence-command command))
(t
- (setq cmd (TeX-command-default (funcall file-fn nil t))
+ (setq cmd (TeX-command-default
+ (funcall TeX-command-sequence-file-function nil t))
TeX-command-sequence-command t)))
- (TeX-command cmd file-fn 0)
+ (TeX-command cmd TeX-command-sequence-file-function 0)
(when reset
(setq TeX-command-sequence-count-same-command 1
TeX-command-sequence-count 1
@@ -1466,7 +1470,8 @@ variable is nil."
(or
(plist-get TeX-error-report-switches (intern (TeX-master-file)))
(null TeX-command-sequence-command))
- (TeX-command-sequence TeX-command-sequence-command))))))
+ (TeX-command-sequence TeX-command-sequence-command nil
+ TeX-command-sequence-file-function))))))
;;; Process Control
@@ -1600,7 +1605,7 @@ command."
(defvar TeX-parse-function nil
"Function to call to parse content of TeX output buffer.")
- (make-variable-buffer-local 'TeX-parse-function)
+(make-variable-buffer-local 'TeX-parse-function)
(defun TeX-background-filter (process string)
"Filter to process background output."
@@ -1885,7 +1890,7 @@ The section is determined by
`LaTeX-command-section-level'."
(re-search-backward rx nil t)
(point))
(save-excursion
- (re-search-forward rx nil t)
+ (re-search-forward (concat rx "\\|\\\\end{document}") nil t)
(forward-line 0)
(point)))))
@@ -1904,10 +1909,12 @@ If a prefix argument OVERRIDE-CONFIRM is given,
confirmation will
depend on it being positive instead of the entry in
`TeX-command-list'."
(interactive "P")
- (let* ((bounds (LaTeX-command-section-boundaries))
- (TeX-command-region-begin (car bounds))
- (TeX-command-region-end (cdr bounds)))
- (TeX-command-region override-confirm)))
+ (if (eq major-mode 'latex-mode)
+ (let* ((bounds (LaTeX-command-section-boundaries))
+ (TeX-command-region-begin (car bounds))
+ (TeX-command-region-end (cdr bounds)))
+ (TeX-command-region override-confirm))
+ (error "LaTeX-command-section can only be run on LaTeX documents")))
(defun TeX-command-run-all-region ()
"Compile the current region until an error occurs or it is finished."
@@ -1918,11 +1925,13 @@ depend on it being positive instead of the entry in
(defun LaTeX-command-run-all-section ()
"Compile the current section until an error occurs or it is finished."
(interactive)
- (let* ((bounds (LaTeX-command-section-boundaries))
- (TeX-command-region-begin (car bounds))
- (TeX-command-region-end (cdr bounds)))
- (TeX-region-update))
- (TeX-command-sequence t t #'TeX-region-file))
+ (if (eq major-mode 'latex-mode)
+ (let* ((bounds (LaTeX-command-section-boundaries))
+ (TeX-command-region-begin (car bounds))
+ (TeX-command-region-end (cdr bounds)))
+ (TeX-region-update)
+ (TeX-command-sequence t t #'TeX-region-file))
+ (error "LaTeX-command-run-all-section can only be run on LaTeX
documents")))
(defun TeX-command-run-all (arg)
"Compile the current document until an error occurs or it is finished.
@@ -1945,17 +1954,17 @@ compile the current section instead, e.g. call
(defvar TeX-error-point nil
"How far we have parsed until now.")
- (make-variable-buffer-local 'TeX-error-point)
+(make-variable-buffer-local 'TeX-error-point)
(defvar TeX-error-file nil
"Stack of files in which errors have occurred.")
- (make-variable-buffer-local 'TeX-error-file)
+(make-variable-buffer-local 'TeX-error-file)
(defvar TeX-error-offset nil
"Add this to any line numbers from TeX. Stack like `TeX-error-file'.")
- (make-variable-buffer-local 'TeX-error-offset)
+(make-variable-buffer-local 'TeX-error-offset)
(defun TeX-parse-reset (&optional reparse)
"Reset all variables used for parsing TeX output.
- [elpa] externals/auctex 0b3a6e8 12/78: Do not indent the content of `Form' environment., (continued)
- [elpa] externals/auctex 0b3a6e8 12/78: Do not indent the content of `Form' environment., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 40963e5 08/78: Check engine before running LaTeX command., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 33cee84 19/78: Allow TeX-command-sequence to process the region, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 513490f 22/78: Implement multi-level script fontification, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 76eb240 25/78: Docfix, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex a07f436 16/78: Implement TeX-update., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex dbc87df 17/78: Generate PDF via dvips+ps2pdf., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex dd9adef 21/78: Case-sensitive mode detection + AMS-TeX fixes, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex da7419f 42/78: Add new style AlegreyaSans.el., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 9cfd5d8 47/78: Improve LaTeX-find-matching-end, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 647a8fc 29/78: Fixes for "run-all" on current section,
Tassilo Horn <=
- [elpa] externals/auctex 5ed22c0 45/78: FiX TeX error parsing., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 66b97ff 20/78: Don't add font-latex-setup to latex-mode-hook, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex c3cb0ff 26/78: Rename TeX-update to TeX-command-run-all., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex e2b2413 28/78: Reference TeX-command-run-all in documentation., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 69004bc 33/78: Fix wrong TeX-command-default guess for region files, Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 29261e3 34/78: Minor improvements to hyperref.el., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 066cf5a 36/78: Create Italian style file for polyglossia., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 3536b06 48/78: Use default argument of completing-read., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 100ba35 50/78: Fix mail address in Maintainer-header., Tassilo Horn, 2015/10/19
- [elpa] externals/auctex 440936d 52/78: Make `LaTeX-indent-environment-list' local., Tassilo Horn, 2015/10/19