[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Tab width oddity
From: |
Nate Bargmann |
Subject: |
Tab width oddity |
Date: |
Tue, 23 Sep 2014 20:58:50 +0000 (UTC) |
User-agent: |
Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) |
Although I've used Emacs on and off in the past, this time I decided to
get serious about using it. Editing some C source I found that in a
struct where assignments had been lined up by other contributors and
other editors that Emacs is making a slight mess of things. I will try
to explain and if needed I can post some screenshots.
My tab-stop-list is (8 16 24 32 40 48 56 64 72 80 88 96 104 112 120) and
I am using CC-mode with indent defaults.
For example, I have a line like:
.foo = bar;
For most lines this lines up just fine but for some the '=' is positioned
at a tab-stop -1 (position 7, 15, 23, etc) and the next character in the
source file is a tab (0x09). The character immediately following is also
a tab. Editors such as Vim and Midnight Commander only give the tab
character one blank in this position and give the following tab the
customary 8 blanks (per my settings). However, Emacs is expanding the
first tab to 9 blanks before showing the second tab character. I do not
see this occurring when a tab character is two or more characters to the
left of the tab stop. I first became aware of this when I found things
were not lined up in Emacs as I had expected and a 'git diff' showed that
my changes had moved the assignment operand to the left by one tab stop.
Neither my search of the Emacs documentation nor any amount of searching
the Web has turned up mention of this. Hopefully, this is not an FAQ I
have yet to find.
Thanks,
- Nate
- Tab width oddity,
Nate Bargmann <=