all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Skip Montanaro <skip.montanaro@gmail.com>
To: Help GNU Emacs <help-gnu-emacs@gnu.org>
Subject: indent-tabs-mode scope?
Date: Mon, 23 Jul 2018 12:22:49 -0500	[thread overview]
Message-ID: <CANc-5Uy-AsDmWgdoNRrR_-9N72QES7tiuqeA-ybz_wP4Do040w@mail.gmail.com> (raw)

I'm looking for a bit of confirmation here. I recently customized
indent-tabs-mode to be nil by default. Previously, it was nil for
python-mode (makes sense), but t elsewhere (the Emacs default). It
appears that despite its name, it suppresses tab insertion everywhere
possible, not just at the beginning of a line. For example, suppose
I'm editing an SQL create table statement and want the column types to
line up. I might start with this:

CREATE TABLE Foo
(
  col1               INT NOT NULL,
  col2

then press TAB after typing "2". The cursor will be positioned under
the "I" in "INT", using nothing but SPACE characters to achieve that
effect. This is due to the value of indent-tabs-mode. Looking at the
description for that variable, I see:

  Indentation can insert tabs if this is non-nil.

I casually think of "indentation" as occurring only at the start of a
line, but I suppose anywhere you want to advance the cursor to a "tab
stop" (for those of you, who like me learned to type on a typewriter),
the inserted white space could be considered indentation as well.

Empirically, this looks like the case. I wonder if the doc string for
indent-tabs-mode or for the indent-for-tab-command function should be
tightened up a bit to explicitly describe this behavior. The
indent-for-tab-command function doc string makes no mention of
indent-tabs-mode, though it seems clear it alters the function's
behavior (even without a dive into the code).

If this is deemed a Good Thing, I will try and produce a PR for a doc change.

Thanks,

Skip Montanaro



                 reply	other threads:[~2018-07-23 17:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CANc-5Uy-AsDmWgdoNRrR_-9N72QES7tiuqeA-ybz_wP4Do040w@mail.gmail.com \
    --to=skip.montanaro@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.