all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: goncholden <goncholden@protonmail.com>
To: Po Lu <luangruo@yahoo.com>
Cc: goncholden via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: Turning electric-indent-mode off, for a specific buffer
Date: Mon, 13 Jun 2022 01:31:52 +0000	[thread overview]
Message-ID: <BMrdwePzsNok9VpDexphPE1AAUKlHt9kI-rLfLTJw6XTf0c-t-4o1LsZMVROUUjeqIjYEFDlRbG7VjO8txR4esy4xUtUjO7kZEFayEAK1-g=@protonmail.com> (raw)
In-Reply-To: <87bkuxe7dt.fsf@yahoo.com>


------- Original Message -------
On Monday, June 13th, 2022 at 12:26 PM, Po Lu <luangruo@yahoo.com> wrote:


> goncholden via Users list for the GNU Emacs text editor
> help-gnu-emacs@gnu.org writes:
>
> > I thought that for Emacs >= 24.4 there is "electric-indent-local-mode"
> > so one can turn it off in a specific buffer.
>
>
> There is?

What is the way to disable `electric-indent-mode` in a buffer?

There is `setq-default` which only changes the mode if the buffer does not have a defined local value for `electric-indent-mode`.  Using `setq` would be considered a global change.

Thusly, `setq-local` could be the appropriate one to use.

(setq-local electric-indent-mode nil)

Whereas for the specific language I could use

(defun myindent ()
  (setq-local electric-indent-mode nil))

(add-hook 'fortran-mode 'myindent)

Any critique about all this?






  reply	other threads:[~2022-06-13  1:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-12 21:20 Turning electric-indent-mode off, for a specific buffer goncholden via Users list for the GNU Emacs text editor
2022-06-13  0:26 ` Po Lu
2022-06-13  1:31   ` goncholden [this message]
2022-06-13  2:25     ` Po Lu
2022-06-13  5:21       ` goncholden
2022-06-13  5:42         ` Po Lu
2022-06-13  6:07           ` goncholden
2022-06-13 10:53             ` goncholden
2022-06-13 11:39               ` Po Lu
2022-06-13 12:01                 ` goncholden
2022-06-13 12:15                   ` Po Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BMrdwePzsNok9VpDexphPE1AAUKlHt9kI-rLfLTJw6XTf0c-t-4o1LsZMVROUUjeqIjYEFDlRbG7VjO8txR4esy4xUtUjO7kZEFayEAK1-g=@protonmail.com' \
    --to=goncholden@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.