From 21e56026c2d804fa9f9d23169a9c7b3b4689fe75 Mon Sep 17 00:00:00 2001 From: Steve Youngs Date: Sun, 5 Apr 2020 20:47:47 +1000 Subject: [PATCH] AUCTeX Sync -- Build fixes. This set of changes gives us a clean AUCTeX v11.92 build. * xemacs-packages/auctex/sxepkg.el: Add a stack more warning suppression crud. Man, I hate this file. * xemacs-packages/auctex/tex.el (TeX--prettify-symbols-compose-p): Wrap the wrap in #'eval-when to feed the byte-compiler warnings monster. (file): #'defvar at toplevel for ugly AF warn suppression. (TeX-read-string): The "XEmacs" version... Don't bother trying to see if it can take 5 args because nowhere in AUCTeX does it use more than 2. (TeX-how-many): Conditionalise on 'emacs' feature because 'emacs-major-version' is >= for SXEmacs too. And wrap in a snuggly, warm #'eval-when-compile. * xemacs-packages/auctex/latex.el (LaTeX-env-args): Use #'if-boundp for warning suppression. * xemacs-packages/auctex/bib-cite.el (bib-cite--fontify-help): Use #'if-fboundp to avoid warnings. (bib-cite-fontify-help-xemacs): Wrap in #'eval-when to avoid warnings. * xemacs-packages/auctex/package-info.in (provides): Add tex-ispell, tex-wizard. * xemacs-packages/auctex/Makefile (ELCS): Add tex-ispell.elc, tex-wizard.elc Signed-off-by: Steve Youngs --- xemacs-packages/auctex/Makefile | 6 +- xemacs-packages/auctex/bib-cite.el | 6 +- xemacs-packages/auctex/latex.el | 2 +- xemacs-packages/auctex/package-info.in | 4 +- xemacs-packages/auctex/sxepkg.el | 105 ++++++++++++++++++++----- xemacs-packages/auctex/tex.el | 16 ++-- 6 files changed, 102 insertions(+), 37 deletions(-) diff --git a/xemacs-packages/auctex/Makefile b/xemacs-packages/auctex/Makefile index 9d42d754..c4bc16a7 100644 --- a/xemacs-packages/auctex/Makefile +++ b/xemacs-packages/auctex/Makefile @@ -39,9 +39,9 @@ PDFLATEX = pdflatex ELCS = bib-cite.elc context-en.elc context-nl.elc context.elc \ font-latex.elc latex.elc multi-prompt.elc plain-tex.elc \ preview.elc prv-xemacs.elc tex-bar.elc tex-buf.elc \ - tex-fold.elc tex-font.elc tex-info.elc tex-mik.elc \ - tex-site.elc tex-style.elc tex.elc texmathp.elc \ - toolbar-x.elc + tex-fold.elc tex-font.elc tex-info.elc tex-ispell.elc \ + tex-mik.elc tex-site.elc tex-style.elc tex-wizard.elc \ + tex.elc texmathp.elc toolbar-x.elc ifeq ($(BUILD_WITHOUT_MULE),) ELCS += tex-jp.elc diff --git a/xemacs-packages/auctex/bib-cite.el b/xemacs-packages/auctex/bib-cite.el index 1207bd65..56f07dcb 100644 --- a/xemacs-packages/auctex/bib-cite.el +++ b/xemacs-packages/auctex/bib-cite.el @@ -1228,6 +1228,7 @@ to create a bibtex file containing only the references used in the document." (put-text-property (point-min)(or limit (point-max)) 'face 'red-bold)))) +(eval-when (compile load eval) (when (featurep 'xemacs) (defun bib-cite-fontify-help-xemacs (defaults) (if (fboundp 'font-lock-set-defaults-1) ; >= XEmacs 19.14 @@ -1240,14 +1241,15 @@ to create a bibtex file containing only the references used in the document." (setq font-lock-defaults-computed nil font-lock-keywords nil) (font-lock-set-defaults-1))))) +) (defun bib-cite--fontify-help () ;; FIXME: This looks ugly and incorrect. (if font-lock-mode (font-lock-mode -1) - (if (fboundp 'font-lock-unset-defaults) (font-lock-unset-defaults)) + (if-fboundp 'font-lock-unset-defaults (font-lock-unset-defaults)) (font-lock-unfontify-buffer)) - (if (fboundp 'font-lock-ensure) + (if-fboundp 'font-lock-ensure (font-lock-ensure) (with-no-warnings (font-lock-fontify-buffer)))) diff --git a/xemacs-packages/auctex/latex.el b/xemacs-packages/auctex/latex.el index b6f6b51d..88318fa7 100644 --- a/xemacs-packages/auctex/latex.el +++ b/xemacs-packages/auctex/latex.el @@ -1243,7 +1243,7 @@ Just like array and tabular." (save-excursion (LaTeX-find-matching-begin) (end-of-line) - (let ((exit-mark (if (boundp 'exit-mark) + (let ((exit-mark (if-boundp 'exit-mark exit-mark (make-marker)))) (TeX-parse-arguments args)))) diff --git a/xemacs-packages/auctex/package-info.in b/xemacs-packages/auctex/package-info.in index a9afbc50..fff78b71 100644 --- a/xemacs-packages/auctex/package-info.in +++ b/xemacs-packages/auctex/package-info.in @@ -15,8 +15,8 @@ size SIZE provides (bib-cite context-en context-nl context font-latex latex multi-prompt plain-tex preview prv-xemacs tex-bar tex-buf tex-fold - tex-font tex-info tex-jp tex-mik tex-site tex-style tex texmathp - toolbar-x) + tex-font tex-info tex-ispell tex-jp tex-mik tex-site tex-style + tex-wizard tex texmathp toolbar-x) requires (REQUIRES) type regular )) diff --git a/xemacs-packages/auctex/sxepkg.el b/xemacs-packages/auctex/sxepkg.el index b02ba548..b3b45e3b 100644 --- a/xemacs-packages/auctex/sxepkg.el +++ b/xemacs-packages/auctex/sxepkg.el @@ -14,11 +14,15 @@ (defun maybe-bind (args) (mapcar (lambda (var) (unless (boundp var) (set var nil))) args)) +;; From GNU Emacs' byte-run.el +(unless (fboundp 'with-no-warnings) + (defun with-no-warnings (&rest body) + (car (last body)))) + ;;; AUCTeX lisp (when (equal "bib-cite.el" current-file) (maybe-fbind - '(dired-split find-tag-noselect font-lock-unset-defaults - dired-replace-in-string)) + '(dired-split find-tag-noselect dired-replace-in-string)) (autoload 'LaTeX-bibitem-list "latex") (autoload 'LaTeX-bibliography-list "latex") (autoload 'TeX-auto-write "tex") @@ -33,15 +37,22 @@ TeX-auto-save TeX-auto-update TeX-auto-regexp-list))) (when (equal "context.el" current-file) + (autoload 'TeX-read-string "tex") + (autoload 'TeX-active-mark "tex") + (autoload 'TeX-activate-region "tex") (maybe-fbind - '(abbrev-table-put easy-menu-return-item metapost-mode))) + '(abbrev-table-put easy-menu-return-item metapost-mode)) + (maybe-bind '(ConTeXt-extra-paragraph-commands))) (when (equal "font-latex.el" current-file) (maybe-fbind '(string-make-multibyte set-face-attribute)) (maybe-bind '(font-latex-fontify-sectioning font-lock-set-defaults inhibit-point-motion-hooks inhibit-modification-hooks - deactivate-mark))) + deactivate-mark prettify-symbols-mode prettify-symbols--keywords + file-local-variables-alist LaTeX-verbatim-environments-local + LaTeX-verbatim-macros-with-braces-local + LaTeX-verbatim-macros-with-delims-local))) (when (equal "latex.el" current-file) (autoload 'LaTeX-install-toolbar "tex-bar" nil t) @@ -57,7 +68,7 @@ (maybe-fbind '(abbrev-table-put char-category-set fill-delete-newlines fill-delete-prefix fill-find-break-point fill-indent-to-left-margin - fill-move-to-break-point)) + fill-move-to-break-point format-message)) (maybe-bind '(BibTeX-auto-regexp-list LaTeX-header-end LaTeX-indent-environment-list LaTeX-math-abbrev-prefix LaTeX-math-default LaTeX-math-list @@ -83,6 +94,7 @@ (autoload 'TeX-install-toolbar "tex-bar" nil t)) (when (equal "preview.el" current-file) + (maybe-fbind '(byte-to-string)) (maybe-bind '(TeX-japanese-process-output-coding-system TeX-japanese-process-output-coding-system context @@ -118,7 +130,8 @@ (maybe-fbind '(event-start posn-point posn-window select-frame-set-input-focus tabulated-list-get-id tabulated-list-init-header tabulated-list-mode - tabulated-list-print window-splittable-p)) + tabulated-list-print window-splittable-p add-file-local-variable + japanese-TeX-set-process-coding-system TeX-special-mode)) (maybe-bind '(LaTeX-using-Biber TeX-command-buffer TeX-command-pos TeX-command-text TeX-current-page TeX-current-process-region-p @@ -129,7 +142,8 @@ compilation-in-progress dos-machine-type file font-lock-defaults-alist inhibit-field-text-motion inhibit-point-motion-hooks menu-map orig-buffer shell-command-option tabulated-list-entries - tabulated-list-format tabulated-list-padding))) + tabulated-list-format tabulated-list-padding japanese-TeX-mode + ConTeXt-Mark-version magic-mode-alist find-file-hook))) (when (equal "tex-fold.el" current-file) (require 'overlay) @@ -152,6 +166,15 @@ is-beg-section reftex-label-alist-builtin reftex-label-alist-builtin reftex-mode))) +(when (equal "tex-jp.el" current-file) + (autoload 'font-latex-add-keywords "font-latex") + (maybe-fbind '(get-coding-system-from-locale current-locale)) + (maybe-bind + '(TeX-command-buffer japanese-TeX-mode + TeX-japanese-process-output-coding-system + TeX-japanese-process-input-coding-system TeX-error-description-list + locale-coding-system))) + (when (equal "tex-mik.el" current-file) (maybe-bind '(TeX-kpathsea-path-delimiter TeX-output-view-style TeX-print-command @@ -164,6 +187,10 @@ (defun line-number-at-pos (&optional pos) (line-number pos t)) +(when (equal "tex-wizard.el" current-file) + (maybe-fbind '(info-other-window)) + (maybe-bind '(LaTeX-mode-hook latex-mode-hook reftex-plug-into-AUCTeX))) + (when (equal "tex.el" current-file) (autoload 'font-latex-faces-present-p "font-latex") (autoload 'ispell "ispell" nil t) @@ -174,6 +201,10 @@ (autoload 'url-hexify-string "url-util") (autoload 'url-unhex-string "url-util") (autoload 'LaTeX-environment-list "latex") + (autoload 'LaTeX-verbatim-macros-with-delims "latex") + (autoload 'TeX-command-expand "tex-buf") + (autoload 'TeX-pop-to-buffer "tex-buf") + (defalias 'x-focus-frame 'focus-frame) (mapfam :result-type 'void #'(lambda (fn) (autoload fn "overlay")) @@ -182,7 +213,9 @@ '(comment-forward comment-normalize-vars activate-mark deactivate-mark dbus-call-method dbus-get-unique-name dbus-ignore-errors dbus-introspect-get-method dbus-ping dbus-register-signal - TeX-active-master TeX-output-extension)) + TeX-active-master TeX-output-extension deactivate-input-method + pdf-sync-forward-search quit-window select-frame-set-input-focus + url-encode-url tex--prettify-symbols-compose-p)) (maybe-bind '(BibLaTeX-global-style-files BibTeX-file-extensions BibTeX-global-files BibTeX-global-style-files LaTeX-global-class-files LaTeX-math-mode @@ -204,17 +237,17 @@ hilit-patterns-alist ispell-enable-tex-parser ispell-tex-p japanese-TeX-mode last-optional-rejected mark-active name reporter-prompt-for-summary-p server-process texmathp-why transient-mark-mode upcase url-unreserved-chars - user-emacs-directory))) - + user-emacs-directory LaTeX-default-verb-delimiter + LaTeX-verbatim-environments-local LaTeX-verbatim-macros-with-braces-local + LaTeX-verbatim-macros-with-delims-local TeX-current-process-region-p + TeX-ispell-verb-delimiters TeX-region TeX-region-orig-buffer + crm-completion-table crm-local-completion-map crm-local-must-match-map + dbus-debug doc file tex--prettify-symbols-alist))) (when (equal "toolbar-x.el" current-file) - (maybe-fbind '(define-key-after create-image find-image))) - -(when (equal "tex-jp.el" current-file) - (maybe-bind - '(TeX-command-buffer japanese-TeX-mode - TeX-japanese-process-output-coding-system - TeX-japanese-process-input-coding-system TeX-error-description-list))) + (maybe-fbind + '(define-key-after create-image find-image + toolbarx-emacs-mount-popup-menu toolbarx-emacs-refresh))) ;; custom-defines loooooves to spit tonnes of warnings (when (equal "custom-defines.el" current-file) @@ -232,6 +265,7 @@ '(font-latex-sectioning-max font-latex-built-in-keyword-classes LaTeX-paragraph-commands-regexp LaTeX-math-default shell-command-option TeX-mode-alist TeX-data-directory + TeX-clean-default-intermediate-suffixes user-emacs-directory))) ;;; Style Files @@ -244,11 +278,35 @@ (autoload 'font-latex-add-keywords "font-latex") (autoload 'font-latex-add-quotes "font-latex") (autoload 'font-latex-set-syntactic-keywords "font-latex") + (autoload 'font-latex-update-font-lock "font-latex") + (autoload 'TeX-check-engine-add-engines "tex-buf") + (autoload 'TeX-read-string "tex") (maybe-fbind '(coding-system-equal insert-pair latexenc-coding-system-to-inputenc latexenc-inputenc-to-coding-system reftex-add-to-label-alist reftex-ref-style-activate)) - (maybe-bind '(font-lock-set-defaults))) + (maybe-bind + '(font-lock-set-defaults LaTeX-caption-key-val-options + LaTeX-caption-key-val-options-local LaTeX-fancyvrb-key-val-options-local + LaTeX-graphicx-package-options LaTeX-tcolorbox-keyval-options-full + LaTeX-article-class-options LaTeX-bicaption-key-val-options + LaTeX-caption-supported-float-types LaTeX-italian-close-quote + LaTeX-italian-open-quote LaTeX-mathtools-package-options + LaTeX-subcaption-key-val-options LaTeX-tcolorbox-keyval-options-local + TeX-TikZ-point-function-map TeX-check-engine-list environment exit-mark + reftex-label-regexps))) + +(when (equal "style/empheq.el" current-file) + (load-file "style/amsmath.el")) + +(when (equal "style/gloss-italian.el" current-file) + (load-file "style/polyglossia.el")) + +(when (equal "style/graphics.el" current-file) + (maybe-bind '(LaTeX-graphics-package-options))) + +(when (equal "style/minted.el" current-file) + (maybe-fbind '(LaTeX-add-newfloat-DeclareFloatingEnvironments))) (when (equal "style/pstricks.el" current-file) (autoload 'multi-prompt-key-value "multi-prompt") @@ -294,11 +352,16 @@ (maybe-bind '(LaTeX-emp-fig-name LaTeX-emp-file-name mpost-emp-file-name))) -(when (equal "style/biblatex.el" current-file) - (autoload 'TeX-read-string "tex")) - (when (equal "style/dinbrief.el" current-file) (autoload 'TeX-mark-active "tex")) (when (equal "style/doc.el" current-file) (autoload 'TeX-active-mark "tex")) + +(when (equal "style/tcolorbox.el" current-file) + (maybe-fbind '(LaTeX-xcolor-definecolor-list))) + +(when (string-match #r"style/\(bi\)?caption\.el" current-file) + (load-file "style/babel.el") + (load-file "style/polyglossia.el") + (maybe-fbind '(LaTeX-newfloat-DeclareFloatingEnvironment-list))) diff --git a/xemacs-packages/auctex/tex.el b/xemacs-packages/auctex/tex.el index cee35654..5948223d 100644 --- a/xemacs-packages/auctex/tex.el +++ b/xemacs-packages/auctex/tex.el @@ -701,15 +701,11 @@ overlays between two existing ones.") ;;; Special support for XEmacs -(eval-when-compile +(eval-when (compile load eval) (when (featurep 'xemacs) - (defun TeX-read-string - (prompt &optional initial-input history default-value) - (condition-case nil - (read-string prompt initial-input history default-value t) - (wrong-number-of-arguments - (read-string prompt initial-input history default-value)))) + (defun TeX-read-string (prompt &optional initial-input history default-value) + (read-string prompt initial-input history default-value)) (defun TeX-mark-active () ;; In Lucid (mark) returns nil when not active. @@ -1283,6 +1279,7 @@ DE is the name of the desktop environment, APP is the name of viewer." (cdr (caar (cdr elem))))) spec))))))))) +(defvar file) (defun TeX-pdf-tools-sync-view () "Focus the focused page/paragraph in `pdf-view-mode'. If `TeX-source-correlate-mode' is disabled, only find and pop to @@ -3782,6 +3779,7 @@ The algorithm is as follows: answer TeX-default-mode)))))) +(eval-when (compile load eval) (when (and (boundp 'tex--prettify-symbols-alist) (boundp 'prettify-symbols-compose-predicate)) (defun TeX--prettify-symbols-compose-p (start end match) @@ -3790,6 +3788,7 @@ The algorithm is as follows: (if (consp face) (memq 'font-latex-verbatim-face face) (eq face 'font-latex-verbatim-face))))))) +) (defun VirTeX-common-initialization () "Perform basic initialization." @@ -6790,7 +6789,8 @@ Supports restriction to a region where the XEmacs version doesn't and always returns the number of matches, also in XEmacs and GNU Emacs 21." ;; Emacs >= 22 does what we want. - (if (>= emacs-major-version 22) + (if (and (>= emacs-major-version 22) + (featurep 'emacs)) (how-many regexp rstart rend) ;; XEmacs and GNU Emacs 21 don't return the number of matches but only print ;; it. -- 2.34.1