all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* indent-tabs-mode scope?
@ 2018-07-23 17:22 Skip Montanaro
  0 siblings, 0 replies; only message in thread
From: Skip Montanaro @ 2018-07-23 17:22 UTC (permalink / raw)
  To: Help GNU Emacs

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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-07-23 17:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-23 17:22 indent-tabs-mode scope? Skip Montanaro

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.