"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tex-buf.el" between
auctex-12.2.tar.gz and auctex-12.3.tar.gz

About: AUCTEX is an extensible package for writing and formatting TeX files in GNU Emacs and XEmacs.

tex-buf.el  (auctex-12.2):tex-buf.el  (auctex-12.3)
;;; tex-buf.el --- External commands for AUCTeX. ;;; tex-buf.el --- External commands for AUCTeX.
;; Copyright (C) 1991-1999, 2001-2019 Free Software Foundation, Inc. ;; Copyright (C) 1991-1999, 2001-2020 Free Software Foundation, Inc.
;; Maintainer: auctex-devel@gnu.org ;; Maintainer: auctex-devel@gnu.org
;; Keywords: tex, wp ;; Keywords: tex, wp
;; This file is part of AUCTeX. ;; This file is part of AUCTeX.
;; AUCTeX is free software; you can redistribute it and/or modify it ;; AUCTeX is free software; you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published by ;; under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option) ;; the Free Software Foundation; either version 3, or (at your option)
;; any later version. ;; any later version.
skipping to change at line 425 skipping to change at line 425
(omega . "Omega") (omega . "Omega")
(xetex . "XeTeX"))) (xetex . "XeTeX")))
(completion-ignore-case t) (completion-ignore-case t)
(engine nil)) (engine nil))
(when (when
(cond (cond
;; There is exactly one allowed engine. ;; There is exactly one allowed engine.
((= length 1) ((= length 1)
(setq engine (car TeX-check-engine-list)) (setq engine (car TeX-check-engine-list))
(y-or-n-p (format "%s is required to build this document. (y-or-n-p (format "%s is required to build this document.
Do you want to use this engine?" (cdr (assoc engine name-alist))))) Do you want to use this engine? " (cdr (assoc engine name-alist)))))
;; More than one engine is allowed. ;; More than one engine is allowed.
((> length 1) ((> length 1)
(if (y-or-n-p (format "It appears %s are required to build this docume nt. (if (y-or-n-p (format "It appears %s are required to build this docume nt.
Do you want to select one of these engines?" Do you want to select one of these engines? "
(mapconcat (mapconcat
(lambda (elt) (cdr (assoc elt name-alist))) (lambda (elt) (cdr (assoc elt name-alist)))
TeX-check-engine-list ", "))) TeX-check-engine-list ", ")))
(setq engine (setq engine
(car (rassoc (car (rassoc
(completing-read (completing-read
(format (format
"Choose between %s: " "Choose between %s: "
(mapconcat (mapconcat
(lambda (elt) (cdr (assoc elt name-alist))) (lambda (elt) (cdr (assoc elt name-alist)))
skipping to change at line 452 skipping to change at line 452
(lambda (elt) (cdr (assoc elt name-alist))) (lambda (elt) (cdr (assoc elt name-alist)))
TeX-check-engine-list)) TeX-check-engine-list))
name-alist))) name-alist)))
;; Don't keep asking. If user doesn't want to change engine, ;; Don't keep asking. If user doesn't want to change engine,
;; probably has a good reason. In order to do so, without adding ;; probably has a good reason. In order to do so, without adding
;; yet another variable we just hack `TeX-check-engine-list' and ;; yet another variable we just hack `TeX-check-engine-list' and
;; make it nil. ;; make it nil.
(setq TeX-check-engine-list nil)))) (setq TeX-check-engine-list nil))))
(TeX-engine-set engine) (TeX-engine-set engine)
(when (and (fboundp 'add-file-local-variable) (when (and (fboundp 'add-file-local-variable)
(y-or-n-p "Do you want to remember the choice?")) (y-or-n-p "Do you want to remember the choice? "))
(add-file-local-variable 'TeX-engine engine) (add-file-local-variable 'TeX-engine engine)
(save-buffer)))))) (save-buffer))))))
(defcustom TeX-check-TeX t (defcustom TeX-check-TeX t
"Whether AUCTeX should check if a working TeX distribution is present." "Whether AUCTeX should check if a working TeX distribution is present."
:group 'TeX-command :group 'TeX-command
:type 'boolean) :type 'boolean)
(defcustom TeX-check-TeX-command-not-found 127 (defcustom TeX-check-TeX-command-not-found 127
"Numerical code returned by shell for a command not found error." "Numerical code returned by shell for a command not found error."
skipping to change at line 1137 skipping to change at line 1137
TeX-shell-command-option command))) TeX-shell-command-option command)))
(if TeX-after-start-process-function (if TeX-after-start-process-function
(funcall TeX-after-start-process-function process)) (funcall TeX-after-start-process-function process))
(TeX-command-mode-line process) (TeX-command-mode-line process)
(set-process-filter process #'TeX-command-filter) (set-process-filter process #'TeX-command-filter)
(set-process-sentinel process #'TeX-command-sentinel) (set-process-sentinel process #'TeX-command-sentinel)
(set-marker (process-mark process) (point-max)) (set-marker (process-mark process) (point-max))
(setq compilation-in-progress (cons process compilation-in-progress)) (setq compilation-in-progress (cons process compilation-in-progress))
process) process)
(setq mode-line-process ": run") (setq mode-line-process ": run")
(set-buffer-modified-p (buffer-modified-p)) (force-mode-line-update)
(sit-for 0) ; redisplay
(call-process TeX-shell nil buffer nil (call-process TeX-shell nil buffer nil
TeX-shell-command-option command)))) TeX-shell-command-option command))))
(defun TeX-run-set-command (name command) (defun TeX-run-set-command (name command)
"Remember TeX command to use to NAME and set corresponding output extension." "Remember TeX command to use to NAME and set corresponding output extension."
(setq TeX-command-default name (setq TeX-command-default name
TeX-output-extension TeX-output-extension
(if (and (null (TeX-PDF-from-DVI)) TeX-PDF-mode) "pdf" "dvi")) (if (and (null (TeX-PDF-from-DVI)) TeX-PDF-mode) "pdf" "dvi"))
(let ((case-fold-search t) (let ((case-fold-search t)
(lst TeX-command-output-list)) (lst TeX-command-output-list))
skipping to change at line 1445 skipping to change at line 1444
" finished" " exited") " at " " finished" " exited") " at "
(substring (current-time-string) 0 -5)) (substring (current-time-string) 0 -5))
(setq mode-line-process ": exit") (setq mode-line-process ": exit")
;; Do command specific actions. ;; Do command specific actions.
(setq TeX-command-next TeX-command-Show) (setq TeX-command-next TeX-command-Show)
(goto-char (point-min)) (goto-char (point-min))
(apply TeX-sentinel-function nil name nil) (apply TeX-sentinel-function nil name nil)
;; Force mode line redisplay soon ;; Force mode line redisplay soon
(set-buffer-modified-p (buffer-modified-p))))) (force-mode-line-update))))
(defun TeX-command-sentinel (process msg) (defun TeX-command-sentinel (process msg)
"Process TeX command output buffer after the process dies." "Process TeX command output buffer after the process dies."
;; Set `TeX-transient-master' here because `preview-parse-messages' ;; Set `TeX-transient-master' here because `preview-parse-messages'
;; may open files and thereby trigger master file questions which we ;; may open files and thereby trigger master file questions which we
;; don't want and need because we already know the master. Use ;; don't want and need because we already know the master. Use
;; `TeX-master-file' instead of `TeX-active-master' to determine the ;; `TeX-master-file' instead of `TeX-active-master' to determine the
;; master because the region file should never be the master. ;; master because the region file should never be the master.
(let* ((TeX-transient-master (TeX-master-file)) (let* ((TeX-transient-master (TeX-master-file))
(buffer (process-buffer process)) (buffer (process-buffer process))
skipping to change at line 1480 skipping to change at line 1479
;; Do command specific actions. ;; Do command specific actions.
(TeX-command-mode-line process) (TeX-command-mode-line process)
(setq TeX-command-next TeX-command-Show) (setq TeX-command-next TeX-command-Show)
(goto-char (point-min)) (goto-char (point-min))
(apply TeX-sentinel-function process name nil) (apply TeX-sentinel-function process name nil)
;; If buffer and mode line will show that the process ;; If buffer and mode line will show that the process
;; is dead, we can delete it now. Otherwise it ;; is dead, we can delete it now. Otherwise it
;; will stay around until M-x list-processes. ;; will stay around until M-x list-processes.
(delete-process process) (delete-process process))
;; Force mode line redisplay soon
;; Do this in all buffers (bug#38058 and bug#40965)
(force-mode-line-update t))))
;; Force mode line redisplay soon
(set-buffer-modified-p (buffer-modified-p))))))
(setq compilation-in-progress (delq process compilation-in-progress))) (setq compilation-in-progress (delq process compilation-in-progress)))
(defvar TeX-sentinel-function (lambda (_process _name) nil) (defvar TeX-sentinel-function (lambda (_process _name) nil)
"Hook to cleanup TeX command buffer after temination of PROCESS. "Hook to cleanup TeX command buffer after temination of PROCESS.
NAME is the name of the process.") NAME is the name of the process.")
(make-variable-buffer-local 'TeX-sentinel-function) (make-variable-buffer-local 'TeX-sentinel-function)
(defvar TeX-sentinel-default-function (lambda (_process _name) nil) (defvar TeX-sentinel-default-function (lambda (_process _name) nil)
"Default for `TeX-sentinel-function'. To be set in major mode. "Default for `TeX-sentinel-function'. To be set in major mode.
skipping to change at line 1591 skipping to change at line 1592
(setq TeX-command-next dvi2pdf) (setq TeX-command-next dvi2pdf)
(setq TeX-command-next TeX-command-Show))) (setq TeX-command-next TeX-command-Show)))
nil)) nil))
;; This regexp should catch warnings of the type ;; This regexp should catch warnings of the type
;; LaTeX Warning: ... ;; LaTeX Warning: ...
;; LaTeX Font Warning: ... ;; LaTeX Font Warning: ...
;; Package xyz123 Warning: ... ;; Package xyz123 Warning: ...
;; Class xyz123 Warning: ... ;; Class xyz123 Warning: ...
(defvar LaTeX-warnings-regexp (defvar LaTeX-warnings-regexp
"\\(?:LaTeX\\|Class\\|Package\\|\*\\) [-A-Za-z0-9]* ?[Ww]arning:" "\\(?:LaTeX\\|Class\\|Package\\|\\*\\) [-A-Za-z0-9]* ?[Ww]arning:"
"Regexp matching LaTeX warnings.") "Regexp matching LaTeX warnings.")
(defun TeX-LaTeX-sentinel-has-warnings () (defun TeX-LaTeX-sentinel-has-warnings ()
"Return non-nil, if the output buffer contains warnings. "Return non-nil, if the output buffer contains warnings.
Warnings can be indicated by LaTeX or packages." Warnings can be indicated by LaTeX or packages."
(save-excursion (save-excursion
(goto-char (point-min)) (goto-char (point-min))
(re-search-forward (concat "^" LaTeX-warnings-regexp) nil t))) (re-search-forward (concat "^" LaTeX-warnings-regexp) nil t)))
(defun TeX-LaTeX-sentinel-has-bad-boxes () (defun TeX-LaTeX-sentinel-has-bad-boxes ()
skipping to change at line 1698 skipping to change at line 1699
((re-search-forward "Package longtable Warning: Table widths have \ ((re-search-forward "Package longtable Warning: Table widths have \
changed\\. Rerun LaTeX\\." nil t) changed\\. Rerun LaTeX\\." nil t)
(message (message
"%s" "You should run LaTeX again to get table formatting right") "%s" "You should run LaTeX again to get table formatting right")
(setq TeX-command-next TeX-command-default)) (setq TeX-command-next TeX-command-default))
((re-search-forward "^hf-TikZ Warning: Mark '.*' changed\\. \ ((re-search-forward "^hf-TikZ Warning: Mark '.*' changed\\. \
Rerun to get mark in right position\\." nil t) Rerun to get mark in right position\\." nil t)
(message (message
"%s" "You should run LaTeX again to get TikZ marks in right position") "%s" "You should run LaTeX again to get TikZ marks in right position")
(setq TeX-command-next TeX-command-default)) (setq TeX-command-next TeX-command-default))
((re-search-forward "^\* xsim warning: \"rerun\"" nil t) ((re-search-forward "^\\* xsim warning: \"rerun\"" nil t)
(message (message
"%s" "You should run LaTeX again to synchronize exercise properties") "%s" "You should run LaTeX again to synchronize exercise properties")
(setq TeX-command-next TeX-command-default)) (setq TeX-command-next TeX-command-default))
((re-search-forward ((re-search-forward
"^\\(\\*\\* \\)?J?I?p?\\(La\\|Sli\\)TeX\\(2e\\)? \ "^\\(\\*\\* \\)?J?I?p?\\(La\\|Sli\\)TeX\\(2e\\)? \
\\(Version\\|ver\\.\\|<[0-9/-]*\\(?:u[^>]*\\)?>\\)" nil t) \\(Version\\|ver\\.\\|<[0-9/-]*\\(?:u[^>]*\\)?>\\)" nil t)
(let* ((warnings (and TeX-debug-warnings (let* ((warnings (and TeX-debug-warnings
(TeX-LaTeX-sentinel-has-warnings))) (TeX-LaTeX-sentinel-has-warnings)))
(bad-boxes (and TeX-debug-bad-boxes (bad-boxes (and TeX-debug-bad-boxes
(TeX-LaTeX-sentinel-has-bad-boxes))) (TeX-LaTeX-sentinel-has-bad-boxes)))
skipping to change at line 1879 skipping to change at line 1880
(TeX-command-sequence TeX-command-sequence-command nil (TeX-command-sequence TeX-command-sequence-command nil
TeX-command-sequence-file-function)))))) TeX-command-sequence-file-function))))))
;;; Process Control ;;; Process Control
;; This variable is shared with `compile.el'. ;; This variable is shared with `compile.el'.
;; FIXME: Then it should not be defvar'd here! ;; FIXME: Then it should not be defvar'd here!
(defvar compilation-in-progress nil (defvar compilation-in-progress nil
"List of compilation processes now running.") "List of compilation processes now running.")
(or (assq 'compilation-in-progress minor-mode-alist) ;; COMPATIBILITY for emacs < 27
(setq minor-mode-alist (cons '(compilation-in-progress " Compiling") (if (< emacs-major-version 27)
minor-mode-alist))) (or (assq 'compilation-in-progress minor-mode-alist)
(setq minor-mode-alist (cons '(compilation-in-progress " Compiling")
minor-mode-alist))))
(defun TeX-process-get-variable (name symbol &optional default) (defun TeX-process-get-variable (name symbol &optional default)
"Return the value in the process buffer for NAME of SYMBOL. "Return the value in the process buffer for NAME of SYMBOL.
Return DEFAULT if the process buffer does not exist or SYMBOL is not Return DEFAULT if the process buffer does not exist or SYMBOL is not
defined." defined."
(let ((buffer (TeX-process-buffer name))) (let ((buffer (TeX-process-buffer name)))
(if (and buffer (if (and buffer
(local-variable-p symbol buffer)) (local-variable-p symbol buffer))
(with-current-buffer buffer (with-current-buffer buffer
skipping to change at line 1941 skipping to change at line 1944
"Return AUCTeX process associated with the document NAME." "Return AUCTeX process associated with the document NAME."
(and TeX-process-asynchronous (and TeX-process-asynchronous
(get-buffer-process (TeX-process-buffer name)))) (get-buffer-process (TeX-process-buffer name))))
;;; Process Filters ;;; Process Filters
(defun TeX-command-mode-line (process) (defun TeX-command-mode-line (process)
"Format the mode line for a buffer containing output from PROCESS." "Format the mode line for a buffer containing output from PROCESS."
(setq mode-line-process (concat ": " (setq mode-line-process (concat ": "
(symbol-name (process-status process)))) (symbol-name (process-status process))))
(set-buffer-modified-p (buffer-modified-p))) (force-mode-line-update))
(defun TeX-command-filter (process string) (defun TeX-command-filter (process string)
"Filter to process normal output." "Filter to process normal output."
(with-current-buffer (process-buffer process) (with-current-buffer (process-buffer process)
(save-excursion (save-excursion
(goto-char (process-mark process)) (goto-char (process-mark process))
(insert-before-markers string) (insert-before-markers string)
(set-marker (process-mark process) (point))))) (set-marker (process-mark process) (point)))))
(defvar TeX-current-page nil (defvar TeX-current-page nil
"The page number currently being formatted, enclosed in brackets.") "The page number currently being formatted, enclosed in brackets.")
(make-variable-buffer-local 'TeX-current-page) (make-variable-buffer-local 'TeX-current-page)
(defun TeX-format-mode-line (process) (defun TeX-format-mode-line (process)
"Format the mode line for a buffer containing TeX output from PROCESS." "Format the mode line for a buffer containing TeX output from PROCESS."
(setq mode-line-process (concat " " TeX-current-page ": " (setq mode-line-process (concat " " TeX-current-page ": "
(symbol-name (process-status process)))) (symbol-name (process-status process))))
(set-buffer-modified-p (buffer-modified-p))) (force-mode-line-update))
(defun TeX-format-filter (process string) (defun TeX-format-filter (process string)
"Filter to process TeX output." "Filter to process TeX output."
(with-current-buffer (process-buffer process) (with-current-buffer (process-buffer process)
(let (str pos end (pt (marker-position (process-mark process)))) (let (str pos end (pt (marker-position (process-mark process))))
(save-excursion (save-excursion
(goto-char pt) (goto-char pt)
(insert-before-markers string) (insert-before-markers string)
(set-marker (process-mark process) (point)) (set-marker (process-mark process) (point))
;; Remove line breaks at columns 79 and 80 ;; Remove line breaks at columns 79 and 80
skipping to change at line 2578 skipping to change at line 2581
If the optional argument STORE is non-nil, the function will If the optional argument STORE is non-nil, the function will
store the found warning or error in `TeX-error-list' instead of store the found warning or error in `TeX-error-list' instead of
displaying the issue. displaying the issue.
Return non-nil if an error or warning is found." Return non-nil if an error or warning is found."
(let ((regexp (let ((regexp
(concat (concat
;; TeX error ;; TeX error
"^\\(!\\|\\(.*?\\):[0-9]+:\\) \\|" "^\\(!\\|\\(.*?\\):[0-9]+:\\) \\|"
;; New file ;; New file
"(\n?\\([^\n())]+\\)\\|" "(\n?\\([^\n()]+\\)\\|"
;; End of file. ;; End of file.
"\\()\\)\\|" "\\()\\)\\|"
;; Hook to change line numbers ;; Hook to change line numbers
" !\\(?:offset(\\([---0-9]+\\))\\|" " !\\(?:offset(\\([---0-9]+\\))\\|"
;; Hook to change file name ;; Hook to change file name
"name(\\([^)]+\\))\\)\\|" "name(\\([^)]+\\))\\)\\|"
;; Start of LaTeX bad box ;; Start of LaTeX bad box
"^\\(\\(?:Overfull\\|Underfull\\|Tight\\|Loose\\) " "^\\(\\(?:Overfull\\|Underfull\\|Tight\\|Loose\\) "
;; Horizontal bad box ;; Horizontal bad box
"\\(?:\\\\hbox.* at lines? [0-9]+\\(?:--[0-9]+\\)?$\\|" "\\(?:\\\\hbox.* at lines? [0-9]+\\(?:--[0-9]+\\)?$\\|"
 End of changes. 14 change blocks. 
18 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)