branch: main commit 441a2416f61a855d76bdcaefb3776cc9e819adea Merge: 9619753f bd74d3cf Author: Arash Esbati <ar...@gnu.org> Commit: Arash Esbati <ar...@gnu.org>
Merge remote-tracking branch 'origin/master' --- NEWS.org | 4 +- doc/install.texi | 24 +++++++++--- latex.el | 10 +++++ style/supertabular.el | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++ style/xtab.el | 78 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 209 insertions(+), 8 deletions(-) diff --git a/NEWS.org b/NEWS.org index 673c7c93..2a27df2f 100644 --- a/NEWS.org +++ b/NEWS.org @@ -10,8 +10,8 @@ ** Added -- Add new support files =style/authblk.el=, =style/ninecolors.el= and - =style/tabularray.el=. +- Add new support files =style/authblk.el=, =style/ninecolors.el=, + =style/supertabular.el=, =style/tabularray.el= and =style/xtab.el=. * [14.0.6] - 2024-06-30 diff --git a/doc/install.texi b/doc/install.texi index 74f5566d..5a00f8c3 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -38,9 +38,6 @@ Once the installation is completed, you can skip the rest of this section and proceed to @ref{Quick Start}. @end ifclear -The remainder of this section is about installing @AUCTeX{} from a -release tarball or from a checkout of the @AUCTeX{} repository. - Installing @AUCTeX{} should be simple: merely @command{./configure}, @command{make}, and @code{make install} for a standard site-wide installation (most other installations can be done by specifying a @@ -381,13 +378,21 @@ redirection. But we recommend not to customize them directly because the customization code for @code{TeX-modes} takes care of some other compatibility issues. -If you want to remove a preinstalled @AUCTeX{} completely before any of -its modes have been used, +When there is a site-wide installation of @AUCTeX{} and you don't want to +use it, you can disable it by +@lisp +(push '(auctex nil) package-load-list) +@end lisp +@noindent +in your early init file (@pxref{Early Init File,,,emacs}) for +@acronym{ELPA} installation, or @lisp (unload-feature 'tex-site) @end lisp @noindent -in your init file should accomplish that. +in your (standard) init file for configure--make installation. (We +recommend those treatments over setting @code{TeX-modes} to @code{nil}, +because they don't leave unused autoloads persisted.) @node Advice for package providers @section Providing @AUCTeX{} as a package @@ -401,6 +406,7 @@ There are people that prefer the built-in Emacs modes for editing @TeX{} files, in particular plain @TeX{} users. There are various ways to tell @AUCTeX{} even after auto-activation that it should not get used, and they are described in +@c FIXME: It doesn't seem that these references discuss this topic. @ifset rawfile the @file{README} file. @end ifset @@ -412,6 +418,12 @@ So if you have users that don't want to use the preinstalled @AUCTeX{}, they can easily get rid of it. Activating @AUCTeX{} by default is therefore a good choice. +First of all, you can install @acronym{ELPA} @AUCTeX{} package under a +directory listed in @code{package-directory-list} to have site-wide +default. + +Next, we discuss configure--make installation. + If the installation procedure did not achieve this already by placing @file{auctex.el} and @file{preview-latex.el} into a possibly existing @file{site-start.d} directory, you can do this by placing diff --git a/latex.el b/latex.el index 7f709a82..66f50485 100644 --- a/latex.el +++ b/latex.el @@ -4168,6 +4168,11 @@ consideration just as is in the non-commented source code." ("drcases" LaTeX-indent-tabular) ("drcases*" LaTeX-indent-tabular) ("cases*" LaTeX-indent-tabular) + ;; envs of supertabular.sty + ("supertabular" LaTeX-indent-tabular) + ("supertabular*" LaTeX-indent-tabular) + ("mpsupertabular" LaTeX-indent-tabular) + ("mpsupertabular*" LaTeX-indent-tabular) ;; envs of tabularray.sty ("+array" LaTeX-indent-tabular) ("+matrix" LaTeX-indent-tabular) @@ -4177,6 +4182,11 @@ consideration just as is in the non-commented source code." ("+vmatrix" LaTeX-indent-tabular) ("+Vmatrix" LaTeX-indent-tabular) ("+cases" LaTeX-indent-tabular) + ;; envs of xtab.sty + ("xtabular" LaTeX-indent-tabular) + ("xtabular*" LaTeX-indent-tabular) + ("mpxtabular" LaTeX-indent-tabular) + ("mpxtabular*" LaTeX-indent-tabular) ;; The following should have their own, smart indentation function. ;; Some other day. ("displaymath") diff --git a/style/supertabular.el b/style/supertabular.el new file mode 100644 index 00000000..12a8a057 --- /dev/null +++ b/style/supertabular.el @@ -0,0 +1,101 @@ +;;; supertabular.el --- AUCTeX style for `supertabular.sty' (v4.2c) -*- lexical-binding: t; -*- + +;; Copyright (C) 2024 Free Software Foundation, Inc. + +;; Author: Arash Esbati <ar...@gnu.org> +;; Maintainer: auctex-devel@gnu.org +;; Created: 2024-07-21 +;; Keywords: tex + +;; This file is part of AUCTeX. + +;; AUCTeX is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; AUCTeX is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with AUCTeX; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +;; 02110-1301, USA. + +;;; Commentary: + +;; This file adds support for `supertabular.sty' (v4.2c) from 2024/07/20. +;; `supertabular.sty' is part of TeXLive. + +;;; Code: + +(require 'tex) +(require 'latex) + +;; Silence the compiler: +(declare-function font-latex-add-keywords "font-latex" (keywords class)) + +(defun LaTeX-supertabular-insert-caption (optional &optional prompt) + "Insert the arguments of caption macros provided by supertabular package." + (let* ((caption (TeX-read-string + (TeX-argument-prompt optional prompt "Caption"))) + (short-caption + (if (>= (length caption) LaTeX-short-caption-prompt-length) + (TeX-read-string + (TeX-argument-prompt t nil "Short caption")) + ""))) + (TeX-argument-insert short-caption t) + (TeX-argument-insert caption optional) + (when auto-fill-function (LaTeX-fill-paragraph)))) + +(TeX-add-style-hook + "supertabular" + (lambda () + (TeX-add-symbols + '("tablefirsthead" t) + '("tablehead" t) + + '("tabletail" t) + '("tablelasttail" t) + + '("topcaption" LaTeX-supertabular-insert-caption) + '("bottomcaption" LaTeX-supertabular-insert-caption) + '("tablecaption" LaTeX-supertabular-insert-caption) + + '("shrinkheight" (TeX-arg-length "Max. height"))) + + ;; Add the environments provided by the package: + (LaTeX-add-environments + '("supertabular" LaTeX-env-array) + '("supertabular*" LaTeX-env-tabular*) + '("mpsupertabular" LaTeX-env-array) + '("mpsupertabular*" LaTeX-env-tabular*)) + + ;; Append the environments to `LaTeX-item-list': + (add-to-list 'LaTeX-item-list '("supertabular" . LaTeX-item-array) t) + (add-to-list 'LaTeX-item-list '("supertabular*" . LaTeX-item-tabular*) t) + (add-to-list 'LaTeX-item-list '("mpsupertabular" . LaTeX-item-array) t) + (add-to-list 'LaTeX-item-list '("mpsupertabular*" . LaTeX-item-tabular*) t) + + ;; Fontification + (when (and (featurep 'font-latex) + (eq TeX-install-font-lock 'font-latex-setup)) + (font-latex-add-keywords '(("shrinkheight" "{")) + 'function) + (font-latex-add-keywords '(("tablefirsthead" "{") + ("tablehead" "{") + ("tabletail" "{") + ("tablelasttail" "{") + ("topcaption" "[{") + ("bottomcaption" "[{") + ("tablecaption" "[{")) + 'textual))) + TeX-dialect) + +(defvar LaTeX-supertabular-package-options + '("errorshow" "pageshow" "debugshow" "estimate" "calculate") + "Package options for the supertabular package.") + +;;; supertabular.el ends here diff --git a/style/xtab.el b/style/xtab.el new file mode 100644 index 00000000..f05e1c59 --- /dev/null +++ b/style/xtab.el @@ -0,0 +1,78 @@ +;;; xtab.el --- AUCTeX style for `xtab.sty' (v2.3f) -*- lexical-binding: t; -*- + +;; Copyright (C) 2024 Free Software Foundation, Inc. + +;; Author: Arash Esbati <ar...@gnu.org> +;; Maintainer: auctex-devel@gnu.org +;; Created: 2024-07-21 +;; Keywords: tex + +;; This file is part of AUCTeX. + +;; AUCTeX is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; AUCTeX is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with AUCTeX; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +;; 02110-1301, USA. + +;;; Commentary: + +;; This file adds support for `xtab.sty' (v2.3f) from 2011/07/31. +;; `xtab.sty' is part of TeXLive. + +;;; Code: + +(require 'tex) +(require 'latex) + +;; Silence the compiler: +(declare-function font-latex-add-keywords "font-latex" (keywords class)) + +(TeX-add-style-hook + "xtab" + (lambda () + + ;; Run the style hook for supertabular.el: + (TeX-run-style-hooks "supertabular") + + (TeX-add-symbols + '("tablelasthead" t) + '("notablelasthead" 0) + '("xentrystretch" "Fraction")) + + ;; Add the environments provided by the package: + (LaTeX-add-environments + '("xtabular" LaTeX-env-array) + '("xtabular*" LaTeX-env-array) + '("mpxtabular" LaTeX-env-array) + '("mpxtabular*" LaTeX-env-array)) + + ;; Append the environments to `LaTeX-item-list': + (dolist (env '("xtabular" "mpxtabular")) + (add-to-list 'LaTeX-item-list (cons env 'LaTeX-item-array) t) + (add-to-list 'LaTeX-item-list (cons (concat env "*") 'LaTeX-item-array) t)) + + ;; Fontification + (when (and (featurep 'font-latex) + (eq TeX-install-font-lock 'font-latex-setup)) + (font-latex-add-keywords '(("notablelasthead" "") + ("xentrystretch" "{")) + 'function) + (font-latex-add-keywords '(("tablelasthead" "{")) + 'textual))) + TeX-dialect) + +(defvar LaTeX-xtab-package-options + '("errorshow" "pageshow" "debugshow") + "Package options for the xtab package.") + +;;; xtab.el ends here