[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 3baaff2 08/23: Update style/fancyhdr.el to packa
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 3baaff2 08/23: Update style/fancyhdr.el to package version 4.0 |
Date: |
Sat, 23 Jan 2021 04:10:07 -0500 (EST) |
branch: externals/auctex
commit 3baaff2db3a6d7089d7e8780125338d920fb2c2b
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Update style/fancyhdr.el to package version 4.0
* style/fancyhdr.el (TeX-arg-fancyhdr-place): Rename from
`TeX-arg-fancyhdr-position'. Improve list of candidates for
completion.
(LaTeX-fancyhdr-fancypagestyle-regexp): New variable for parsing
user defined pagestyles.
("fancyhdr"): Update for macros provided by package version 4.0.
Remove completion support for deprecated macros.
Remove macros provided by LaTeX kernel.
Improve fontification support.
(LaTeX-fancyhdr-package-options): Add new package options.
---
style/fancyhdr.el | 185 +++++++++++++++++++++++++++++++++++-------------------
1 file changed, 122 insertions(+), 63 deletions(-)
diff --git a/style/fancyhdr.el b/style/fancyhdr.el
index 4557e3b..a9469d9 100644
--- a/style/fancyhdr.el
+++ b/style/fancyhdr.el
@@ -1,6 +1,6 @@
;;; fancyhdr.el --- AUCTeX style for `fancyhdr.sty' -*- lexical-binding: t;
-*-
-;; Copyright (C) 2012, 2013, 2018, 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2012, 2013, 2018-2021 Free Software Foundation, Inc.
;; Author: Mads Jensen <mje@inducks.org>
;; Maintainer: auctex-devel@gnu.org
@@ -25,7 +25,7 @@
;;; Commentary:
-;; This file adds support for `fancyhdr.sty', version 3.2
+;; This file adds support for `fancyhdr.sty', v4.0 from 2020/01/04.
;;; Code:
@@ -37,83 +37,142 @@
"font-latex"
(keywords class))
+;; Because there can be many places, `TeX-completing-read-multiple' is
+;; used instead of just `completing-read', and a `collection' argument
+;; is provided as the list of places differs between the macros
+(defun TeX-arg-fancyhdr-place (optional
+ &optional prompt collection full)
+ "Prompt for fancyhdr places with completion.
+If OPTIONAL is non-nil, insert the resulting value as an optional
+argument, otherwise as a mandatory one. If non-nil, PROMPT is
+used as the prompt. If non-nil, COLLECTION is used as the
+completion list for the place.
+
+If FULL is non-nil, a full list of places is offered for
+completion, otherwise a reduced one omitting place combinations
+for H(eader) or F(ooter)."
+ (let* ((places (or collection
+ ;; Standard places with no restrictions.
+ ;; Lower-case versions, and reverse versions
+ ;; (e.g., OC) are left out for simplicity.
+ (if full
+ '("L" "LO" "LE" "LOH" "LOF" "LEH" "LEF"
+ "C" "CO" "CE" "COH" "COF" "CEH" "CEF"
+ "R" "RO" "RE" "ROH" "ROF" "REH" "REF")
+ '("L" "LO" "LE" "C" "CO" "CE" "R" "RE" "RO"))))
+ (arguments (mapconcat #'identity
+ (TeX-completing-read-multiple
+ (TeX-argument-prompt optional
+ prompt
+ "Places")
+ places)
+ ",")))
+ (TeX-argument-insert arguments optional)))
+
+(defvar LaTeX-fancyhdr-fancypagestyle-regexp
+ '("\\\\fancypagestyle{\\([^}]+\\)}"
+ 1 LaTeX-auto-pagestyle)
+ "Regexp matching the first argument of \\fancypagestyle macro.")
+
(TeX-add-style-hook
"fancyhdr"
(lambda ()
(TeX-add-symbols
- '("lhead" t)
- '("lfoot" t)
- '("chead" t)
- '("cfoot" t)
- '("rhead" t)
- '("rfoot" t)
- '("nouppercase" t)
- '("MakeUppercase" t)
- '("fancyhead" [ TeX-arg-fancyhdr-position ] t)
- '("fancyfoot" [ TeX-arg-fancyhdr-position ] t)
+
+ ;; 2 Using fancyhdr
+ '("fancyhead" [ TeX-arg-fancyhdr-place ] t)
+ '("fancyfoot" [ TeX-arg-fancyhdr-place ] t)
+ '("fancyhf" [ (TeX-arg-fancyhdr-place nil nil t) ] t)
+
'("fancyheadoffset"
- [ (TeX-arg-fancyhdr-position
- "Position" ("LO" "LE" "L" "RE" "RO" "R" "0")) ] t)
+ [ (TeX-arg-fancyhdr-place nil ("L" "LO" "LE" "R" "RO" "RE")) ]
+ TeX-arg-length)
'("fancyfootoffset"
- [ (TeX-arg-fancyhdr-position
- "Position" ("LO" "LE" "L" "RE" "RO" "R" "O")) ] t)
+ [ (TeX-arg-fancyhdr-place nil ("LO" "LE" "L" "RO" "RE" "R")) ]
+ TeX-arg-length)
'("fancyhfoffset"
- [ (TeX-arg-fancyhdr-position "Position" ("E" "O" "L" "R")) ] t)
- '("fancypagestyle" TeX-arg-pagestyle t)
-
- "headrulewidth" "footrulewidth" "plainfootrulewidth"
- "plainheadrulewidth" "leftmark" "rightmark"
- ;; the manual does not mention any subsubsectionmark (!)
- "chaptermark" "sectionmark" "subsectionmark" "paragraphmark"
- "subparagraphmark" "footrule" "headrule")
-
- ;; `fancyhdr.sty' supplies these two pagestyles
- (LaTeX-add-pagestyles "fancy" "fancyplain")
+ [ (TeX-arg-fancyhdr-place nil ("L" "LO" "LE" "LOH" "LOF" "LEH" "LEF"
+ "R" "RO" "RE" "ROH" "ROF" "REH" "REF")) ]
+ TeX-arg-length)
+
+ "headrulewidth" "footrulewidth"
+ "headruleskip" "footruleskip"
+ "headrule" "footrule"
+ "headwidth"
+
+ '("fancyheadinit" t)
+ '("fancyfootinit" t)
+ '("fancyhfinit" t)
+
+ '("fancycenter"
+ [ TeX-arg-length "Distance" ] [ "Stretch" ] 3)
+
+ '("iftopfloat" 2)
+ '("ifbotfloat" 2)
+ '("iffloatpage" 2)
+ '("iffootnote" 2)
+
+ '("fancypagestyle"
+ ;; Always add the chosen pagestyle to list of known pagestyles,
+ ;; dupes are removed when retrieving with the function
+ ;; `LaTeX-pagestyle-list':
+ (TeX-arg-pagestyle nil t)
+ [ TeX-arg-pagestyle "Base pagestyle" ]
+ t)
+
+ ;; 15 The scoop on LATEX’s marks
+ '("nouppercase" t))
+
+ ;; 30 Deprecated commands
+ ;; Don't offer deprecated commands in V4.0 for completion anymore.
+ ;; '("lhead" t)
+ ;; '("lfoot" t)
+ ;; '("chead" t)
+ ;; '("cfoot" t)
+ ;; '("rhead" t)
+ ;; '("rfoot" t)
+ ;; "plainfootrulewidth"
+ ;; "plainheadrulewidth"
+
+ ;; `fancyhdr.sty' supplies these two pagestyles. Pagestyle
+ ;; `fancyplain' is now deprecated.
+ (LaTeX-add-pagestyles "fancy" "fancydefault")
+
+ ;; Add \fancypagestyle{pagestyle} to AUCTeX parser
+ (TeX-auto-add-regexp LaTeX-fancyhdr-fancypagestyle-regexp)
;; Fontification
(when (and (fboundp 'font-latex-add-keywords)
(eq TeX-install-font-lock 'font-latex-setup))
(font-latex-add-keywords '(("fancyhead" "[{")
("fancyfoot" "[{")
- ("lhead" "{")
- ("lfoot" "{")
- ("chead" "{")
- ("cfoot" "{")
- ("rhead" "{")
- ("rfoot" "{")
+ ("fancyhf" "[{")
("fancyheadoffset" "[{")
("fancyfootoffset" "[{")
- ("fancypagestyle" "{{")) 'function)
- (font-latex-add-keywords '(("headrulewidth" "")
- ("footrulewidth" "")
- ("plainheadrulewidth" "")
- ("plainfootrulewidth" "")) 'variable)))
+ ("fancyhfoffset" "[{")
+ ("fancyheadinit" "{")
+ ("fancyfootinit" "{")
+ ("fancyhfinit" "{")
+ ;; Fontify deprecated commands for
+ ;; older documents; to be removed
+ ;; sometimes ...
+ ("lhead" "[{")
+ ("lfoot" "[{")
+ ("chead" "[{")
+ ("cfoot" "[{")
+ ("rhead" "[{")
+ ("rfoot" "[{")
+ ;; Don't fontify the last argument;
+ ;; all macros used there should have
+ ;; their own fontification since they
+ ;; can also be used in a document
+ ;; top-level.
+ ("fancypagestyle" "{["))
+ 'function)))
TeX-dialect)
-;; Because there can be many positions, `TeX-completing-read-multiple' is used
-;; instead of just `completing-read', and a `collection' argument is provided
as
-;; the list of positions differs between the macros
-(defun TeX-arg-fancyhdr-position (optional &optional prompt collection)
- "Prompt for a fancyhdr position with completion.
-If OPTIONAL is non-nil, insert the resulting value as an optional
-argument, otherwise as a mandatory one. If non-nil, PROMPT is
-used as the prompt. If non-nil, COLLECTION is used as the
-completion list for the position."
- (let* ((positions (if (not collection)
- ;; Standard positions with no restrictions. Lower-case
- ;; versions, and reverse versions (e.g., OC) are left
- ;; out for simplicity.
- '("LO" "LE" "L" "CO" "CE" "C" "RE" "RO" "R")
- collection))
- (arguments
- (mapconcat 'identity
- (TeX-completing-read-multiple
- (TeX-argument-prompt optional prompt "Position")
- (mapcar 'list positions)) ",")))
- (TeX-argument-insert arguments optional)))
-
-(defvar LaTeX-fancyhdr-package-options nil
- "Package options for fancyhdr.")
+(defvar LaTeX-fancyhdr-package-options
+ '("nocheck" "compatV3" "headings" "myheadings")
+ "Package options for fancyhdr package.")
;;; fancyhdr.el ends here
-
- [elpa] externals/auctex updated (4473c1f -> 7b07019), Tassilo Horn, 2021/01/23
- [elpa] externals/auctex 83d68ae 02/23: Add use-package recipe to installation info docs, Tassilo Horn, 2021/01/23
- [elpa] externals/auctex eba6bab 03/23: Fix docstring too wide warnings, Tassilo Horn, 2021/01/23
- [elpa] externals/auctex b465e38 04/23: Fix mistake in use-package recipe, Tassilo Horn, 2021/01/23
- [elpa] externals/auctex b326502 05/23: Don't use `add-to-list' on lexical vars, Tassilo Horn, 2021/01/23
- [elpa] externals/auctex 3baaff2 08/23: Update style/fancyhdr.el to package version 4.0,
Tassilo Horn <=
- [elpa] externals/auctex 130010b 09/23: Add new style/extramarks.el, Tassilo Horn, 2021/01/23
- [elpa] externals/auctex 8e012b3 06/23: Fix off-by-one behavior of preview-latex (bug#39927), Tassilo Horn, 2021/01/23
- [elpa] externals/auctex db98d06 11/23: ; * style/fancyhdr.el: Fix package year., Tassilo Horn, 2021/01/23
- [elpa] externals/auctex 46c356b 18/23: Update style/multirow.el to package version 2.6, Tassilo Horn, 2021/01/23
- [elpa] externals/auctex 3f38eb2 07/23: Support page(box) options for dvipdfmx in graphicx.el, Tassilo Horn, 2021/01/23
- [elpa] externals/auctex a1569ca 12/23: Fix use-package recipe in install docs (once again), Tassilo Horn, 2021/01/23
- [elpa] externals/auctex 74f5675 01/23: Adapt preview.el.in for `TeX-translate-location-hook', Tassilo Horn, 2021/01/23
- [elpa] externals/auctex 2c5c2e1 10/23: Add support for some missing kernel macros, Tassilo Horn, 2021/01/23
- [elpa] externals/auctex ba0b1af 21/23: Prevent inadvertent destruction of list variable, Tassilo Horn, 2021/01/23
- [elpa] externals/auctex 18af0a5 13/23: * style/extramarks.el ("extramarks"): Use reference keyword class., Tassilo Horn, 2021/01/23