branch: main
commit fde247e4ed7be698b975fae31f09228fb0003add
Author: Arash Esbati <ar...@gnu.org>
Commit: Arash Esbati <ar...@gnu.org>

    Add new style files
    
    * NEWS.org (Added): Announce new files.
    
    * style/listings.el (LaTeX-listings-key-val-options): Take keys
    provided by the new style files into account.
    
    * style/lstautogobble.el:
    * style/lstlinebgrd.el: New files.
---
 NEWS.org               |  1 +
 style/listings.el      | 15 +++++++++++++++
 style/lstautogobble.el | 44 ++++++++++++++++++++++++++++++++++++++++++++
 style/lstlinebgrd.el   | 44 ++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 104 insertions(+)

diff --git a/NEWS.org b/NEWS.org
index 3226810f..35f7221d 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -11,6 +11,7 @@
 ** Added
 
 - Add new support files =style/authblk.el=, =style/langscibook.cls=,
+  =style/lstautogobble.el=, =style/lstlinebgrd.el=,
   =style/ninecolors.el=, =style/supertabular.el=, =style/tabularray.el=
   and =style/xtab.el=.
 
diff --git a/style/listings.el b/style/listings.el
index ae6223f4..d68112ac 100644
--- a/style/listings.el
+++ b/style/listings.el
@@ -263,8 +263,23 @@
                     "rulecolor"
                     "rulesepcolor"))
             result)
+       ;; Cater for a color key provided by the lstlinebgrd package:
+       (when (member "lstlinebgrd" TeX-active-styles)
+         (push "linebackgroundcolor" keys))
        (dolist (key keys result)
          (push (list key colors) result))))
+   ;; Cater for other keys provided by the lstlinebgrd package:
+   (when (member "lstlinebgrd" TeX-active-styles)
+     (let ((len (mapcar (lambda (x) (concat TeX-esc x))
+                        (mapcar #'car (LaTeX-length-list)))))
+       `(("linebackgroundsep" ,len)
+         ("linebackgroundwidth" ,len)
+         ("linebackgroundheight" ,len)
+         ("linebackgrounddepth" ,len)
+         ("linebackgroundcmd"))))
+   ;; Cater for the key provided by the lstautogobble package:
+   (when (member "lstautogobble" TeX-active-styles)
+     '(("autogobble" ("true" "false"))))
    ;; Cater for user defined styles:
    (when (LaTeX-listings-lstdefinestyle-list)
      `(("style" ,(mapcar #'car (LaTeX-listings-lstdefinestyle-list)))))
diff --git a/style/lstautogobble.el b/style/lstautogobble.el
new file mode 100644
index 00000000..8f127d3b
--- /dev/null
+++ b/style/lstautogobble.el
@@ -0,0 +1,44 @@
+;;; lstautogobble.el --- AUCTeX style for `lstautogobble.sty'  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2024 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <ar...@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2024-08-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 Street, Fifth Floor, Boston,
+;; MA 02110-1301 USA.
+
+;;; Commentary:
+
+;; This file adds support for `lstautogobble.sty' v0.1 from 2012-05-03.
+
+;;; Code:
+
+(require 'tex)
+
+(TeX-add-style-hook
+ "lstautogobble"
+ (lambda ()
+   (TeX-run-style-hooks "listings"))
+ TeX-dialect)
+
+(defvar LaTeX-lstautogobble-package-options nil
+  "Package options for the lstautogobble package.")
+
+;;; lstautogobble.el ends here
diff --git a/style/lstlinebgrd.el b/style/lstlinebgrd.el
new file mode 100644
index 00000000..b37fa010
--- /dev/null
+++ b/style/lstlinebgrd.el
@@ -0,0 +1,44 @@
+;;; lstlinebgrd.el --- AUCTeX style for `lstlinebgrd.sty'  -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2024 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <ar...@gnu.org>
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 2024-08-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 Street, Fifth Floor, Boston,
+;; MA 02110-1301 USA.
+
+;;; Commentary:
+
+;; This file adds support for `lstlinebgrd.sty' v0.2 from 2024-08-18.
+
+;;; Code:
+
+(require 'tex)
+
+(TeX-add-style-hook
+ "lstlinebgrd"
+ (lambda ()
+   (TeX-run-style-hooks "listings" "xcolor"))
+ TeX-dialect)
+
+(defvar LaTeX-lstlinebgrd-package-options nil
+  "Package options for the lstlinebgrd package.")
+
+;;; lstlinebgrd.el ends here

Reply via email to