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. 12bfe806986cd4b2ca384


From: Arash Esbati
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 12bfe806986cd4b2ca384b5de2b7dd95bc52c515
Date: Thu, 1 Sep 2016 12:40:46 +0000 (UTC)

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  12bfe806986cd4b2ca384b5de2b7dd95bc52c515 (commit)
       via  d0e8c1c20059fea85f2b2ee38cc222edda524898 (commit)
       via  25bdcb2846c78f9f28510c7e6c1ae1a7d46df79b (commit)
      from  22f94507cdf768b49bc480a3bdd212e8d2ac7824 (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 12bfe806986cd4b2ca384b5de2b7dd95bc52c515
Author: Arash Esbati <address@hidden>
Date:   Thu Sep 1 14:40:13 2016 +0200

    Add new style/menukeys.el
    
    * Makefile.in (STYLESRC): Add new style.
    
    * style/menukeys.el: New file.

diff --git a/Makefile.in b/Makefile.in
index 1a8e5d2..014f5be 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -156,7 +156,7 @@ STYLESRC = style/prosper.el \
           style/hologo.el    style/theorem.el   style/ntheorem.el \
           style/splitidx.el  style/tikz.el      style/xcolor.el \
           style/pdflscape.el style/commath.el   style/empheq.el \
-          style/framed.el    style/paracol.el
+          style/framed.el    style/paracol.el   style/menukeys.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/menukeys.el b/style/menukeys.el
new file mode 100644
index 0000000..bc30a84
--- /dev/null
+++ b/style/menukeys.el
@@ -0,0 +1,539 @@
+;;; menukeys.el --- AUCTeX style for `menukeys.sty' (v1.4)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash.esbati'at'gmail.com>
+;; Maintainer: address@hidden
+;; Created: 2016-02-07
+;; Keywords: tex
+
+;; 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 `menukeys.sty' (v1.4) from 2016/04/18.
+;; `menukeys.sty' is part of TeXLive.
+
+;;; Code:
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+(defvar LaTeX-menukeys-input-separators-list
+  '("/" "=" "*" "+" "," ";" ":" "-" ">" "<" "bslash")
+  "List of input separators for macros of menukeys package.")
+
+(defvar LaTeX-menukeys-predefined-styles-list
+  '("menus" "roundedmenus" "angularmenus" "roundedkeys"
+    "shadowedroundedkeys"  "angularkeys"  "shadowedangularkeys"
+    "typewriterkeys"       "paths"        "pathswithfolder"
+    "pathswithblackfolder" "hyphenatepaths"
+    "hyphenatepathswithfolder"
+    "hyphenatepathswithblackfolder")
+  "List of predefined styles for macros from menukeys package.")
+
+;; Setup for \newmenustyle(simple):
+(TeX-auto-add-type "menukeys-newmenustyle" "LaTeX")
+
+(defvar LaTeX-menukeys-newmenustyle-regexp
+  '("\\\\\\(?:new\\|copy\\)menustyle\\(?:simple\\)?*?{\\([^}]+\\)}"
+    1 LaTeX-auto-menukeys-newmenustyle)
+  "Matches the argument of \\newmenustyle and
+\\newmenustylesimple from menukeys package.")
+
+;; Setup for \newmenucolortheme:
+(TeX-auto-add-type "menukeys-newmenucolortheme" "LaTeX")
+
+(defvar LaTeX-menukeys-newmenucolortheme-regexp
+  '("\\\\\\(?:new\\|copy\\)menucolortheme{\\([^}]+\\)}"
+    1 LaTeX-auto-menukeys-newmenucolortheme)
+  "Matches the argument of \\newmenucolortheme from menukeys package.")
+
+;; Setup for \newmenumacro:
+(TeX-auto-add-type "menukeys-newmenumacro" "LaTeX")
+
+(defvar LaTeX-menukeys-newmenumacro-regexp
+  `(,(concat
+      "\\\\\\(new\\|renew\\|provide\\)menumacro"
+      "{?"
+      (regexp-quote TeX-esc)
+      "\\([a-zA-Z]+\\)"
+      "}?"
+      "\\(?:\\[\\([^]]*\\)\\]\\)?")
+    (2 3 1) LaTeX-auto-menukeys-newmenumacro)
+  "Matches the arguments of \\newmenumacro from menukeys package.")
+
+(defun LaTeX-menukeys-auto-prepare ()
+  "Clear various `LaTeX-auto-menukeys-*' variables before parsing."
+  (setq LaTeX-auto-menukeys-newmenustyle nil
+       LaTeX-auto-menukeys-newmenucolortheme nil
+       LaTeX-auto-menukeys-newmenumacro nil))
+
+(defun LaTeX-menukeys-auto-cleanup ()
+  "Process the parsed elements for menukeys package.
+This function adds parsed elements from the variable
+`LaTeX-menukeys-newmenumacro-list' to AUCTeX via the function
+`TeX-add-symbols'.  The variable
+`LaTeX-menukeys-newmenumacro-list' and not the function with the
+same name is used since this function looks for the order of
+commands which are set by \\renewmenumacro in order to pick the
+current separator.  These renew-commands are also removed first
+from the variable `TeX-symbol-list' before being re-added."
+  (dolist (x (apply #'append LaTeX-menukeys-newmenumacro-list))
+    (let ((macro (nth 0 x))
+         (sep   (nth 1 x))
+         (renew (when (string= (nth 2 x) "renew")
+                  (nth 2 x))))
+      ;; When we are renewmenumacro'ing, delete the entry first from the
+      ;; variable `TeX-symbol-list' and then add the new spec:
+      (when renew
+       (setq TeX-symbol-list
+             (assq-delete-all (car (assoc macro (TeX-symbol-list))) 
TeX-symbol-list)))
+      (TeX-add-symbols
+       `(,macro [ TeX-arg-eval completing-read
+                              (TeX-argument-prompt optional nil
+                                                   ,(concat "Input separator "
+                                                            "(default "
+                                                            (if (and sep (not 
(string= sep "")))
+                                                                sep
+                                                              ",")
+                                                            ")"))
+                              LaTeX-menukeys-input-separators-list ] t ))
+      (when (and (featurep 'font-latex)
+                (eq TeX-install-font-lock 'font-latex-setup))
+       (font-latex-add-keywords `((,macro "[{"))
+                                'textual)))))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-menukeys-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-menukeys-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(defun TeX-arg-menukeys-newmenumacro (optional &optional renew)
+  "Query and insert the arguments of \\newmenumacro from menukeys package.
+After inserting, add the name of macro and the optional separator
+to the name of known macros via `TeX-add-symbols'.  If
+font-latex.el is loaded, also use `font-latex-add-keywords' on
+macro.  If RENEW is non-nil, query for an already defined macro."
+  (let ((macro (if renew
+                  (completing-read
+                   (concat "Macro: " TeX-esc)
+                   (delete-dups (mapcar #'car 
(LaTeX-menukeys-newmenumacro-list))))
+                (TeX-read-string (concat "Macro: " TeX-esc))))
+       (sep   (completing-read
+               (TeX-argument-prompt optional nil "Input separator (default ,)")
+               LaTeX-menukeys-input-separators-list))
+       (style (completing-read
+               (TeX-argument-prompt optional nil "Style")
+               (LaTeX-menukeys-newmenustyle-list))))
+    (TeX-argument-insert (concat TeX-esc macro) optional)
+    (when (and sep (not (string= sep "")))
+      (insert (format "[%s]" sep)))
+    (TeX-argument-insert style optional)
+    ;; When we are renewmenumacro'ing, delete the entry first from the
+    ;; variable `TeX-symbol-list' and then add the new spec:
+    (when renew
+      (setq TeX-symbol-list
+           (assq-delete-all (car (assoc macro (TeX-symbol-list))) 
TeX-symbol-list)))
+    (TeX-add-symbols
+     `(,macro [ TeX-arg-eval completing-read
+                            (TeX-argument-prompt optional nil
+                                                 ,(concat "Input separator "
+                                                         "(default "
+                                                         (if (and sep (not 
(string= sep "")))
+                                                             sep
+                                                           ",")
+                                                         ")"))
+                            LaTeX-menukeys-input-separators-list ] t ))
+    (when (and (featurep 'font-latex)
+              (eq TeX-install-font-lock 'font-latex-setup))
+      (font-latex-add-keywords `((,macro       "[{"))
+                              'textual))))
+
+(TeX-add-style-hook
+ "menukeys"
+ (lambda ()
+
+   ;; Add menukeys to the parser
+   (TeX-auto-add-regexp LaTeX-menukeys-newmenustyle-regexp)
+   (TeX-auto-add-regexp LaTeX-menukeys-newmenucolortheme-regexp)
+   (TeX-auto-add-regexp LaTeX-menukeys-newmenumacro-regexp)
+
+   ;; Activate predefined stuff
+   (apply #'LaTeX-add-menukeys-newmenustyles 
LaTeX-menukeys-predefined-styles-list)
+   (LaTeX-add-menukeys-newmenucolorthemes "gray" "blacknwhite")
+
+   ;; Run style hooks for xcolor, tikz and relsize
+   (TeX-run-style-hooks "xcolor" "tikz" "relsize")
+
+   ;; 4.1 Basic macros: These are not defined if the package option
+   ;; definemenumacros ist set to false (default is true).  We check
+   ;; for the package option here and add them.
+   (unless (LaTeX-provided-package-options-member "menukeys" 
"definemenumacros=false")
+     (TeX-add-symbols
+      ;; \menu      [<separator>]{<sequence>}
+      ;; \directory [<separator>]{path}
+      ;; \keys      [<separator>]{keystrokes}
+      '("menu"
+       [ TeX-arg-eval completing-read
+                      (TeX-argument-prompt optional nil "Input separator")
+                      LaTeX-menukeys-input-separators-list ]
+       t)
+
+      '("directory"
+       [ TeX-arg-eval completing-read
+                      (TeX-argument-prompt optional nil "Input separator")
+                      LaTeX-menukeys-input-separators-list ]
+       t)
+
+      '("keys"
+       [ TeX-arg-eval completing-read
+                      (TeX-argument-prompt optional nil "Input separator")
+                      LaTeX-menukeys-input-separators-list ]
+       t)))
+
+   (TeX-add-symbols
+    ;; 4.2.1 Predefined styles
+    ;; \drawtikzfolder[<front fill>][<draw>]
+    '("drawtikzfolder"
+      [ TeX-arg-eval completing-read
+                    (TeX-argument-prompt optional nil "Front color")
+                    (LaTeX-xcolor-definecolor-list) ]
+      [ TeX-arg-eval completing-read
+                    (TeX-argument-prompt optional nil "Line color")
+                    (LaTeX-xcolor-definecolor-list) ] )
+
+    ;; 4.2.2 Declaring styles
+    ;; \newmenustylesimple*{<name>}[<pre>]{<style>}[<sep>][<post>]{<theme>}
+    '("newmenustylesimple"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((name (TeX-read-string
+                     (TeX-argument-prompt optional nil "Name"))))
+          (LaTeX-add-menukeys-newmenustyles name)
+          (format "%s" name))))
+      [ t ] nil [ nil ] [ nil ]
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Color theme")
+                   (LaTeX-menukeys-newmenucolortheme-list)))
+
+    '("newmenustylesimple*"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((name (TeX-read-string
+                     (TeX-argument-prompt optional nil "Name"))))
+          (LaTeX-add-menukeys-newmenustyles name)
+          (format "%s" name))))
+      [ t ] nil [ nil ] [ nil ]
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Color theme")
+                   (LaTeX-menukeys-newmenucolortheme-list)))
+
+    ;; 
\newmenustyle*{<name>}[<pre>]{<first>}[<sep>]{<mid>}{<last>}{<single>}[<post>]{<theme>}
+    '("newmenustyle"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((name (TeX-read-string
+                     (TeX-argument-prompt optional nil "Name"))))
+          (LaTeX-add-menukeys-newmenustyles name)
+          (format "%s" name))))
+      [ t ] nil [ nil ] nil nil nil [ nil ]
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Color theme")
+                   (LaTeX-menukeys-newmenucolortheme-list)))
+
+    '("newmenustyle*"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((name (TeX-read-string
+                     (TeX-argument-prompt optional nil "Name"))))
+          (LaTeX-add-menukeys-newmenustyles name)
+          (format "%s" name))))
+      [ t ] nil [ nil ] nil nil nil [ nil ]
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Color theme")
+                   (LaTeX-menukeys-newmenucolortheme-list)))
+
+    '("CurrentMenuElement" 0)
+
+    ;; 4.2.3 Copying styles
+    '("copymenustyle"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((copy (TeX-read-string
+                     (TeX-argument-prompt optional nil "Copy")))
+              (orig (completing-read
+                     (TeX-argument-prompt optional nil "Original")
+                     (LaTeX-menukeys-newmenustyle-list))))
+          (LaTeX-add-menukeys-newmenustyles copy)
+          (TeX-argument-insert copy optional)
+          (format "%s" orig)))))
+
+    ;; 4.2.4 Changing styles
+    ;; \changemenuelement*{name}{element}{definition}
+    '("changemenuelement"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Name")
+                   (LaTeX-menukeys-newmenustyle-list))
+      2)
+
+    '("changemenuelement*"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Name")
+                   (LaTeX-menukeys-newmenustyle-list))
+      2)
+
+    ;; Same arguments as \newmenustylesimple
+    '("renewmenustylesimple"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Name")
+                   (LaTeX-menukeys-newmenustyle-list))
+      [ t ] nil [ nil ] [ nil ]
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Color theme")
+                   (LaTeX-menukeys-newmenucolortheme-list)))
+
+    '("providemenustylesimple"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((name (TeX-read-string
+                     (TeX-argument-prompt optional nil "Name"))))
+          (LaTeX-add-menukeys-newmenustyles name)
+          (format "%s" name))))
+      [ t ] nil [ nil ] [ nil ]
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Color theme")
+                   (LaTeX-menukeys-newmenucolortheme-list)))
+
+    ;; Same arguments as \newmenustyle
+    '("providemenustyle"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Name")
+                   (LaTeX-menukeys-newmenustyle-list))
+      [ t ] nil [ nil ] nil nil nil [ nil ]
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Color theme")
+                   (LaTeX-menukeys-newmenucolortheme-list)))
+
+    '("renewmenustyle"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((name (TeX-read-string
+                     (TeX-argument-prompt optional nil "Name"))))
+          (LaTeX-add-menukeys-newmenustyles name)
+          (format "%s" name))))
+      [ t ] nil [ nil ] nil nil nil [ nil ]
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Color theme")
+                   (LaTeX-menukeys-newmenucolortheme-list)))
+
+    ;; 4.3 Color themes
+    ;; 4.3.2 Create a theme
+    ;; \newmenucolortheme{<name>}{<model>}{<bg>}{<br>}{<txt>}[<a>][<b>][<c>]
+    '("newmenucolortheme"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((name (TeX-read-string
+                     (TeX-argument-prompt optional nil "Name"))))
+          (LaTeX-add-menukeys-newmenucolorthemes name)
+          (format "%s" name))))
+      (TeX-arg-eval
+       (lambda ()
+        (let ((model (completing-read
+                      (TeX-argument-prompt optional nil "Model")
+                      (LaTeX-xcolor-color-models))))
+          (TeX-argument-insert model optional)
+          (if (string= model "named")
+              (let ((bg (completing-read
+                         (TeX-argument-prompt optional nil "Node background 
color")
+                         (LaTeX-xcolor-definecolor-list)))
+                    (br (completing-read
+                         (TeX-argument-prompt optional nil "Node border color")
+                         (LaTeX-xcolor-definecolor-list)))
+                    (txt (completing-read
+                          (TeX-argument-prompt optional nil "Node text color")
+                          (LaTeX-xcolor-definecolor-list))))
+                (TeX-argument-insert bg optional)
+                (TeX-argument-insert br optional)
+                (format "%s" txt))
+            (let ((bg (TeX-read-string
+                       (TeX-argument-prompt optional nil "Node background 
color spec")))
+                  (br (TeX-read-string
+                       (TeX-argument-prompt optional nil "Node border color 
spec")))
+                  (txt (TeX-read-string
+                        (TeX-argument-prompt optional nil "Node text color 
spec"))))
+              (TeX-argument-insert bg optional)
+              (TeX-argument-insert br optional)
+              (format "%s" txt))))))
+      (TeX-arg-conditional (y-or-n-p "With additional optional arguments? ")
+                          ( [ 3 ] )
+                        (ignore)))
+
+    ;; 4.3.3 Copy a theme
+    '("copymenucolortheme"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((copy (TeX-read-string
+                     (TeX-argument-prompt optional nil "Copy")))
+              (orig (completing-read
+                     (TeX-argument-prompt optional nil "Original")
+                     (LaTeX-menukeys-newmenucolortheme-list))))
+          (LaTeX-add-menukeys-newmenucolorthemes copy)
+          (TeX-argument-insert copy optional)
+          (format "%s" orig)))))
+
+    ;; 4.3.4 Change a theme
+    '("changemenucolor"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Name")
+                   (LaTeX-menukeys-newmenucolortheme-list))
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Element")
+                   '("bg" "br" "txt"))
+      (TeX-arg-eval
+       (lambda ()
+        (let ((model (completing-read
+                      (TeX-argument-prompt optional nil "Model")
+                      (LaTeX-xcolor-color-models))))
+          (TeX-argument-insert model optional)
+          (if (string= model "named")
+              (let ((color (completing-read
+                            (TeX-argument-prompt optional nil "Color")
+                            (LaTeX-xcolor-definecolor-list))))
+                (format "%s" color))
+            (let ((color (TeX-read-string
+                          (TeX-argument-prompt optional nil "Color spec"))))
+              (format "%s" color)))))))
+
+    ;; Same arguments as \newmenucolortheme
+    '("renewmenucolortheme"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((name (TeX-read-string
+                     (TeX-argument-prompt optional nil "Name"))))
+          (LaTeX-add-menukeys-newmenucolorthemes name)
+          (format "%s" name))))
+      (TeX-arg-eval
+       (lambda ()
+        (let ((model (completing-read
+                      (TeX-argument-prompt optional nil "Model")
+                      (LaTeX-xcolor-color-models))))
+          (TeX-argument-insert model optional)
+          (if (string= model "named")
+              (let ((bg (completing-read
+                         (TeX-argument-prompt optional nil "Node background 
color")
+                         (LaTeX-xcolor-definecolor-list)))
+                    (br (completing-read
+                         (TeX-argument-prompt optional nil "Node border color")
+                         (LaTeX-xcolor-definecolor-list)))
+                    (txt (completing-read
+                          (TeX-argument-prompt optional nil "Node text color")
+                          (LaTeX-xcolor-definecolor-list))))
+                (TeX-argument-insert bg optional)
+                (TeX-argument-insert br optional)
+                (format "%s" txt))
+            (let ((bg (TeX-read-string
+                       (TeX-argument-prompt optional nil "Node background 
color spec")))
+                  (br (TeX-read-string
+                       (TeX-argument-prompt optional nil "Node border color 
spec")))
+                  (txt (TeX-read-string
+                        (TeX-argument-prompt optional nil "Node text color 
spec"))))
+              (TeX-argument-insert bg optional)
+              (TeX-argument-insert br optional)
+              (format "%s" txt))))))
+      (TeX-arg-conditional (y-or-n-p "With additional optional arguments? ")
+                          ( [ 3 ] )
+                        (ignore)))
+
+    ;; 4.4 Menu macros
+    ;; 4.4.2 Defining or changing menu macros
+    ;; \newmenumacro{<macro>} [<input sep>]{<style>}
+    '("newmenumacro"     TeX-arg-menukeys-newmenumacro)
+    '("providemenumacro" TeX-arg-menukeys-newmenumacro)
+    '("renewmenumacro"   (TeX-arg-menukeys-newmenumacro t)))
+
+   ;; 4.5 Keys: These macros are defined when definekeys option is not
+   ;; false.
+   ;; 0 : No argment, one macro
+   ;; 1 : One argument, with completion
+   ;; 2 : No argment, three macros: \<key>, \<key>win, \<key>mac
+   (unless (LaTeX-provided-package-options-member "menukeys" 
"definekeys=false")
+     (let ((keycmds '(("shift" . 0)   ("capslock" . 2)  ("tab" . 2)
+                     ("esc" . 2)     ("ctrl" . 2)      ("alt" . 2)
+                     ("AltGr" . 0)   ("cmd"   . 0)     ("Space" . 0)
+                     ("SPACE" . 0)   ("return" . 2)    ("enter"  . 2)
+                     ("winmenu" . 0) ("backspace" . 0) ("del" . 0)
+                     ("arrowkeyup" . 0)   ("arrowkeydown" . 0)
+                     ("arrowkeyleft" . 0) ("arrowkeyright" . 0)
+                     ("arrowkey" . 1)
+                     ;; Text inside some keys:
+                     ("ctrlname" . 0) ("delname" . 0) ("spacename" . 0)))
+          (os '("mac" "win"))
+          collector)
+       (dolist (cmd keycmds)
+        (cond
+         ((= (cdr cmd) 0)
+          (push (car cmd) collector))
+         ((= (cdr cmd) 1)
+          (push (list (car cmd) '(TeX-arg-eval completing-read
+                                                  "Direction: "
+                                                  '("^" "v" ">" "<")))
+                   collector))
+         ((= (cdr cmd) 2)
+          (push (car cmd) collector)
+          (dolist (x os)
+            (push (concat (car cmd) x) collector)))))
+       (apply #'TeX-add-symbols collector)))
+
+   ;; Fontification:
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("menu"            "[{")
+                               ("directory"       "[{")
+                               ("keys"            "[{")
+                               ("drawtikzfolder"  "[["))
+                             'textual)
+     (font-latex-add-keywords '(("newmenustylesimple"       "*{[{[[{")
+                               ("newmenustyle"             "*{[{[{{{[{")
+                               ("copymenustyle"            "{{")
+                               ("changemenuelement"        "*{{{")
+                               ("renewmenustylesimple"     "{[{[[{")
+                               ("providemenustylesimple"   "{[{[[{")
+                               ("providemenustyle"         "{[{[{{{[{")
+                               ("renewmenustyle"           "{[{[{{{[{")
+                               ("newmenucolortheme"        "{{{{{[[[")
+                               ("copymenucolortheme"       "{{")
+                               ("changemenucolor"          "{{{{")
+                               ("renewmenucolortheme"      "{{{{{[[[")
+                               ("newmenumacro"             "|{\\[{")
+                               ("providemenumacro"         "|{\\[{")
+                               ("renewmenumacro"           "|{\\[{"))
+                             'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-menukeys-package-options-list
+  '(("definemenumacros" ("true" "false"))
+    ("definekeys"       ("true" "false"))
+    ("mackeys"          ("text" "symbols"))
+    ("os"               ("mac"  "win")))
+  "Package options for menukeys package.")
+
+(defun LaTeX-menukeys-package-options ()
+  "Prompt for package options for the menukeys package."
+  (TeX-read-key-val t LaTeX-menukeys-package-options-list))
+
+;;; menukeys.el ends here

commit d0e8c1c20059fea85f2b2ee38cc222edda524898
Author: Arash Esbati <address@hidden>
Date:   Thu Sep 1 13:41:37 2016 +0200

    Add new style/paracol.el
    
    * Makefile.in (STYLESRC): Add new style.
    
    * style/paracol.el: New file.

diff --git a/Makefile.in b/Makefile.in
index d79de6e..1a8e5d2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -156,7 +156,7 @@ STYLESRC = style/prosper.el \
           style/hologo.el    style/theorem.el   style/ntheorem.el \
           style/splitidx.el  style/tikz.el      style/xcolor.el \
           style/pdflscape.el style/commath.el   style/empheq.el \
-          style/framed.el
+          style/framed.el    style/paracol.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/paracol.el b/style/paracol.el
new file mode 100644
index 0000000..7dfddc7
--- /dev/null
+++ b/style/paracol.el
@@ -0,0 +1,274 @@
+;;; paracol.el --- AUCTeX style for `paracol.sty' (v1.32)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash.esbati'at'gmail.com>
+;; Maintainer: address@hidden
+;; Created: 2016-05-26
+;; Keywords: tex
+
+;; 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 `paracol.sty' (v1.32) from 2015/10/10.
+;; `paracol.sty' is part of TeXLive.
+
+;; `paracol.sty' provides an environment (paracol) and a command
+;; (\switchcolumn) which take a star as the second (!) optional
+;; argument.  In order to make the input process easier for the users,
+;; this style provides the environment `paracol*' and the command
+;; `switchcolumn*' in the list of completion after entering C-c C-e or
+;; C-c C-m (or C-c RET).
+
+;; Further, `\switchcolumn' takes a third optional argument containing
+;; text which will be inserted spanned over the columns.  This style
+;; does not ask for this argument.  If you need it, just enter it by
+;; hand after the completion.  This is a deliberate decision since I
+;; think that over the time, the annoyance factor of hitting `RET'
+;; will be larger than the number of times where this argument is
+;; actually used.
+
+;;; Code:
+
+(defun TeX-arg-paracol-switchcolumn* (optional)
+  "Query and insert the column argument of \\switchcolum macro.
+If OPTIONAL is non-nil, insert the result in square brackets."
+  (let ((col (TeX-read-string
+             (TeX-argument-prompt optional nil "Column"))))
+    (save-excursion
+      (backward-char 1)
+      (TeX-argument-insert col optional))))
+
+(TeX-add-style-hook
+ "paracol"
+ (lambda ()
+
+   (LaTeX-add-environments
+    ;; 7.1 Environment paracol
+    ;; \begin{paracol}[numleft]{num}[text] body \end{paracol}
+    ;; \begin{paracol}[numleft]*{num}[text] body \end{paracol}
+    '("paracol" [ "Number left" ] "Number of columns" [ "Text across columns" 
] )
+    '("paracol*"
+      (lambda (_env)
+       (let ((numleft (TeX-read-string
+                       (TeX-argument-prompt  t  nil "Number left")))
+             (numcol  (TeX-read-string
+                       (TeX-argument-prompt nil nil "Number of columns")))
+             (txt     (TeX-read-string
+                       (TeX-argument-prompt  t  nil "Text across columns"))))
+         (LaTeX-insert-environment
+          ;; Simply feed the function with "paracol", other option is
+          ;; something like:
+          ;; (replace-regexp-in-string (regexp-quote "*") "" env)
+          "paracol"
+          (concat
+           (when (and numleft (not (string= numleft "")))
+             (format "[%s]" numleft))
+           "*"
+           (format "{%s}" numcol)
+           (when (and txt (not (string= txt "")))
+             (format "[%s]" txt)))))))
+
+    ;; 7.2 Column-Switching Command and Environments
+    ;; \begin{column} body \end{column}
+    ;; \begin{column*}[text] body \end{column*}
+    '("column")
+    '("column*" [ "Text across columns" ] )
+
+    ;; \begin{nthcolumn}{col} body \end{nthcolumn}
+    ;; \begin{nthcolumn*}{col}[text] body \end{nthcolumn*}
+    '("nthcolumn" "Column")
+    '("nthcolumn*" "Column" [ "Text across columns" ] )
+
+    ;; \begin{leftcolumn} body \end{leftcolumn}
+    ;; \begin{leftcolumn*}[text] body \end{leftcolumn*}
+    ;; \begin{rightcolumn} body \end{rightcolumn}
+    ;; \begin{rightcolumn*}[text] body \end{rightcolumn*}
+    '("leftcolumn")
+    '("leftcolumn*" [ "Text across columns" ] )
+    '("rightcolumn")
+    '("rightcolumn*" [ "Text across columns" ] ))
+
+   (TeX-add-symbols
+    ;; 7.2 Column-Switching Command and Environments
+    ;; \switchcolumn[col]
+    ;; \switchcolumn[col]*[text]
+    '("switchcolumn" [ "Column" ] )
+    '("switchcolumn*" [ TeX-arg-paracol-switchcolumn* ] )
+    '("thecolumn")
+    '("ensurevspace" TeX-arg-length)
+
+    ;; 7.3 Commands for Column and Gap Width
+    ;; \columnratio{r0, r1, ... , rk}[r0', r1', ... , rk']
+    '("columnratio" "Fraction(s)" [ "Fraction(s)" ] )
+
+    ;; \setcolumnwidth{s0, s1, ... , sk}[s0', s1', ... , sk']
+    ;; with s as width/gap
+    '("setcolumnwidth" "Width/Gap" [ "Width/Gap" ] )
+
+    ;; 7.4 Commands for Two-Sided Typesetting and Marginal Note Placement
+    ;; \twosided[t1t2 ... tk]
+    '("twosided" "Features (combination of p, c, m, b)")
+
+    ;; \marginparthreshold{k}[k']
+    '("marginparthreshold" "Number of columns" [ "Number of columns" ] )
+
+    ;; 7.5 Commands for Counters
+    ;; \globalcounter{ctr}
+    ;; \globalcounter*
+    '("globalcounter" TeX-arg-counter)
+    '("globalcounter*")
+
+    ;; \localcounter{ctr}
+    '("localcounter" TeX-arg-counter)
+
+    ;; \definethecounter{ctr}{col}{rep}
+    '("definethecounter" TeX-arg-counter "Column" t)
+
+    ;; \synccounter{ctr}
+    '("synccounter" TeX-arg-counter)
+    '("syncallcounters")
+
+    ;; 7.6 Page-Wise Footnotes
+    '("footnotelayout"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Layout")
+                   '("c" "m" "p")))
+
+    ;; \footnote*[num]{text}
+    ;; \footnotemark*[num]
+    ;; \footnotetext*[num]{text}
+    ;; Copied from `latex.el'
+    '("footnote*"
+      (TeX-arg-conditional TeX-arg-footnote-number-p ([ "Number" ]) nil)
+      t)
+    '("footnotetext*"
+      (TeX-arg-conditional TeX-arg-footnote-number-p ([ "Number" ]) nil)
+      t)
+    '("footnotemark*"
+      (TeX-arg-conditional TeX-arg-footnote-number-p ([ "Number" ]) nil))
+
+    '("fncounteradjustment" 0)
+    '("nofncounteradjustment" 0)
+
+    ;; 7.7 Commands for Coloring Texts and Column-Separating Rules
+    ;; \columncolor[mode]{color}[col]
+    ;;
+    ;; This clashes if colortbl.el is loaded since it provides a
+    ;; command with the same name but different arguments.  We add
+    ;; the command only here but not for fontification
+    '("columncolor" (TeX-arg-conditional (member "xcolor" (TeX-style-list))
+                                        (TeX-arg-xcolor)
+                                      (TeX-arg-color))
+      [ "Column" ] )
+
+    ;; \normalcolumncolor[col]
+    '("normalcolumncolor" [ "Column" ] )
+    '("coloredwordhyphenated" 0)
+    '("nocoloredwordhyphenated" 0)
+
+    ;; \colseprulecolor[mode]{color}[col]
+    ;; \normalcolseprulecolor[col]
+    '("colseprulecolor" (TeX-arg-conditional (member "xcolor" (TeX-style-list))
+                                            (TeX-arg-xcolor)
+                                          (TeX-arg-color))
+      [ "Column" ] )
+    '("normalcolseprulecolor" [ "Column" ] )
+
+    ;; 7.8 Commands for Background Painting
+    ;; \backgroundcolor{region}[mode]{color}
+    ;; \backgroundcolor{region(x0,y0)}[mode]{color}
+    ;; \backgroundcolor{region(x0,y0)(x1,y1)}[mode]{color}
+    '("backgroundcolor"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Region")
+                   '("c" "g" "s" "f" "n" "p" "t" "b" "l" "r"
+                     "C" "G" "S" "F" "N" "P" "T" "B" "L" "R"))
+      (TeX-arg-conditional (member "xcolor" (TeX-style-list))
+                          (TeX-arg-xcolor)
+                        (TeX-arg-color)))
+
+    ;; \nobackgroundcolor{region}
+    '("nobackgroundcolor"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Region")
+                   '("c" "g" "s" "f" "n" "p" "t" "b" "l" "r"
+                     "C" "G" "S" "F" "N" "P" "T" "B" "L" "R")))
+
+    ;; \resetbackgroundcolor
+    '("resetbackgroundcolor" 0)
+
+    ;; 7.9 Control of Contents Output
+    ;; \addcontentsonly{file}{col}
+    '("addcontentsonly"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Content file")
+                   '("toc" "lof" "lot")))
+
+    '("flushpage" 0))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+                             ;; FIXME: Syntax is \switchcolumn[num]*[text].
+                             ;; font-latex.el doesn't handle the case
+                             ;; where `*' comes after the first `['.
+                             ;; Therefore, we use this compromise to
+                             ;; get something fontified at least.
+     (font-latex-add-keywords '(("switchcolumn"                        "*["))
+                             'textual)
+     (font-latex-add-keywords '(("flushpage"                   "*["))
+                             'warning)
+     (font-latex-add-keywords '(("footnote"                    "*[{")
+                               ("footnotemark"                 "*[")
+                               ("footnotetext"                 "*[{"))
+                             'reference)
+     (font-latex-add-keywords '(("ensurevspace"                        "{")
+                               ("columnratio"                  "{[")
+                               ("setcolumnwidth"               "{[")
+                               ("twosided"                     "[")
+                               ("marginparthreshold"           "{[")
+                               ;; FIXME: Syntax is
+                               ;; \globalcounter{ctr} or
+                               ;; \globalcounter* We ignore `{' since
+                               ;; font-latex.el doesn't handle a
+                               ;; missing bracket nicely.
+                               ("globalcounter"                "*")
+                               ("definethecounter"             "{{{")
+                               ("synccounter"                  "{")
+                               ("syncallcounters"              "")
+                               ("footnotelayout"               "{")
+                               ("fncounteradjustment"          "")
+                               ("nofncounteradjustment"        "")
+                               ("normalcolumncolor"            "[")
+                               ("coloredwordhyphenated"        "")
+                               ("nocoloredwordhyphenated"      "")
+                               ("colseprulecolor"              "[{[")
+                               ("normalcolseprulecolor"        "[")
+                               ("backgroundcolor"              "{[{")
+                               ("nobackgroundcolor"            "{")
+                               ("resetbackgroundcolor"         "")
+                               ("addcontentsonly"              "{{"))
+                             'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-paracol-package-options nil
+  "Package options for the paracol package.")
+
+;;; paracol.el ends here

commit 25bdcb2846c78f9f28510c7e6c1ae1a7d46df79b
Author: Arash Esbati <address@hidden>
Date:   Thu Sep 1 13:17:19 2016 +0200

    Add new style/framed.el
    
    * Makefile.in (STYLESRC): Add new style.
    
    * style/framed.el: New file.

diff --git a/Makefile.in b/Makefile.in
index a745410..d79de6e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -155,7 +155,8 @@ STYLESRC = style/prosper.el \
           style/newfloat.el  style/subcaption.el style/AlegreyaSans.el \
           style/hologo.el    style/theorem.el   style/ntheorem.el \
           style/splitidx.el  style/tikz.el      style/xcolor.el \
-          style/pdflscape.el style/commath.el   style/empheq.el
+          style/pdflscape.el style/commath.el   style/empheq.el \
+          style/framed.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/framed.el b/style/framed.el
new file mode 100644
index 0000000..44a69c5
--- /dev/null
+++ b/style/framed.el
@@ -0,0 +1,52 @@
+;;; framed.el --- AUCTeX style for `framed.sty' (v0.96)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash.esbati'at'gmail.com>
+;; Maintainer: address@hidden
+;; Created: 2016-06-26
+;; Keywords: tex
+
+;; 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 `framed.sty' (v0.96) from 2011/10/22.
+;; `framed.sty' is part of TeXLive.
+
+;;; Code:
+
+(TeX-add-style-hook
+ "framed"
+ (lambda ()
+   ;; env's defined by framed.sty
+   (LaTeX-add-environments
+    '("framed")
+    '("oframed")
+    '("shaded")
+    '("shaded*")
+    '("snugshade")
+    '("snugshade*")
+    '("leftbar")
+    '("titled-frame" "Title")))
+ LaTeX-dialect)
+
+(defvar LaTeX-framed-package-options nil
+  "Package options for the framed package.")
+
+;;; framed.el ends here

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

Summary of changes:
 Makefile.in                       |    3 +-
 style/{pdflscape.el => framed.el} |   28 +-
 style/menukeys.el                 |  539 +++++++++++++++++++++++++++++++++++++
 style/paracol.el                  |  274 +++++++++++++++++++
 4 files changed, 833 insertions(+), 11 deletions(-)
 copy style/{pdflscape.el => framed.el} (65%)
 create mode 100644 style/menukeys.el
 create mode 100644 style/paracol.el


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

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