[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 41/299: * tex-buf.el (TeX-output-revert-buffer): New function. (T
From: |
Stefan Monnier |
Subject: |
[elpa] 41/299: * tex-buf.el (TeX-output-revert-buffer): New function. (TeX-special-mode, TeX-output-mode): New major modes. (TeX-special-mode-map, TeX-output-mode-map): New variables. |
Date: |
Sun, 02 Nov 2014 03:10:08 +0000 |
monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 271951d94b096650a2f84cf6f3f444d6b6ac993c
Author: Tassilo Horn <address@hidden>
Date: Fri Jan 25 08:05:03 2013 +0000
* tex-buf.el (TeX-output-revert-buffer): New function.
(TeX-special-mode, TeX-output-mode): New major modes.
(TeX-special-mode-map, TeX-output-mode-map): New variables.
---
ChangeLog | 6 +++++
tex-buf.el | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 79 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 46184ae..b74c7ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-01-24 Ivan Andrus <address@hidden>
+
+ * tex-buf.el (TeX-output-revert-buffer): New function.
+ (TeX-special-mode, TeX-output-mode): New major modes.
+ (TeX-special-mode-map, TeX-output-mode-map): New variables.
+
2013-01-21 Tassilo Horn <address@hidden>
* Makefile.in (STYLESRC): Activate new style placeins.el.
diff --git a/tex-buf.el b/tex-buf.el
index 07f0502..0afcd26 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -571,7 +571,7 @@ Return the new process."
(set (make-local-variable 'TeX-command-buffer) command-buff)
(if dir (cd dir))
(insert "Running `" name "' on `" file "' with ``" command "''\n")
- (setq mode-name name)
+ (TeX-output-mode)
(if TeX-show-compilation
(display-buffer buffer)
(message "Type `%s' to display results of compilation."
@@ -1780,6 +1780,7 @@ You might want to examine and modify the free variables
`file',
(buffer-substring start (point))))
help))))
(goto-char (point-min))
+ (TeX-special-mode)
(TeX-pop-to-buffer old-buffer nil t)))
;;; Error Messages
@@ -2202,6 +2203,77 @@ error."
(regexp :tag "Match")
(string :format "Description:\n%v"))))
+;;; Output mode
+
+(if (fboundp 'special-mode)
+ (progn
+ (defalias 'TeX-special-mode 'special-mode)
+ (defvaralias 'TeX-special-mode-map 'special-mode-map))
+ (defun TeX-special-mode ()
+ "Placeholder mode for Emacsen which don't have `special-mode'.")
+ (defvar TeX-special-mode-map
+ (let ((map (make-sparse-keymap)))
+ (suppress-keymap map)
+ (define-key map "q" (if (fboundp 'quit-window)
+ 'quit-window
+ 'bury-buffer))
+ (define-key map " " (if (fboundp 'scroll-up-command)
+ 'scroll-up-command
+ 'scroll-up))
+ (define-key map [backspace] (if (fboundp 'scroll-down-command)
+ 'scroll-down-command
+ 'scroll-down))
+ (define-key map "\C-?" (if (fboundp 'scroll-down-command)
+ 'scroll-down-command
+ 'scroll-down))
+ (define-key map "?" 'describe-mode)
+ (define-key map "h" 'describe-mode)
+ (define-key map ">" 'end-of-buffer)
+ (define-key map "<" 'beginning-of-buffer)
+ (define-key map "g" 'revert-buffer)
+ map)
+ "Keymap for `TeX-special-mode-map'."))
+
+(defvar TeX-output-mode-map
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map TeX-special-mode-map)
+ (define-key map "n" 'TeX-next-error)
+ ;; TODO: Implement TeX-previous-error
+ ;; (define-key map "p" 'TeX-previous-error)
+ (define-key map "b" 'TeX-toggle-debug-bad-boxes)
+ (define-key map "w" 'TeX-toggle-debug-warnings)
+ (define-key map "i" (lambda ()
+ (interactive)
+ (with-current-buffer TeX-command-buffer
+ (TeX-interactive-mode (if TeX-interactive-mode -1
1)))))
+ (define-key map "s" (lambda ()
+ (interactive)
+ (with-current-buffer TeX-command-buffer
+ (TeX-source-correlate-mode (if
TeX-source-correlate-mode -1 1)))))
+ map)
+ "Keymap for `TeX-output-mode'.")
+
+(define-derived-mode TeX-output-mode TeX-special-mode "TeX Output"
+ "Major mode for viewing TeX output.
+\\{TeX-output-mode-map} "
+ :syntax-table nil
+ (setq revert-buffer-function #'TeX-output-revert-buffer)
+ ;; special-mode makes it read-only which prevents input from TeX.
+ (setq buffer-read-only nil))
+
+(defun TeX-output-revert-buffer (ignore-auto noconfirm)
+ "Rerun the TeX command which of which this buffer was the output."
+ (goto-char (point-min))
+ (if (looking-at "Running `\\(.*\\)' on `\\(.*\\)' with ``\\(.*\\)''$")
+ (let ((name (match-string 1))
+ (file (match-string 2))
+ (command (match-string 3)))
+ (with-current-buffer TeX-command-buffer
+ (TeX-command name (if (string-match "_region_" file)
+ 'TeX-region-file
+ 'TeX-master-file))))
+ (error "Unable to find what command to run.")))
+
(provide 'tex-buf)
;;; tex-buf.el ends here
- [elpa] 34/299: Fix previous change to auctex.texi., (continued)
- [elpa] 34/299: Fix previous change to auctex.texi., Stefan Monnier, 2014/11/01
- [elpa] 30/299: * style/varioref.el: Update copyright range. ("varioref"): Add more definitions. (LaTeX-varioref-package-options): Reformat., Stefan Monnier, 2014/11/01
- [elpa] 36/299: * doc/auctex.texi: Document `TeX-arg-length' and `TeX-arg-define-length'., Stefan Monnier, 2014/11/01
- [elpa] 37/299: * doc/todo.texi: Remove the todo concerning completion for counters that was implemented by Mosè Giordano on 2013-01-15., Stefan Monnier, 2014/11/01
- [elpa] 31/299: * style/listings.el: Update copyright range. (LaTeX-listings-key-val-options, "listings") (LaTeX-listings-package-options): Update to recent listings version., Stefan Monnier, 2014/11/01
- [elpa] 38/299: * style/placeins.el: New style., Stefan Monnier, 2014/11/01
- [elpa] 39/299: * texmathp.el (texmathp-tex-commands-default): Add \shortintertext., Stefan Monnier, 2014/11/01
- [elpa] 35/299: * latex.el (LaTeX-auto-length-regexp-list): New variable. (LaTeX-auto-regexp-list): Use `LaTeX-auto-length-regexp-list'. ("length"): New type for the parser. (TeX-arg-length): New function. (TeX-arg-define-length): New function. (LaTeX-common-initialization): Initialize some standard LaTeX lengths and use `TeX-arg-length' and `TeX-arg-define-length' for completion of some macros., Stefan Monnier, 2014/11/01
- [elpa] 40/299: * Makefile.in (STYLESRC): Activate new style placeins.el., Stefan Monnier, 2014/11/01
- [elpa] 33/299: * doc/auctex.texi: Document that `TeX-arg-counter' does completion now. * latex.el (LaTeX-auto-pagestyle-regexp-list): Fix typo. (LaTeX-auto-counter-regexp-list): New variable. (LaTeX-auto-regexp-list): Use `LaTeX-auto-counter-regexp-list'. ("counter"): New type for the parser. (TeX-arg-counter): Use `LaTeX-counter-list' function for completion and `definition' argument. (TeX-arg-pagestyle): Use `definition' argument. (LaTeX-common-initialization): Initialize counters., Stefan Monnier, 2014/11/01
- [elpa] 41/299: * tex-buf.el (TeX-output-revert-buffer): New function. (TeX-special-mode, TeX-output-mode): New major modes. (TeX-special-mode-map, TeX-output-mode-map): New variables.,
Stefan Monnier <=
- [elpa] 43/299: * tex-buf.el (TeX-output-mode): Make revert-buffer-function buffer local before setting it to TeX-output-revert-buffer., Stefan Monnier, 2014/11/01
- [elpa] 42/299: * auctex.texi: Updated documetation about ChkTeX and lacheck. Fixed typos., Stefan Monnier, 2014/11/01
- [elpa] 44/299: * style/siunitx.el ("siunitx"): Add `\gram' and `\SendSettingsToPgf'., Stefan Monnier, 2014/11/01
- [elpa] 46/299: * latex.el (LaTeX-env-contents): Replaced regular expression with `LaTeX-header-end', i.e., filecontents environments must go somewhere in the preamble but not necessarily before the \documentclass., Stefan Monnier, 2014/11/01
- [elpa] 45/299: * latex.el (LaTeX-auto-savebox-regexp-list): New variable. (LaTeX-auto-regexp-list): Use `LaTeX-auto-savebox-regexp-list'. ("savebox"): New type for the parser. (TeX-arg-savebox): Use `LaTeX-savebox-list' for completion and `definition' argument. (LaTeX-common-initialization): Added makeatletter, makeatother, and jobname macros. (LaTeX-default-options): Changed documentstyle to documentclass in docstring., Stefan Monnier, 2014/11/01
- [elpa] 47/299: * doc/todo.texi (Wishlist): Remove "Completion for sboxes"., Stefan Monnier, 2014/11/01
- [elpa] 48/299: * style/biblatex.el: Update copyright range. ("biblatex"): Check `backend' option value in `TeX-active-styles'. * tex-style.el: Update copyright years. (LaTeX-biblatex-use-Biber) Remove unused variable. * tex.el: Update copyright range. (TeX-auto-add-type): Append new type to `TeX-auto-parser' instead of prepending it. (TeX-auto-store): Fix indentation of first lines of parsed file. * latex.el (LaTeX-auto-cleanup): Append options and styles to `TeX-auto-file' instead of prepending them., Stefan Monnier, 2014/11/01
- [elpa] 51/299: * Makefile.in (STYLESRC): Activate new style fancynum.el., Stefan Monnier, 2014/11/01
- [elpa] 50/299: * Makefile.in (STYLESRC): Activate new style nameref.el., Stefan Monnier, 2014/11/01
- [elpa] 52/299: * Makefile.in (STYLESRC): Activate new style filecontents.el., Stefan Monnier, 2014/11/01