branch: main commit 112517bb62234fc09e22d809ef8ded6c31546031 Author: Arash Esbati <ar...@gnu.org> Commit: Arash Esbati <ar...@gnu.org>
Add new style/needspace.el * NEWS.org (Added): Announce new style. * style/needspace.el: New file. --- NEWS.org | 2 +- style/needspace.el | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/NEWS.org b/NEWS.org index 402332e3..a2ca10d3 100644 --- a/NEWS.org +++ b/NEWS.org @@ -11,7 +11,7 @@ ** Added -- Add new support file =style/embedfile.el=. +- Add new support filse =style/embedfile.el= and =style/needspace.el=. ** Changed diff --git a/style/needspace.el b/style/needspace.el new file mode 100644 index 00000000..0e54da47 --- /dev/null +++ b/style/needspace.el @@ -0,0 +1,57 @@ +;;; needspace.el --- AUCTeX style for `needspace.sty' (v1.3e) -*- lexical-binding: t; -*- + +;; Copyright (C) 2025 Free Software Foundation, Inc. + +;; Author: Arash Esbati <ar...@gnu.org> +;; Maintainer: auctex-devel@gnu.org +;; Created: 2025-03-18 +;; 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 this program. If not, see <https://www.gnu.org/licenses/>. + +;;; Commentary: + +;; This file adds support for `needspace.sty' (v1.3e) from 2025-03-13. +;; `needspace.sty' is part of TeXLive. + +;;; Code: + +(require 'tex) + +;; Silence the compiler: +(declare-function font-latex-add-keywords "font-latex" (keywords class)) + +(TeX-add-style-hook + "needspace" + (lambda () + + (TeX-add-symbols + '("needspace" (TeX-arg-length "Space")) + '("Needspace" (TeX-arg-length "Space")) + '("Needspace*" (TeX-arg-length "Space"))) + + ;; Fontification + (when (and (featurep 'font-latex) + (eq TeX-install-font-lock 'font-latex-setup)) + (font-latex-add-keywords '(("needspace" "{") + ("Needspace" "*{")) + 'function))) + TeX-dialect) + +(defvar LaTeX-needspace-package-options nil + "Prompt for package options for the needspace package.") + +;;; needspace.el ends here