[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Disabling automatic reindentation of the current line after a newlin
From: |
Stefan Monnier |
Subject: |
Re: Disabling automatic reindentation of the current line after a newline |
Date: |
Tue, 25 Oct 2022 22:59:04 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Anders Munch [2022-10-25 13:39:06] wrote:
> Stefan Monnier wrote:
>>> How do you do that when electric-indent-inhibit automatically becomes
>>> buffer-local when set?
>>
>> Same as what you do for all the vars that share this characteristic, like
>> `indent-tabs-mode`. I.e. either set the var from a mode hook or use
>> `setq-default`.
> setq-default is the missing piece that I did not know. Thank you.
To some extent, I think `setq` should basically never be used other than on
lexical variables: for non-lexical variables, we should either use
`setq-default` or `setq-local` but never this `setq` which does sometime
one thing and sometimes the other.
Stefan