branch: externals/auctex commit 8d34ef21e671c3b89ce3906d335b9804b5e09757 Author: Arash Esbati <ar...@gnu.org> Commit: Arash Esbati <ar...@gnu.org>
Track the latest version of clsguide.tex * latex.el (LaTeX-common-initialization): Add "MakeTitlecase". * style/ltx-base.el (LaTeX-property-list): New variable. ("ltx-base"): Update and rearrange the macros provided. --- latex.el | 1 + style/ltx-base.el | 141 ++++++++++++++++++++++++++++++++++++------------------ 2 files changed, 96 insertions(+), 46 deletions(-) diff --git a/latex.el b/latex.el index de70c7f57d..b4b27de9b4 100644 --- a/latex.el +++ b/latex.el @@ -8762,6 +8762,7 @@ function would return non-nil and `(match-string 1)' would return '("mathring" t) '("MakeUppercase" t) '("MakeLowercase" t) + '("MakeTitlecase" t) '("chaptermark" "Text") '("sectionmark" "Text") '("subsectionmark" "Text") diff --git a/style/ltx-base.el b/style/ltx-base.el index 693308a378..67e1f6b41c 100644 --- a/style/ltx-base.el +++ b/style/ltx-base.el @@ -1,6 +1,6 @@ ;;; ltx-base.el --- AUCTeX style for basic LaTeX commands. -*- lexical-binding: t; -*- -;; Copyright (C) 2004--2022 Free Software Foundation, Inc. +;; Copyright (C) 2004--2024 Free Software Foundation, Inc. ;; Author: Frank Küster <fr...@kuesterei.ch> ;; Maintainer: auctex-de...@gnu.org @@ -32,12 +32,18 @@ ;;; Code: (require 'tex) +(require 'latex) ;; Silence the compiler: (declare-function font-latex-add-keywords "font-latex" (keywords class)) +(defvar LaTeX-property-list '("abspage" "page" "pagenum" "label" + "title" "target" "pagetarget" + "counter" "xpos" "ypos") + "List of properties predefined in LaTeX kernel.") + (TeX-add-style-hook "ltx-base" (lambda () @@ -54,35 +60,31 @@ '("LoadClass" [ "Options" ] "Class" [ "Release information" ]) '("LoadClassWithOptions" "Class" [ "Release information" ]) - ;; 4.3 Option declaration - '("DeclareOption" "Option" t) - '("DeclareOption*" t) - - ;; 4.4 Commands within option code - '("CurrentOption" 0) - '("OptionNotUsed" 0) - - ;; 4.5 Moving options around - '("PassOptionsToPackage" "Option(s) list" "Package") - '("PassOptionsToClass" "Option(s) list" "Class") - - ;; 4.6 Delaying code + ;; 4.3 Delaying code '("AtEndOfPackage" t) '("AtEndOfClass" t) '("AtBeginDocument" t) '("AtEndDocument" t) - '("AtBeginDvi" t) + ;; Marked as legacy LaTeX code: + ;; '("AtBeginDvi" t) - ;; 4.7 Option processing - '("ProcessOptions" (TeX-arg-literal "\\relax")) - "ProcessOptions*" - '("ExecuteOptions" "Option list") - ;; 4.8 Safe file commands + ;; 4.4 Creating and using keyval option: + '("DeclareKeys" ["Family"] t) + '("DeclareUnknownKeyHandler" ["Family"] t) + '("ProcessKeyOptions" ["Family"]) + '("SetKeys" ["Family"] t) + + ;; 4.5 Passing options around + '("PassOptionsToPackage" "Option(s) list" "Package") + '("PassOptionsToClass" "Option(s) list" "Class") + + ;; 4.6 Safe file commands '("IfFileExists" "File" 2) '("InputIfFileExists" "File" 2) - ;; 4.9 Reporting errors, etc + + ;; 4.7 Reporting errors, etc '("ClassError" "Class name" "Error text" t) '("PackageError" "Package name" "Error text" t) @@ -97,7 +99,48 @@ '("MessageBreak" 0) '("message" "Log Message") - ;; 4.10 Defining commands + ;; 5.1 Layout parameters + ;; \paperheight & \paperwidth are in latex.el + + ;; 5.2 Case changing + ;; \MakeUppercase, \MakeLowercase & \MakeTitlecase are in latex.el + + ;; 5.4 Better user-defined math display environments + "ignorespacesafterend" + + ;; 5.5 Normalising spacing + "normalsfcodes" + + ;; 5.3 Better user-defined math display environments + '("ignorespacesafterend") + + ;; 5.4 Normalising spacing + '("normalsfcodes") + + ;; 5.6 Extended and expandable references of properties + '("RecordProperties" "Label" + (TeX-arg-completing-read-multiple LaTeX-property-list "Property")) + '("RefProperty" "Label" + (TeX-arg-completing-read LaTeX-property-list "Property")) + '("RefUndefinedWarn" "Label" + (TeX-arg-completing-read LaTeX-property-list "Property")) + + '("NewProperty" "Name" + (TeX-arg-completing-read ("now" "shipout") "Setpoint") + "Default" t) + '("SetProperty" "Name" + (TeX-arg-completing-read ("now" "shipout") "Setpoint") + "Default" t) + + ;; 5.7 Preparing link targets + '("MakeLinkTarget" ["Prefix"] TeX-arg-counter) + '("MakeLinkTarget*" "Target name") + + '("LinkTargetOn" 0) + '("LinkTargetOff" 0) + '("NextLinkTarget" "Target name") + + ;; 6.1 Defining commands '("DeclareRobustCommand" TeX-arg-define-macro [ TeX-arg-define-macro-arguments ] t) '("DeclareRobustCommand*" @@ -106,30 +149,25 @@ '("CheckCommand" TeX-arg-macro [ TeX-arg-define-macro-arguments ] t) '("CheckCommand*" TeX-arg-macro [ TeX-arg-define-macro-arguments ] t) - ;; 5.1 Layout parameters - ;; \paperheight & \paperwidth are provided in latex.el - - ;; 5.2 Case changing - ;; \MakeUppercase & \MakeLppercase are provided in latex.el + ;; 6.2 Option declaration + '("DeclareOption" "Option" t) + '("DeclareOption*" t) - ;; 5.4 Better user-defined math display environments - "ignorespacesafterend" + ;; 6.3 Commands within option code + '("CurrentOption" 0) + '("OptionNotUsed" 0) - ;; 5.5 Normalising spacing - "normalsfcodes" + ;; 6.4 Option processing + '("ProcessOptions" (TeX-arg-literal "\\relax")) + "ProcessOptions*" + '("ExecuteOptions" "Option list") ;; Some general macros not mentioned in clsguide.pdf '("@addtoreset" TeX-arg-counter (TeX-arg-counter "Within counter")) '("addpenalty" "Penalty") '("@ifundefined" TeX-arg-macro 2) '("@ifnextchar" (TeX-arg-literal " ") (TeX-arg-free "Character") 2) - '("expandafter" 0) - - ;; These macros are currently (June 2022) described in ltkeys.dtx: - '("DeclareKeys" ["Family"] t) - '("DeclareUnknownKeyHandler" ["Family"] t) - '("ProcessKeyOptions" ["Family"]) - '("SetKeys" ["Family"] t)) + '("expandafter" 0) ) ;; Fontification (when (and (featurep 'font-latex) @@ -150,18 +188,29 @@ ("AtEndOfClass" "") ("AtBeginDocument" "") ("AtEndDocument" "") - ("AtBeginDvi" "") - - ("ProcessOptions" "*") - ("ExecuteOptions" "{") - ("DeclareRobustCommand" "*|{\\[[{") - ("CheckCommand" "*|{\\[[{") ("DeclareKeys" "[{") ("DeclareUnknownKeyHandler" "[{") ("ProcessKeyOptions" "[") - ("SetKeys" "[{")) - 'function))) + ("SetKeys" "[{") + + ("RefUndefinedWarn" "{{") + ("NewProperty" "{{{{") + ("SetProperty" "{{{{") + + ("MakeLinkTarget" "*[{") + ("LinkTargetOn" "") + ("LinkTargetOff" "") + ("NextLinkTarget" "") + + ("ProcessOptions" "*") + ("ExecuteOptions" "{") + ("DeclareRobustCommand" "*|{\\[[{") + ("CheckCommand" "*|{\\[[{")) + 'function) + (font-latex-add-keywords '(("RecordProperties" "{{") + ("RefProperty" "{{")) + 'reference) )) TeX-dialect) ;; Local Variables: