[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
main 67c8390f: Update support for minted package
From: |
Arash Esbati |
Subject: |
main 67c8390f: Update support for minted package |
Date: |
Tue, 8 Oct 2024 17:22:15 -0400 (EDT) |
branch: main
commit 67c8390f374f5e56ed08204173e0beefad4e1d1e
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>
Update support for minted package
* NEWS.org (Added): Announce the change.
* style/minted.el (LaTeX-minted-key-val-options): Update key=vals.
(LaTeX-minted-key-val-options): Add the "none" value for color keys.
(LaTeX-minted-auto-cleanup): Don't create a starred environment,
newly defined environments accept an optional argument for
key=vals.
(LaTeX-minted-package-options-list): Adjust package options.
* style/minted2.el: New file copied from style/minted.el
supporting the frozen minted package v2.9.
---
NEWS.org | 7 ++
style/minted.el | 102 ++++++++++++++----------
style/{minted.el => minted2.el} | 170 ++++++++++++++++++++--------------------
3 files changed, 152 insertions(+), 127 deletions(-)
diff --git a/NEWS.org b/NEWS.org
index 987c90d0..532cc546 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -7,6 +7,13 @@
# License: GNU General Public License 3
# The format is based on [[https://keepachangelog.com/en/1.1.0/][Keep a
Changelog]]
+* [Unreleased]
+
+** Added
+
+- Add new support file =style/minted2.el= (=style/minted.el= is updated
+ to package version v3.1.2).
+
* [14.0.7] - 2024-10-05
** Added
diff --git a/style/minted.el b/style/minted.el
index 0be5242a..22056717 100644
--- a/style/minted.el
+++ b/style/minted.el
@@ -1,4 +1,4 @@
-;;; minted.el --- AUCTeX style for `minted.sty' (v2.9) -*- lexical-binding:
t; -*-
+;;; minted.el --- AUCTeX style for `minted.sty' (v3.1.2) -*- lexical-binding:
t; -*-
;; Copyright (C) 2014--2024 Free Software Foundation, Inc.
@@ -24,7 +24,7 @@
;;; Commentary:
-;; This file adds support for `minted.sty' (v2.9) from 2023/12/18.
+;; This file adds support for `minted.sty' (v3.1.2) from 2024/10/07.
;;; Code:
@@ -51,32 +51,35 @@
'(("autogobble" ("true" "false"))
("baselinestretch" ("auto"))
("beameroverlays" ("true" "false"))
+ ("bgcolorpadding" ("none"))
+ ("bgcolorvphantom")
("breakafter")
("breakafterinrun" ("true" "false"))
- ("breakaftersymbolpre")
("breakaftersymbolpost")
+ ("breakaftersymbolpre")
("breakanywhere" ("true" "false"))
- ("breakanywheresymbolpre")
+ ("breakanywhereinlinestretch")
("breakanywheresymbolpost")
+ ("breakanywheresymbolpre")
("breakautoindent" ("true" "false"))
("breakbefore")
("breakbeforeinrun" ("true" "false"))
- ("breakbeforesymbolpre")
("breakbeforesymbolpost")
+ ("breakbeforesymbolpre")
("breakbytoken" ("true" "false"))
("breakbytokenanywhere" ("true" "false"))
("breakindent")
("breakindentnchars")
("breaklines" ("true" "false"))
("breaksymbol")
- ("breaksymbolleft")
- ("breaksymbolright")
("breaksymbolindent")
("breaksymbolindentnchars")
("breaksymbolindentleft")
("breaksymbolindentleftnchars")
("breaksymbolindentright")
- ("breaksymbolseprightnchars")
+ ("breaksymbolindentrightnchars")
+ ("breaksymbolleft")
+ ("breaksymbolright")
("breaksymbolsep")
("breaksymbolsepnchars")
("breaksymbolsepleft")
@@ -87,37 +90,50 @@
("codetagify")
("curlyquotes" ("true" "false"))
("encoding")
+ ("envname" ("Verbatim" "VerbEnv"))
("escapeinside")
("firstline")
("firstnumber" ("auto" "last" "integer"))
("fontfamily" ("tt" "courier" "helvetica"))
("fontseries" ("auto"))
+ ("fontshape" ("auto"))
("fontsize" ("auto" "\\tiny" "\\large" "\\scriptsize" "\\Large"
"\\footnotesize" "\\LARGE" "\\small" "\\huge"
"\\normalsize" "\\Huge"))
- ("fontshape" ("auto"))
("formatcom")
("frame" ("none" "leftline" "topline" "bottomline" "lines" "single"))
("framerule")
("framesep")
("funcnamehighlighting" ("true" "false"))
("gobble")
+ ("gobblefilter")
("highlightcolor")
("highlightlines")
("ignorelexererrors" ("true" "false"))
- ("keywordcase" ("lower" "upper" "capitalize"))
+ ("keywordcase" ("lower" "upper" "capitalize" "none"))
("label")
("labelposition" ("none" "topline" "bottomline" "all"))
("lastline")
("linenos" ("true" "false"))
- ("numberfirstline" ("true" "false"))
- ("numbers" ("left" "right" "both" "none"))
+ ("listparameters")
+ ("literalenvname")
+ ("literatecomment")
("mathescape" ("true" "false"))
("numberblanklines" ("true" "false"))
+ ("numberfirstline" ("true" "false"))
+ ("numbers" ("left" "right" "both" "none"))
("numbersep")
("obeytabs" ("true" "false"))
("outencoding")
("python3" ("true" "false"))
+ ("rangeregex")
+ ("rangeregexmatchnumber")
+ ("rangeregexdotall" ("true" "false"))
+ ("rangeregexmultiline" ("true" "false"))
+ ("rangestartafterstring")
+ ("rangestartstring")
+ ("rangestopbeforestring")
+ ("rangestopstring")
("resetmargins" ("true" "false"))
("rulecolor")
("samepage" ("true" "false"))
@@ -126,6 +142,11 @@
("space")
("spacecolor")
("startinline" ("true" "false"))
+ ("stepnumber")
+ ("stepnumberfromfirst")
+ ("stepnumberoffsetvalues" ("true" "false"))
+ ("stripall" ("true" "false"))
+ ("stripnl" ("true" "false"))
;; FIXME: It would be nice to use the function
;; `LaTeX-minted-style-list' here, but with a file local var like:
;; %%% TeX-command-extra-options: "-shell-escape"
@@ -145,11 +166,6 @@
"solarized-dark" "solarized-light" "staroffice"
"stata-dark" "stata-light" "tango" "trac"
"vim" "vs" "xcode" "zenburn"))
- ("stepnumber")
- ("stepnumberfromfirst")
- ("stepnumberoffsetvalues" ("true" "false"))
- ("stripall" ("true" "false"))
- ("stripnl" ("true" "false"))
("tab")
("tabcolor")
("tabsize")
@@ -169,7 +185,7 @@ prepends them to variable `LaTeX-minted-key-val-options'."
(let* ((colorcmd (if (member "xcolor" TeX-active-styles)
#'LaTeX-xcolor-definecolor-list
#'LaTeX-color-definecolor-list))
- (colors (mapcar #'car (funcall colorcmd)))
+ (colors (cons "none" (mapcar #'car (funcall colorcmd))))
(keys '("bgcolor" "highlightcolor"
"rulecolor" "spacecolor" "tabcolor"))
result)
@@ -243,22 +259,18 @@ Update the variable `LaTeX-minted-style-list' if still
nil."
"Process the parsed results from minted package."
(dolist (mint (LaTeX-minted-newmint-list))
(cond ((string= (nth 2 mint) "ed")
- ;; \newminted{lang}{opts} => new langcode and langcode* envs.
- ;; \newminted[envname]{lang}{opts} => new envname/envname* envs.
+ ;; \newminted{lang}{opts} => new langcode env.
+ ;; \newminted[envname]{lang}{opts} => new envname env.
(let* ((env (if (string-empty-p (car mint))
(concat (cadr mint) "code")
- (car mint)))
- (env* (concat env "*")))
- (LaTeX-add-environments (list env))
- (LaTeX-add-environments (list env* #'LaTeX-env-args
- '(TeX-arg-key-val
- (LaTeX-minted-key-val-options))))
+ (car mint))))
+ (LaTeX-add-environments
+ (list env
+ #'LaTeX-env-args
+ [TeX-arg-key-val (LaTeX-minted-key-val-options)]))
(add-to-list 'LaTeX-indent-environment-list
`(,env current-indentation) t)
- (add-to-list 'LaTeX-indent-environment-list
- `(,env* current-indentation) t)
- (add-to-list 'LaTeX-verbatim-environments-local env)
- (add-to-list 'LaTeX-verbatim-environments-local env*)))
+ (add-to-list 'LaTeX-verbatim-environments-local env)))
;; \newmintinline{foo}{opts} => \fooinline[key=vals]|code| or
;; \fooinline[key=vals]{code}
;; \newmintinline[macname]{foo}{opts} => \macname[key=vals]|code| or
@@ -355,8 +367,10 @@ a list of strings."
"minted"
(lambda ()
- ;; Run the relevant style hooks:
- (TeX-run-style-hooks "xcolor" "fvextra")
+ ;; Run the relevant style hooks and follow what minted.sty does:
+ (unless (member "color" (TeX-style-list))
+ (TeX-run-style-hooks "xcolor"))
+ (TeX-run-style-hooks "fvextra")
;; New symbols
(TeX-add-symbols
@@ -465,18 +479,20 @@ a list of strings."
,(when (member "fontenc" (TeX-style-list))
LaTeX-fontenc-package-options)))
'(("chapter")
- ("cache" ("true" "false"))
+ ("cache" ("true" "false"))
("cachedir")
- ("finalizecache" ("true" "false"))
- ("frozencache" ("true" "false"))
- ("draft" ("true" "false"))
- ("final" ("true" "false"))
- ("inputlanglinenos" ("true" "false"))
- ("kpsewhich" ("true" "false"))
- ("langlinenos" ("true" "false"))
- ("newfloat" ("true" "false"))
- ("outputdir")
- ("section"))))
+ ("debug" ("true" "false"))
+ ("frozencache" ("true" "false"))
+ ("highlightmode" ("fastfirst" "fast" "immediate"))
+ ;; The next 2 are now deprecated and may disappear sometimes:
+ ("inputlanglinenos" ("true" "false"))
+ ("langlinenos" ("true" "false"))
+ ("inputlexerlinenos" ("true" "false"))
+ ("lexerlinenos" ("true" "false"))
+ ("newfloat" ("true" "false"))
+ ("placeholder" ("true" "false"))
+ ("section")
+ ("verbatim" ("true" "false")))))
(defun LaTeX-minted-package-options ()
"Prompt for package options for the minted package."
diff --git a/style/minted.el b/style/minted2.el
similarity index 76%
copy from style/minted.el
copy to style/minted2.el
index 0be5242a..687b195c 100644
--- a/style/minted.el
+++ b/style/minted2.el
@@ -1,4 +1,4 @@
-;;; minted.el --- AUCTeX style for `minted.sty' (v2.9) -*- lexical-binding:
t; -*-
+;;; minted2.el --- AUCTeX style for `minted2.sty' (v2.9) -*- lexical-binding:
t; -*-
;; Copyright (C) 2014--2024 Free Software Foundation, Inc.
@@ -24,7 +24,7 @@
;;; Commentary:
-;; This file adds support for `minted.sty' (v2.9) from 2023/12/18.
+;; This file adds support for `minted2.sty' (v2.9) from 2024/05/09.
;;; Code:
@@ -47,7 +47,7 @@
(defvar font-latex-syntactic-keywords-extra)
(defvar LaTeX-fontenc-package-options)
-(defvar LaTeX-minted-key-val-options
+(defvar LaTeX-minted2-key-val-options
'(("autogobble" ("true" "false"))
("baselinestretch" ("auto"))
("beameroverlays" ("true" "false"))
@@ -127,7 +127,7 @@
("spacecolor")
("startinline" ("true" "false"))
;; FIXME: It would be nice to use the function
- ;; `LaTeX-minted-style-list' here, but with a file local var like:
+ ;; `LaTeX-minted2-style-list' here, but with a file local var like:
;; %%% TeX-command-extra-options: "-shell-escape"
;; in a .tex file, Emacs asks to apply a variable which is not
;; safe and does not restore the window; the splitted frame
@@ -157,12 +157,12 @@
("texcomments" ("true" "false"))
("xleftmargin")
("xrightmargin"))
- "Key=value options for minted macros and environments.")
+ "Key=value options for minted2 macros and environments.")
-(defun LaTeX-minted-key-val-options ()
- "Return an updated list of key=vals from minted package.
+(defun LaTeX-minted2-key-val-options ()
+ "Return an updated list of key=vals from minted2 package.
This function retrieves values of (user) defined colors and
-prepends them to variable `LaTeX-minted-key-val-options'."
+prepends them to variable `LaTeX-minted2-key-val-options'."
(append
(when (or (member "xcolor" (TeX-style-list))
(member "color" TeX-active-styles))
@@ -175,73 +175,73 @@ prepends them to variable `LaTeX-minted-key-val-options'."
result)
(dolist (key keys result)
(push (list key colors) result))))
- LaTeX-minted-key-val-options))
+ LaTeX-minted2-key-val-options))
-(defvar LaTeX-minted-pygmentize-program (executable-find "pygmentize")
+(defvar LaTeX-minted2-pygmentize-program (executable-find "pygmentize")
"Absolute file name to pygmentize program.")
-(defvar LaTeX-minted-language-list nil
+(defvar LaTeX-minted2-language-list nil
"List containing languages provided by pymentize program.
Initialized once at the first prompt for a Pygments language.
May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
;; Add the variable to `TeX-normal-mode-reset-list':
-(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-minted-language-list)
+(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-minted2-language-list)
-(defun LaTeX-minted-language-list (&rest _ignored)
+(defun LaTeX-minted2-language-list (&rest _ignored)
"Return a list of languages provided by pymentize program.
-Update the variable `LaTeX-minted-language-list' if still nil."
- (or LaTeX-minted-language-list
- (when LaTeX-minted-pygmentize-program
+Update the variable `LaTeX-minted2-language-list' if still nil."
+ (or LaTeX-minted2-language-list
+ (when LaTeX-minted2-pygmentize-program
(with-temp-buffer
- (shell-command (concat LaTeX-minted-pygmentize-program " -L lexers")
+ (shell-command (concat LaTeX-minted2-pygmentize-program " -L lexers")
(current-buffer))
(goto-char (point-min))
(let (languages)
(while (re-search-forward "^\\*[[:space:]]\\([^:]+\\):" nil t)
(dolist (lang (split-string (match-string 1) "[[:space:],]" t))
(push lang languages)))
- (setq LaTeX-minted-language-list languages))
- LaTeX-minted-language-list))))
+ (setq LaTeX-minted2-language-list languages))
+ LaTeX-minted2-language-list))))
-(defvar LaTeX-minted-style-list nil
+(defvar LaTeX-minted2-style-list nil
"List containing styles provided by pymentize program.
Initialized once at the first prompt for a Pygments style.
May be reset with `\\[universal-argument] \\[TeX-normal-mode]'.")
;; Add the variable to `TeX-normal-mode-reset-list':
-(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-minted-style-list)
+(add-to-list 'TeX-normal-mode-reset-list 'LaTeX-minted2-style-list)
-(defun LaTeX-minted-style-list (&rest _ignored)
+(defun LaTeX-minted2-style-list (&rest _ignored)
"Return a list of styles provided by pymentize program.
-Update the variable `LaTeX-minted-style-list' if still nil."
- (or LaTeX-minted-style-list
- (when LaTeX-minted-pygmentize-program
+Update the variable `LaTeX-minted2-style-list' if still nil."
+ (or LaTeX-minted2-style-list
+ (when LaTeX-minted2-pygmentize-program
(with-temp-buffer
- (shell-command (concat LaTeX-minted-pygmentize-program " -L styles")
+ (shell-command (concat LaTeX-minted2-pygmentize-program " -L styles")
(current-buffer))
(goto-char (point-min))
(let (styles)
(while (re-search-forward "^\\*[[:space:]]\\([^:]+\\):" nil t)
(dolist (style (split-string (match-string 1) "[[:space:],]" t))
(push style styles)))
- (setq LaTeX-minted-style-list styles))
- LaTeX-minted-style-list))))
+ (setq LaTeX-minted2-style-list styles))
+ LaTeX-minted2-style-list))))
-(TeX-auto-add-type "minted-newmint" "LaTeX")
+(TeX-auto-add-type "minted2-newmint" "LaTeX")
-(defvar LaTeX-minted-newmint-regexp
+(defvar LaTeX-minted2-newmint-regexp
'("\\\\newmint\\(edfile\\|inline\\|ed\\)?\\(?:\\[\\([^]]+\\)\\]\\)?{\\([^}]+\\)}"
- (2 3 1) LaTeX-auto-minted-newmint)
- "Match the arguments of \\newmint* macros from minted package.")
+ (2 3 1) LaTeX-auto-minted2-newmint)
+ "Match the arguments of \\newmint* macros from minted2 package.")
-(defun LaTeX-minted-auto-prepare ()
- "Reset `LaTeX-auto-minted-newmint' before parsing."
- (setq LaTeX-auto-minted-newmint nil))
+(defun LaTeX-minted2-auto-prepare ()
+ "Reset `LaTeX-auto-minted2-newmint' before parsing."
+ (setq LaTeX-auto-minted2-newmint nil))
-(defun LaTeX-minted-auto-cleanup ()
- "Process the parsed results from minted package."
- (dolist (mint (LaTeX-minted-newmint-list))
+(defun LaTeX-minted2-auto-cleanup ()
+ "Process the parsed results from minted2 package."
+ (dolist (mint (LaTeX-minted2-newmint-list))
(cond ((string= (nth 2 mint) "ed")
;; \newminted{lang}{opts} => new langcode and langcode* envs.
;; \newminted[envname]{lang}{opts} => new envname/envname* envs.
@@ -252,7 +252,7 @@ Update the variable `LaTeX-minted-style-list' if still nil."
(LaTeX-add-environments (list env))
(LaTeX-add-environments (list env* #'LaTeX-env-args
'(TeX-arg-key-val
- (LaTeX-minted-key-val-options))))
+ (LaTeX-minted2-key-val-options))))
(add-to-list 'LaTeX-indent-environment-list
`(,env current-indentation) t)
(add-to-list 'LaTeX-indent-environment-list
@@ -268,7 +268,7 @@ Update the variable `LaTeX-minted-style-list' if still nil."
(concat (cadr mint) "inline")
(car mint))))
(TeX-add-symbols `(,lang
- [TeX-arg-key-val
(LaTeX-minted-key-val-options)]
+ [TeX-arg-key-val
(LaTeX-minted2-key-val-options)]
TeX-arg-verb-delim-or-brace))
(add-to-list 'LaTeX-verbatim-macros-with-delims-local lang)
(add-to-list 'LaTeX-verbatim-macros-with-braces-local lang)
@@ -282,7 +282,7 @@ Update the variable `LaTeX-minted-style-list' if still nil."
(concat (cadr mint) "file")
(car mint))))
(TeX-add-symbols `(,lang
- [TeX-arg-key-val
(LaTeX-minted-key-val-options)]
+ [TeX-arg-key-val
(LaTeX-minted2-key-val-options)]
TeX-arg-file))))
;; \newmint{foo}{opts} => \foo[key=vals]|code| or
;; \foo[key=vals]{code}
@@ -293,7 +293,7 @@ Update the variable `LaTeX-minted-style-list' if still nil."
(cadr mint)
(car mint))))
(TeX-add-symbols `(,lang
- [TeX-arg-key-val
(LaTeX-minted-key-val-options)]
+ [TeX-arg-key-val
(LaTeX-minted2-key-val-options)]
TeX-arg-verb-delim-or-brace))
(add-to-list 'LaTeX-verbatim-macros-with-delims-local lang)
(add-to-list 'LaTeX-verbatim-macros-with-braces-local lang)
@@ -302,16 +302,16 @@ Update the variable `LaTeX-minted-style-list' if still
nil."
(font-latex-add-keywords `((,lang "[")) 'textual))))))
;; Refresh font-locking so that the verbatim envs take effect only
;; when there are defined shortcuts:
- (when (and (LaTeX-minted-newmint-list)
+ (when (and (LaTeX-minted2-newmint-list)
(fboundp 'font-latex-set-syntactic-keywords)
(eq TeX-install-font-lock 'font-latex-setup))
(font-latex-set-syntactic-keywords)))
-(add-hook 'TeX-auto-prepare-hook #'LaTeX-minted-auto-prepare t)
-(add-hook 'TeX-auto-cleanup-hook #'LaTeX-minted-auto-cleanup t)
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-minted2-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-minted2-auto-cleanup t)
(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
-(defun LaTeX-minted-add-syntactic-keywords-extra (type macro)
+(defun LaTeX-minted2-add-syntactic-keywords-extra (type macro)
"Add TYPE of MACRO to `font-latex-syntactic-keywords-extra'.
TYPE is one of the symbols `brace' or `delim' indicating how
verbatim text is enclosed after the macro. MACRO is a string or
@@ -352,62 +352,64 @@ a list of strings."
(add-to-list 'font-latex-syntactic-keywords-extra (append regexp syntax))))
(TeX-add-style-hook
- "minted"
+ "minted2"
(lambda ()
- ;; Run the relevant style hooks:
- (TeX-run-style-hooks "xcolor" "fvextra")
+ ;; Run the relevant style hooks and follow what minted2.sty does:
+ (unless (member "color" (TeX-style-list))
+ (TeX-run-style-hooks "xcolor"))
+ (TeX-run-style-hooks "fvextra")
;; New symbols
(TeX-add-symbols
'("mint"
- [TeX-arg-key-val (LaTeX-minted-key-val-options)]
- (TeX-arg-completing-read (LaTeX-minted-language-list) "Language")
+ [TeX-arg-key-val (LaTeX-minted2-key-val-options)]
+ (TeX-arg-completing-read (LaTeX-minted2-language-list) "Language")
TeX-arg-verb-delim-or-brace)
'("mintinline"
- [TeX-arg-key-val (LaTeX-minted-key-val-options)]
- (TeX-arg-completing-read (LaTeX-minted-language-list) "Language")
+ [TeX-arg-key-val (LaTeX-minted2-key-val-options)]
+ (TeX-arg-completing-read (LaTeX-minted2-language-list) "Language")
TeX-arg-verb-delim-or-brace)
'("newminted" ["Environment Name"]
- (TeX-arg-completing-read (LaTeX-minted-language-list) "Language")
- (TeX-arg-key-val (LaTeX-minted-key-val-options)))
+ (TeX-arg-completing-read (LaTeX-minted2-language-list) "Language")
+ (TeX-arg-key-val (LaTeX-minted2-key-val-options)))
'("newmint" ["Macro Name"]
- (TeX-arg-completing-read (LaTeX-minted-language-list) "Language")
- (TeX-arg-key-val (LaTeX-minted-key-val-options)))
+ (TeX-arg-completing-read (LaTeX-minted2-language-list) "Language")
+ (TeX-arg-key-val (LaTeX-minted2-key-val-options)))
'("newmintinline" ["Macro Name"]
- (TeX-arg-completing-read (LaTeX-minted-language-list) "Language")
- (TeX-arg-key-val (LaTeX-minted-key-val-options)))
+ (TeX-arg-completing-read (LaTeX-minted2-language-list) "Language")
+ (TeX-arg-key-val (LaTeX-minted2-key-val-options)))
'("newmintedfile" ["Macro Name"]
- (TeX-arg-completing-read (LaTeX-minted-language-list) "Language")
- (TeX-arg-key-val (LaTeX-minted-key-val-options)))
+ (TeX-arg-completing-read (LaTeX-minted2-language-list) "Language")
+ (TeX-arg-key-val (LaTeX-minted2-key-val-options)))
;; 3.3 Formatting source code
'("inputminted"
- [TeX-arg-key-val (LaTeX-minted-key-val-options)]
- (TeX-arg-completing-read (LaTeX-minted-language-list) "Language")
+ [TeX-arg-key-val (LaTeX-minted2-key-val-options)]
+ (TeX-arg-completing-read (LaTeX-minted2-language-list) "Language")
TeX-arg-file)
;; 3.4 Using different styles
'("usemintedstyle"
- [TeX-arg-completing-read (LaTeX-minted-language-list) "Language"]
- (TeX-arg-completing-read (LaTeX-minted-style-list) "Style"))
+ [TeX-arg-completing-read (LaTeX-minted2-language-list) "Language"]
+ (TeX-arg-completing-read (LaTeX-minted2-style-list) "Style"))
;; 5.2 Macro option usage
'("setminted"
- [TeX-arg-completing-read (LaTeX-minted-language-list) "Language"]
- (TeX-arg-key-val (LaTeX-minted-key-val-options)))
+ [TeX-arg-completing-read (LaTeX-minted2-language-list) "Language"]
+ (TeX-arg-key-val (LaTeX-minted2-key-val-options)))
'("setmintedinline"
- [TeX-arg-completing-read (LaTeX-minted-language-list) "Language"]
- (TeX-arg-key-val (LaTeX-minted-key-val-options))))
+ [TeX-arg-completing-read (LaTeX-minted2-language-list) "Language"]
+ (TeX-arg-key-val (LaTeX-minted2-key-val-options))))
;; New environments
(LaTeX-add-environments
'("minted" LaTeX-env-args
- [TeX-arg-key-val (LaTeX-minted-key-val-options)]
- (TeX-arg-completing-read (LaTeX-minted-language-list) "Language")))
+ [TeX-arg-key-val (LaTeX-minted2-key-val-options)]
+ (TeX-arg-completing-read (LaTeX-minted2-language-list) "Language")))
;; 4 Floating listings: If option "newfloat" is given, run the
;; style hook and use the interface provided by the style,
;; otherwise add "listing" manually
- (if (or (LaTeX-provided-package-options-member "minted" "newfloat")
- (LaTeX-provided-package-options-member "minted" "newfloat=true"))
+ (if (or (LaTeX-provided-package-options-member "minted2" "newfloat")
+ (LaTeX-provided-package-options-member "minted2" "newfloat=true"))
(progn
(TeX-run-style-hooks "newfloat")
(LaTeX-add-newfloat-DeclareFloatingEnvironments
@@ -424,7 +426,7 @@ a list of strings."
'(("listing" ?l "lst:" "~\\ref{%s}" caption nil nil)))))
;; Add to the auto parser
- (TeX-auto-add-regexp LaTeX-minted-newmint-regexp)
+ (TeX-auto-add-regexp LaTeX-minted2-newmint-regexp)
;; Filling
(add-to-list (make-local-variable 'LaTeX-indent-environment-list)
@@ -450,16 +452,16 @@ a list of strings."
;; `font-latex-syntactic-keywords-extra' and cater for their
;; special syntax: \mint[optional]{lang}{verbatim} or
;; \mint[optional]{lang}|verbatim|
- (LaTeX-minted-add-syntactic-keywords-extra 'brace
- '("mint" "mintinline"))
- (LaTeX-minted-add-syntactic-keywords-extra 'delim
- '("mint" "mintinline"))
+ (LaTeX-minted2-add-syntactic-keywords-extra 'brace
+ '("mint" "mintinline"))
+ (LaTeX-minted2-add-syntactic-keywords-extra 'delim
+ '("mint" "mintinline"))
;; Tell font-lock about the update.
(font-latex-set-syntactic-keywords)))
TeX-dialect)
-(defun LaTeX-minted-package-options-list ()
- "Return an alist of package options for minted package."
+(defun LaTeX-minted2-package-options-list ()
+ "Return an alist of package options for minted2 package."
(append
`(("fontencoding"
,(when (member "fontenc" (TeX-style-list))
@@ -478,8 +480,8 @@ a list of strings."
("outputdir")
("section"))))
-(defun LaTeX-minted-package-options ()
- "Prompt for package options for the minted package."
- (TeX-read-key-val t (LaTeX-minted-package-options-list)))
+(defun LaTeX-minted2-package-options ()
+ "Prompt for package options for the minted2 package."
+ (TeX-read-key-val t (LaTeX-minted2-package-options-list)))
-;;; minted.el ends here
+;;; minted2.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- main 67c8390f: Update support for minted package,
Arash Esbati <=