branch: externals/auctex commit 94127f5e10e071f3245d0206d7fd5d5966101ac3 Author: Ikumi Keita <ik...@ikumi.que.jp> Commit: Ikumi Keita <ik...@ikumi.que.jp>
Make banner regexp customizable * tex.el (TeX-LaTeX-sentinel-banner-regexp): Turn the regexp to identify the banner line in the LaTeX output into customize option. (TeX-LaTeX-sentinel): Use it. * doc/auctex.texi (Processor Options): Mention the new option. (): Update copyright year. --- doc/auctex.texi | 16 +++++++++++++++- tex.el | 10 ++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/doc/auctex.texi b/doc/auctex.texi index c4cd025761..9983d9d702 100644 --- a/doc/auctex.texi +++ b/doc/auctex.texi @@ -12,7 +12,7 @@ This manual is for @AUCTeX{} (version @value{VERSION} from @value{UPDATED}), a sophisticated @TeX{} environment for Emacs. -Copyright @copyright{} 1992-1995, 2001, 2002, 2004-2023 +Copyright @copyright{} 1992-1995, 2001, 2002, 2004-2024 Free Software Foundation, Inc. @quotation @@ -3521,6 +3521,20 @@ a command not found error. The error code returned by the shell in this case can be set in @code{TeX-check-TeX-command-not-found} option. @end defopt +In addtion, @AUCTeX{} searches for a line similar to +@example +LaTeX2e <2022-11-01> patch level 1 +@end example +in the console log to check whether @command{latex} command runs +successfully. If there isn't such a line when running @LaTeX{}, @AUCTeX{} +warns the problem and resets the next default command to ``LaTeX''. If +this check doesn't suit for your use case, you can customize the +@code{TeX-LaTeX-sentinel-banner-regexp} option: +@defopt TeX-LaTeX-sentinel-banner-regexp +When a @LaTeX{} run outputs a banner line matching this regexp, @AUCTeX{} +considers that it was successfull. +@end defopt + Some @LaTeX{} packages requires the document to be compiled with a specific engine. Notable examples are @samp{fontspec} and @samp{polyglossia} packages, which require Lua@TeX{} and Xe@TeX{} engines. If you try to diff --git a/tex.el b/tex.el index 4768651826..3132472e17 100644 --- a/tex.el +++ b/tex.el @@ -709,6 +709,13 @@ commands." :group 'TeX-command :type 'boolean) +(defcustom TeX-LaTeX-sentinel-banner-regexp + "^\\(\\*\\* \\)?J?I?p?\\(La\\|Sli\\)TeX\\(2e\\)? \ +\\(Version\\|ver\\.\\|<[0-9/-]*\\(?:u[^>]*\\)?>\\)" + "Regexp to identify the banner line in the LaTeX output." + :group 'TeX-output + :type 'regexp) + ;;; Portability. (defmacro TeX--if-macro-fboundp (name then &rest else) @@ -8531,8 +8538,7 @@ Changebar info has changed." nil t) "%s" "You should run LaTeX again to synchronize exercise properties") (setq TeX-command-next TeX-command-default)) ((re-search-forward - "^\\(\\*\\* \\)?J?I?p?\\(La\\|Sli\\)TeX\\(2e\\)? \ -\\(Version\\|ver\\.\\|<[0-9/-]*\\(?:u[^>]*\\)?>\\)" nil t) + TeX-LaTeX-sentinel-banner-regexp nil t) (let* ((warnings (and TeX-debug-warnings (TeX-LaTeX-sentinel-has-warnings))) (bad-boxes (and TeX-debug-bad-boxes