Hi,
I am trying to write a style file for `enumitem.sty' where you can have key-val
in opt. arguments of environments. My borrowed approach from `paralist.el' was:
====================================
(defvar LaTeX-enumitem-key-val-options
'(;;
("topsep")
("partopsep")
("label")
("label*")
("align" ("left" "right" "parleft")))
"Key=value options for enumitem macros and environments.")
(defun LaTeX-enumitem-env-item-opt-label (env)
"Insert ENV, an optional label and the first item."
(LaTeX-insert-environment
env
(let ((label (TeX-arg-key-val LaTeX-enumitem-key-val-options)))
(concat (unless (zerop (length label))
(format "[%s]" label)))))
(LaTeX-find-matching-begin)
(end-of-line 1)
(delete-char 1)
(delete-horizontal-space)
(LaTeX-insert-item))
(TeX-add-style-hook
"enumitem"
(lambda ()
;; New environments
(LaTeX-add-environments
'("itemize" LaTeX-enumitem-env-item-opt-label)
'("enumerate" LaTeX-enumitem-env-item-opt-label)
'("itemize*" LaTeX-enumitem-env-item-opt-label)
'("enumerate*" LaTeX-enumitem-env-item-opt-label))))
====================================
emacs ist not happy and exits with:
let: Wrong number of arguments: #[(optional key-val-alist) ...
Any idea what is going wrong here? TIA.
(My lisp knowledge is very limited, so please bear with me.)
_______________________________________________
auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex