auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] how to disable indentation for tabular-like environment


From: Tamas Papp
Subject: Re: [AUCTeX] how to disable indentation for tabular-like environment
Date: Fri, 16 Dec 2016 14:27:38 +0100
User-agent: mu4e 0.9.19; emacs 26.0.50.2

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

> 2016-12-15 18:37 GMT+01:00 Denis Bitouzé <address@hidden>:
>> 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



reply via email to

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