Hi Tassilo,

Tassilo Horn <[email protected]> writes:

> Mosè Giordano <[email protected]> writes:
>
>> `pushnew' can't append to variables, but my understanding is that it's
>> safer than `add-to-list' when it comes to let-bound variables (can
>> someone please confirm this?),
>
> Yes, `add-to-list' should not be used on locals:

So I should update the following function in `enumitem.el' and replace
`add-to-list' with `pushnew'?

--8<---------------cut here---------------start------------->8---
(defun LaTeX-arg-SetEnumitemKey (optional &optional prompt)
  "Ask for a new key to be defined and add it to
`LaTeX-enumitem-key-val-options-local'."
  (LaTeX-enumitem-update-key-val-options)
  (let ((key     (TeX-read-string "New Key: "))
        (replace (TeX-read-key-val optional
                                   LaTeX-enumitem-key-val-options-local 
"Replacement")))
    (TeX-argument-insert key     optional)
    (TeX-argument-insert replace optional)
    (add-to-list 'LaTeX-enumitem-key-val-options-local (list key))
    (LaTeX-add-enumitem-SetEnumitemKeys key)))
--8<---------------cut here---------------end--------------->8---

Well, I should do it anyways and remove the unused prompt argument.

Best, Arash


_______________________________________________
auctex-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to