On Thu, Dec 15 2016, Mosè Giordano wrote:

> 2016-12-15 18:37 GMT+01:00 Denis Bitouzé <[email protected]>:
>> Could you please elaborate the trick? I added:
>>
>>   ┌────
>>   │ (add-to-list 'LaTeX-indent-environment-list '("myenv" 
>> current-indentation))
>>   └────
>>
>> to my `.emacs' but the got the error:
>>
>>   ┌────
>>   │ Warning (initialization): An error occurred while loading 
>> ‘/home/bitouze/.emacs’:
>>   │
>>   │ Symbol's value as variable is void: LaTeX-indent-environment-list
>>   └────
>>
>> despite I'm using the last AUCTeX version: (elpa) auctex-11.89.7.
>
> When you use `add-to-list' is almost always a good idea to wrap it in
> a `with-eval-after-load' (or `eval-after-load' in older Emacsens),
> unless you know when the variable is defined in your init file:
>
> (with-eval-after-load "latex"
>   (add-to-list 'LaTeX-indent-environment-list '("myenv" current-indentation)))
>
> This should do the trick.

An alternative approach is use-package, eg

(use-package latex
  :config (add-to-list 'LaTeX-indent-environment-list
                       '("myenv" current-indentation)))

See https://github.com/jwiegley/use-package

Best,

Tamas

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

Reply via email to