auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] [elpa] externals/auctex a25652ffe2 10/14: Update style/fb


From: Tassilo Horn
Subject: [AUCTeX-diffs] [elpa] externals/auctex a25652ffe2 10/14: Update style/fbox.el to package version 0.06
Date: Sat, 16 Apr 2022 04:28:44 -0400 (EDT)

branch: externals/auctex
commit a25652ffe22ef190e80780c88fa503ead0ac342c
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>

    Update style/fbox.el to package version 0.06
    
    * style/fbox.el (LaTeX-fbox-key-val-options): New function.
    ("fbox"): Run the style hook for 'xcolor'.
    ("fbox"): Support key=value query for the macros provided by the
    package with the new function `LaTeX-fbox-key-val-options'.
    (LaTeX-fbox-package-options): New variable.
---
 style/fbox.el | 37 ++++++++++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 7 deletions(-)

diff --git a/style/fbox.el b/style/fbox.el
index dc4e211f55..8348dfad6f 100644
--- a/style/fbox.el
+++ b/style/fbox.el
@@ -1,6 +1,6 @@
-;;; fbox.el --- AUCTeX style for `fbox.sty' (v0.04)  -*- lexical-binding: t; 
-*-
+;;; fbox.el --- AUCTeX style for `fbox.sty' (v0.06)  -*- lexical-binding: t; 
-*-
 
-;; Copyright (C) 2019--2020 Free Software Foundation, Inc.
+;; Copyright (C) 2019--2022 Free Software Foundation, Inc.
 
 ;; Author: Arash Esbati <arash@gnu.org>
 ;; Maintainer: auctex-devel@gnu.org
@@ -26,26 +26,46 @@
 
 ;;; Commentary:
 
-;; This file adds support for `fbox.sty' (v0.04) from 2020/01/03.
+;; This file adds support for `fbox.sty' (v0.06) from 2022/02/20.
 ;; `fbox.sty' is part of TeXLive.
 
 ;;; Code
 
 (require 'tex)
+(require 'latex)
 
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                   "font-latex"
                   (keywords class))
+(declare-function LaTeX-xcolor-definecolor-list "xcolor" ())
+
+(defun LaTeX-fbox-key-val-options ()
+  "Return an updated list of key=vals from fbox package."
+  (let ((colors (mapcar #'car (LaTeX-xcolor-definecolor-list)))
+        (lenghts (mapcar (lambda (x)
+                           (concat TeX-esc (car x)))
+                         (LaTeX-length-list))))
+    `(("boxrule" ,lenghts)
+      ("boxsep"  ,lenghts)
+      ("lcolor"  ,colors)
+      ("rcolor"  ,colors)
+      ("bcolor"  ,colors)
+      ("tcolor"  ,colors)
+      ("l")
+      ("r")
+      ("b")
+      ("t"))))
 
 (TeX-add-style-hook
  "fbox"
  (lambda ()
+   (TeX-run-style-hooks "xcolor")
    (TeX-add-symbols
-    '("fbox"     [ "Frame parts (combination of lrtb)" ] t)
-    '("fbox*"    [ "Frame parts (combination of lrtb)" ] t)
-    '("fparbox"  [ "Frame parts (combination of lrtb)" ] t)
-    '("fparbox*" [ "Frame parts (combination of lrtb)" ] t))
+    '("fbox"     [TeX-arg-key-val (LaTeX-fbox-key-val-options)] t)
+    '("fbox*"    [TeX-arg-key-val (LaTeX-fbox-key-val-options)] t)
+    '("fparbox"  [TeX-arg-key-val (LaTeX-fbox-key-val-options)] t)
+    '("fparbox*" [TeX-arg-key-val (LaTeX-fbox-key-val-options)] t))
 
    ;; Fontification
    (when (and (featurep 'font-latex)
@@ -55,4 +75,7 @@
                               'function)))
  TeX-dialect)
 
+(defvar LaTeX-fbox-package-options nil
+  "Package options for the fbox package.")
+
 ;;; fbox.el ends here




reply via email to

[Prev in Thread] Current Thread [Next in Thread]