auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Defining env with key-val in opt. argument


From: Tassilo Horn
Subject: Re: [AUCTeX] Defining env with key-val in opt. argument
Date: Sat, 04 Oct 2014 20:46:18 +0200
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

"Arash Esbati" <address@hidden> writes:

Hi Arash,

> emacs ist not happy and exits with:
>
> let: Wrong number of arguments: #[(optional key-val-alist) ...
>
> Any idea what is going wrong here?  TIA.

`TeX-arg-key-val' has two mandatory arguments and you've omitted the
first.  But that function inserts the arguments it prompts for (i.e., it
doesn't return them as a string), so your code wouldn't work also for
that reason.

--8<---------------cut here---------------start------------->8---
(defvar LaTeX-enumitem-key-val-options
  '(;;
    ("topsep")
    ("partopsep")
    ("label")
    ("label*")
    ("align" ("left" "right" "parleft")))
  "Key=value options for enumitem macros and environments.")

(TeX-add-style-hook
 "enumitem"
 (lambda ()
   ;; New environments
   (LaTeX-add-environments
    '("itemize" LaTeX-env-args [TeX-arg-key-val LaTeX-enumitem-key-val-options])
    '("enumerate" LaTeX-env-args [TeX-arg-key-val 
LaTeX-enumitem-key-val-options])
    '("itemize*" LaTeX-env-args [TeX-arg-key-val 
LaTeX-enumitem-key-val-options])
    '("enumerate*" LaTeX-env-args [TeX-arg-key-val 
LaTeX-enumitem-key-val-options]))))
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo




reply via email to

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