auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 4b21d3f10a2edc90d2cbb


From: Tassilo Horn
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 4b21d3f10a2edc90d2cbb2987273c485e390a016
Date: Fri, 17 Oct 2014 13:23:49 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  4b21d3f10a2edc90d2cbb2987273c485e390a016 (commit)
      from  45ffe1f260ca71cd474c90bace312a57d7aedfee (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4b21d3f10a2edc90d2cbb2987273c485e390a016
Author: Matthew Leach <address@hidden>
Date:   Fri Oct 17 15:23:25 2014 +0200

    Add style for cleverref.
    
    * style/cleveref.el: New file.
    
    Signed-off-by: Tassilo Horn <address@hidden>

diff --git a/ChangeLog b/ChangeLog
index 10cc9de..d91774a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-10-13  Matthew Leach  <address@hidden>
+
+       * style/cleveref.el: New file.
+
 2014-10-02  Ikumi Keita  <address@hidden>
 
        * tex.el (featurep): Activate mark in the GNU Emacs version of
diff --git a/Makefile.in b/Makefile.in
index efdc405..583b6e7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -134,7 +134,7 @@ STYLESRC = style/prosper.el \
           style/acronym.el   style/xparse.el    style/fancyvrb.el \
           style/tabulary.el  style/fontspec.el  style/unicode-math.el \
           style/luacode.el   style/metalogo.el  style/english.el \
-          style/exercise.el  style/plext.el
+          style/exercise.el  style/plext.el     style/cleveref.el
 STYLEELC = $(STYLESRC:.el=.elc)
 
 CLEANFILES = $(AUCELC) $(STYLEELC) $(MULEELC)
diff --git a/style/cleveref.el b/style/cleveref.el
new file mode 100644
index 0000000..755239d
--- /dev/null
+++ b/style/cleveref.el
@@ -0,0 +1,103 @@
+;;; cleveref.el --- Style hook for the `cleveref.sty' package.
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Author: Matthew Leach <address@hidden>
+;; Maintainer: address@hidden
+;; Created: 13/10/2014
+
+;; 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.
+
+;;; Code
+
+(defun TeX-arg-cleveref-multiple-labels (optional &optional prompt definition)
+  "Prompt for a series of labels completing with known labels.
+If OPTIONAL is non-nil, insert the resulting value as an optional
+argument, otherwise as a mandatory one.  Use PROMPT as the prompt
+string.  If DEFINITION is non-nil, add each chosen label to the
+list of defined labels."
+  (let* ((labels (TeX-completing-read-multiple
+                  (TeX-argument-prompt optional prompt "Keys")
+                  (LaTeX-label-list)))
+         (labels-string (mapconcat 'identity labels ",")))
+    (when definition
+      (apply 'LaTeX-add-labels labels))
+    (TeX-argument-insert labels-string optional optional)))
+
+(TeX-add-style-hook
+ "cleveref"
+ (lambda ()
+   (TeX-add-symbols
+    '("cref" TeX-arg-cleveref-multiple-labels)
+    '("Cref" TeX-arg-cleveref-multiple-labels)
+    '("crefrange" (TeX-arg-label "Key (first)") (TeX-arg-label "Key (last)"))
+    '("Crefrange" (TeX-arg-label "key (first)") (TeX-arg-label "Key (last)"))
+    '("cpageref" TeX-arg-cleveref-multiple-labels)
+    '("Cpageref" TeX-arg-cleveref-multiple-labels)
+    '("cpagerefrange" (TeX-arg-label "Key (first)") (TeX-arg-label "Key 
(last)"))
+    '("Cpagerefrange" (TeX-arg-label "Key (first)") (TeX-arg-label "Key 
(last)"))
+    '("cref*" TeX-arg-cleveref-multiple-labels)
+    '("Cref*" TeX-arg-cleveref-multiple-labels)
+    '("crefrange*" (TeX-arg-label "Key (first)") (TeX-arg-label "Key (last)"))
+    '("Crefrange*" (TeX-arg-label "Key (first)") (TeX-arg-label "Key (last)"))
+    '("namecref" TeX-arg-label)
+    '("nameCref" TeX-arg-label)
+    '("lnamecref" TeX-arg-label)
+    '("namecrefs" TeX-arg-label)
+    '("nameCrefs" TeX-arg-label)
+    '("lnamecrefs" TeX-arg-label)
+    '("labelcref" TeX-arg-cleveref-multiple-labels)
+    '("labelcpageref" TeX-arg-cleveref-multiple-labels))
+
+   ;; These macros aren't used particularly often during the course of
+   ;; normal referencing.
+   (TeX-declare-expert-macros
+    "cleveref"
+    "namecref" "nameCref" "lnamecref" "namecrefs" "nameCrefs"
+    "lnamecrefs" "labelcref" "labelcpageref")
+
+   ;; Fontification
+   (when (and (fboundp 'font-latex-add-keywords)
+             (fboundp 'font-latex-set-syntactic-keywords)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("cref" "*{")
+                               ("Cref" "*{")
+                               ("crefrange" "*{{")
+                               ("Crefrange" "*{{")
+                                ("cpageref" "{")
+                                ("Cpageref" "{")
+                                ("cpagerefrange" "{{")
+                                ("Cpagerefrange" "{{")
+                                ("namecref" "{")
+                                ("nameCref" "{")
+                                ("lnamecref" "{")
+                                ("namecrefs" "{")
+                                ("nameCrefs" "{")
+                                ("lnamecrefs" "{")
+                                ("labelcref" "{")
+                                ("labelcpageref" "{"))
+                             'reference)
+     ;; For syntactic fontification, e.g. verbatim constructs.
+     (font-latex-set-syntactic-keywords)))
+ LaTeX-dialect)
+
+(defvar LaTeX-cleveref-package-options
+  '("capitalise" "nameinlink" "noabbrev" "poorman")
+    "Package options for the cleveref package.")
+
+;;; cleveref.el ends here.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog         |    4 ++
 Makefile.in       |    2 +-
 style/cleveref.el |  103 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 108 insertions(+), 1 deletions(-)
 create mode 100644 style/cleveref.el


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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