[Top][All Lists]

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

Re: [AUCTeX-devel] [PATCH] A fix for longtable and a new style

From: Tassilo Horn
Subject: Re: [AUCTeX-devel] [PATCH] A fix for longtable and a new style
Date: Tue, 06 Oct 2015 07:19:09 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Arash Esbati <address@hidden> 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)))


reply via email to

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