Hi All, 

attached you find a patch that adds support for refcount.sty. I tested
in this morning. 

Comments are welcome

Uwe Brauer 


-- 
I strongly condemn Hamas heinous atrocities on Israel, especially the 
despicable pogroms.
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine. 

# HG changeset patch
# User Uwe Brauer <o...@mat.ucm.es>
# Date 1701608407 -3600
#      Sun Dec 03 14:00:07 2023 +0100
# Node ID 9d16ecbae0aad14d4fff18f347af5af0b7223a4d
# Parent  35fb43f7b36b75f7153c3a716d4fd81960c32422
# EXP-Topic refcount
Add refcount support to AucTeX

* Makefile.in (STYLESRC): Add refcount.

* style/refcount.el: Add refcount support to AucTeX.

diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
@@ -197,7 +197,7 @@
 	   style/proc.el      style/microtype.el style/tcolorboxlib-theorems.el \
 	   style/amsaddr.el   style/parskip.el   style/catchfilebetweentags.el \
 	   style/physics.el   style/soul.el      style/algpseudocodex.el \
-	   style/wasysym.el
+	   style/wasysym.el   style/refcount.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/refcount.el b/style/refcount.el
new file mode 100644
--- /dev/null
+++ b/style/refcount.el
@@ -0,0 +1,90 @@
+;;; refcount.el --- AUCTeX style for refcount package  -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2022 Free Software Foundation, Inc.
+
+;; Author: Uwe Brauer o...@mat.ucm.es, Arash Esbati <ar...@gnu.org> 
+;; Maintainer: auctex-devel@gnu.org
+;; Created: 02 Dec 2023
+;; Keywords:
+;; 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 the refcount package.
+
+
+;;; Code:
+
+(require 'tex)
+(require 'latex)
+
+;; Silence the compiler:
+(declare-function font-latex-add-keywords
+                  "font-latex"
+                  (keywords class))
+
+
+
+(TeX-add-style-hook
+ "refcount"
+ (lambda ()
+   (TeX-add-symbols
+    '("setcounterref" TeX-arg-counter TeX-arg-ref)
+    '("addtocounterref" TeX-arg-counter TeX-arg-ref)
+    '("setcounterpageref" TeX-arg-counter TeX-arg-ref)
+    '("addcounterpageref" TeX-arg-counter TeX-arg-ref)
+    '("getrefnumber"  TeX-arg-ref)
+    '("getpagerefnumber"  TeX-arg-ref)
+    '("refused"  TeX-arg-ref)
+    '("IfRefUndefinedExpandable"
+      TeX-arg-ref
+      (TeX-arg-completing-read ("then" "else"))
+      "Default")
+    '("getrefbykeydefault" TeX-arg-ref 
+      (TeX-arg-completing-read ("page" "title" "name" "anchor" "url")) 
+      "Default")
+    '("IfRefUndefinedBabel"
+      TeX-arg-ref
+      (TeX-arg-completing-read ("then" "else"))
+      "Default"))
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("getrefbykeydefault" "*{")
+                                ("setcounterref" "*{")
+                                ("addtocounterref" "*{")
+                                ("setcounterpageref" "*{")
+                                ("addcounterpageref" "*{")
+                                ("getrefnumber"  "*{")
+                                ("getpagerefnumber"  "*{")
+                                ("IfRefUndefinedExpandable" "*{")
+                                ("IfRefUndefinedBabel" "*{")
+                                ("refused"  "*{"))
+                              'function))
+
+   ;; RefTeX reference style
+   (when (featurep 'reftex-vars)
+     (and LaTeX-reftex-ref-style-auto-activate
+          (fboundp 'reftex-ref-style-activate)
+          (reftex-ref-style-activate "Refcount"))))
+ TeX-dialect)
+
+
+
+
+;;; refcount.el ends here

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to