Arash Esbati <[email protected]> writes:

Hi Arash,

>>> `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'?

No, here it is ok because `LaTeX-enumitem-key-val-options-local' is a
global variable.  The -local prefix here just means it's buffer-local.
What I've meant with locals is local variables declared in a `let'.

> (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)))

Bye,
Tassilo


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

Reply via email to