* Understanding Emacs and Tabs
@ 2003-05-06 15:28 Eric Pement
2003-05-06 17:41 ` Paul D. Smith
2003-05-10 14:16 ` Kai Großjohann
0 siblings, 2 replies; 15+ messages in thread
From: Eric Pement @ 2003-05-06 15:28 UTC (permalink / raw)
Hi! I've just posted a web page entitled "Understanding GNU Emacs
and Tabs", which I hope to be of help to other users who have
had trouble understanding how Emacs handles the TAB key and
TAB display. The page is here:
http://www.student.northpark.edu/pemente/emacs_tabs.htm
If any of the experts would like to preview this page and let me
know if I've missed or misrepresented anything, I'd appreciate
it (email me privately is probably a more reliable way to reach
me, but both post-and-mail is fine with me). I do want to thank
Kai Grossjohann and others who have been helpful in explaining
things to me. Hope this helps.
--
Eric Pement
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Understanding Emacs and Tabs
2003-05-06 15:28 Understanding Emacs and Tabs Eric Pement
@ 2003-05-06 17:41 ` Paul D. Smith
2003-05-16 18:56 ` Eric Pement
2003-05-10 14:16 ` Kai Großjohann
1 sibling, 1 reply; 15+ messages in thread
From: Paul D. Smith @ 2003-05-06 17:41 UTC (permalink / raw)
You should probably point out that, regardless of the mode or other
settings, you can always insert an actual TAB character by first typing
C-q, as in:
C-q TAB
You should probably also mention the "*-tab-always-indent" variables;
for example c-tab-always-indent. I set this (and its brethren in
various other programming modes) to nil and that works much better for
me than the default setting of t.
--
-------------------------------------------------------------------------------
Paul D. Smith <psmith@gnu.org> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Understanding Emacs and Tabs
2003-05-06 15:28 Understanding Emacs and Tabs Eric Pement
2003-05-06 17:41 ` Paul D. Smith
@ 2003-05-10 14:16 ` Kai Großjohann
2003-05-16 20:06 ` Eric Pement
1 sibling, 1 reply; 15+ messages in thread
From: Kai Großjohann @ 2003-05-10 14:16 UTC (permalink / raw)
pemente@northpark.edu (Eric Pement) writes:
> Hi! I've just posted a web page entitled "Understanding GNU Emacs
> and Tabs", which I hope to be of help to other users who have
> had trouble understanding how Emacs handles the TAB key and
> TAB display.
I wish it explained better about syntax-driven indentation. The key
issue, I think, is that syntax-driven indentation can usually be
configured to the user's liking. And once that has happened, it is a
useful time-saver.
(Myself, I just mostly adjust my coding style to what syntax-driven
indentation suggests. I did change the standard indentation offset
from 2 to 4, but that was it.)
Another detail that might be useful is the variable
c-tab-always-indent. I think the default value is true, but if you
set it to false then TAB in the middle of a line will do like M-i,
which is probably what people like.
--
file-error; Data: (Opening input file no such file or directory ~/.signature)
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Understanding Emacs and Tabs
2003-05-06 17:41 ` Paul D. Smith
@ 2003-05-16 18:56 ` Eric Pement
0 siblings, 0 replies; 15+ messages in thread
From: Eric Pement @ 2003-05-16 18:56 UTC (permalink / raw)
"Paul D. Smith" <psmith@gnu.org> wrote in message news:<p5n0i0vupt.fsf@lemming.engeast.baynetworks.com>...
> You should probably point out that, regardless of the mode or other
> settings, you can always insert an actual TAB character by first typing
> C-q as in:
>
> C-q TAB
That's a good reminder. I've added that to the page, and will post
the updated version on my website within a week.
> You should probably also mention the "*-tab-always-indent" variables;
> for example c-tab-always-indent. I set this (and its brethren in
> various other programming modes) to nil and that works much better for
> me than the default setting of t.
The reason I didn't mention it is that I haven't played with it
enough to really understand how it works (the documentation in
the source code notwithstanding). I'll take a stab at it, and
then incorporate my best understanding into the next version.
Thanks!
--
Eric Pement
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Understanding Emacs and Tabs
@ 2003-05-16 19:24 Bingham, Jay
0 siblings, 0 replies; 15+ messages in thread
From: Bingham, Jay @ 2003-05-16 19:24 UTC (permalink / raw)
On: Friday, May 16, 2003 Eric Pement wrote:
>"Paul D. Smith" <psmith@gnu.org> wrote in message
news:<p5n0i0vupt.fsf@lemming.engeast.baynetworks.com>...
>> You should probably point out that, regardless of the mode or other
>> settings, you can always insert an actual TAB character by first
typing
>> C-q as in:
>>
>> C-q TAB
As long as you are including this you might as well also include that
M-i will also always insert an actual TAB character.
-_
J_)
C_)ingham
. HP - NonStop Software & Services Austin - Software Quality
Assurance
. Austin, TX
. "Language is the apparel in which your thoughts parade in public.
. Never clothe them in vulgar and shoddy attire." -Dr. George W.
Crane-
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Understanding Emacs and Tabs
[not found] <mailman.6321.1053113095.21513.help-gnu-emacs@gnu.org>
@ 2003-05-16 19:44 ` Paul D. Smith
2003-05-16 21:35 ` Kevin Rodgers
2003-05-17 19:57 ` Kai Großjohann
1 sibling, 1 reply; 15+ messages in thread
From: Paul D. Smith @ 2003-05-16 19:44 UTC (permalink / raw)
%% "Bingham, Jay" <Jay.Bingham@hp.com> writes:
bj> As long as you are including this you might as well also include
bj> that M-i will also always insert an actual TAB character.
Unless someone bound it to something else of course :).
--
-------------------------------------------------------------------------------
Paul D. Smith <psmith@gnu.org> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Understanding Emacs and Tabs
2003-05-10 14:16 ` Kai Großjohann
@ 2003-05-16 20:06 ` Eric Pement
2003-05-17 20:02 ` Kai Großjohann
2003-05-17 22:27 ` Stefan Monnier
0 siblings, 2 replies; 15+ messages in thread
From: Eric Pement @ 2003-05-16 20:06 UTC (permalink / raw)
kai.grossjohann@gmx.net (Kai Großjohann) wrote in message news:<848yteq43p.fsf@lucy.is.informatik.uni-duisburg.de>...
> pemente@northpark.edu (Eric Pement) writes:
>
> > Hi! I've just posted a web page entitled "Understanding GNU Emacs
> > and Tabs", which I hope to be of help to other users
[ ... ]
> I wish it explained better about syntax-driven indentation. The key
> issue, I think, is that syntax-driven indentation can usually be
> configured to the user's liking. And once that has happened, it is a
> useful time-saver.
That's something that I need to learn more about, but I haven't
got enough experience to understand it well enough to explain it
to others. My main experience is with web programming languages
(HTML, XML, Perl, PHP, JavaScript, etc.).
> Another detail that might be useful is the variable
> c-tab-always-indent.
I will try to work it in there, but my thought was that perhaps
this variable is used only for C programming? I use Emacs more
frequently for HTML, outline-mode, plain text, so I assumed that
maybe c-tab-always-indent was not used that often. My more frequent
frustrations happen when I'm editing my .emacs file (Lisp-mode) and
the TAB key doesn't seem to work like I expect. So I've developed a
habit of just using the spacebar to do all my indentation.
Thanks, Kai, for the great help you have been to so many others!
--
Eric Pement
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Understanding Emacs and Tabs
2003-05-16 19:44 ` Paul D. Smith
@ 2003-05-16 21:35 ` Kevin Rodgers
0 siblings, 0 replies; 15+ messages in thread
From: Kevin Rodgers @ 2003-05-16 21:35 UTC (permalink / raw)
Paul D. Smith wrote:
> %% "Bingham, Jay" <Jay.Bingham@hp.com> writes:
>
> bj> As long as you are including this you might as well also include
> bj> that M-i will also always insert an actual TAB character.
>
> Unless someone bound it to something else of course :).
C-q TAB could do unexpected things if C-q's default binding was changed as well.
--
<a href="mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Understanding Emacs and Tabs
[not found] <mailman.6321.1053113095.21513.help-gnu-emacs@gnu.org>
2003-05-16 19:44 ` Paul D. Smith
@ 2003-05-17 19:57 ` Kai Großjohann
1 sibling, 0 replies; 15+ messages in thread
From: Kai Großjohann @ 2003-05-17 19:57 UTC (permalink / raw)
"Bingham, Jay" <Jay.Bingham@hp.com> writes:
> As long as you are including this you might as well also include that
> M-i will also always insert an actual TAB character.
No, M-i will obey indent-tabs-mode, AFAIK.
In fact, I just tested it, it seems to be the case.
Also, M-i advances to the next tab stop, and if that happens to be at
a spot that a tab character cannot reach, then M-i will use spaces
even if indent-tabs-mode is t.
--
This line is not blank.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Understanding Emacs and Tabs
2003-05-16 20:06 ` Eric Pement
@ 2003-05-17 20:02 ` Kai Großjohann
2003-05-17 22:27 ` Stefan Monnier
1 sibling, 0 replies; 15+ messages in thread
From: Kai Großjohann @ 2003-05-17 20:02 UTC (permalink / raw)
pemente@northpark.edu (Eric Pement) writes:
> kai.grossjohann@gmx.net (Kai Großjohann) wrote in message news:<848yteq43p.fsf@lucy.is.informatik.uni-duisburg.de>...
>> pemente@northpark.edu (Eric Pement) writes:
>>
>> > Hi! I've just posted a web page entitled "Understanding GNU Emacs
>> > and Tabs", which I hope to be of help to other users
> [ ... ]
>
>> I wish it explained better about syntax-driven indentation. The key
>> issue, I think, is that syntax-driven indentation can usually be
>> configured to the user's liking. And once that has happened, it is a
>> useful time-saver.
>
> That's something that I need to learn more about, but I haven't
> got enough experience to understand it well enough to explain it
> to others. My main experience is with web programming languages
> (HTML, XML, Perl, PHP, JavaScript, etc.).
Hm, okay. Indentation of HTML and XML is a thorny issue, because
there are at least three different modes out there and each of them
handles indentation differently.
The key thing to remember about syntax-driven indentation is that it
works differently in each mode, because the syntax is different in
each mode.
>> Another detail that might be useful is the variable
>> c-tab-always-indent.
>
> I will try to work it in there, but my thought was that perhaps
> this variable is used only for C programming?
For Perl, there are also two modes, perl-mode and cperl-mode, and
cperl-mode has a variable cperl-tab-always-indent. Not sure about
perl-mode.
So there are some modes which have similar variables.
> I use Emacs more frequently for HTML, outline-mode, plain text, so I
> assumed that maybe c-tab-always-indent was not used that often.
I see. Well, C programmers will have a different opinion :-)
> My more frequent frustrations happen when I'm editing my .emacs file
> (Lisp-mode) and the TAB key doesn't seem to work like I expect. So
> I've developed a habit of just using the spacebar to do all my
> indentation.
What do you expect from the TAB key? And what does it do?
FWIW, I use TAB for syntax driven indentation in all modes, and I use
M-i to advance to the next tab stop. For me, tab-stop-list contains
multiples of 8, so M-i conveniently inserts a tab character if
indent-tabs-mode is t.
Then if in some modes TAB in the middle of a line does not indent, I
try to find out how to make it so. And if that is not possible, I
just use TAB at the beginning of the line in those modes.
--
This line is not blank.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Understanding Emacs and Tabs
2003-05-16 20:06 ` Eric Pement
2003-05-17 20:02 ` Kai Großjohann
@ 2003-05-17 22:27 ` Stefan Monnier
2003-05-18 8:30 ` Kai Großjohann
1 sibling, 1 reply; 15+ messages in thread
From: Stefan Monnier @ 2003-05-17 22:27 UTC (permalink / raw)
>> Another detail that might be useful is the variable
>> c-tab-always-indent.
I'd point directly at tab-always-indent (new in Emacs-21.1).
Stefan
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Understanding Emacs and Tabs
2003-05-17 22:27 ` Stefan Monnier
@ 2003-05-18 8:30 ` Kai Großjohann
0 siblings, 0 replies; 15+ messages in thread
From: Kai Großjohann @ 2003-05-18 8:30 UTC (permalink / raw)
"Stefan Monnier" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> writes:
>>> Another detail that might be useful is the variable
>>> c-tab-always-indent.
>
> I'd point directly at tab-always-indent (new in Emacs-21.1).
Thanks, I didn't know about this variable.
--
This line is not blank.
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Understanding Emacs and Tabs
@ 2003-05-19 14:51 Bingham, Jay
2003-05-19 16:37 ` Kai Großjohann
0 siblings, 1 reply; 15+ messages in thread
From: Bingham, Jay @ 2003-05-19 14:51 UTC (permalink / raw)
On: Saturday, May 17, 2003 2:57 PM Kai Großjohann wrote:
>"Bingham, Jay" <Jay.Bingham@hp.com> writes:
>
>> As long as you are including this you might as well also include that
>> M-i will also always insert an actual TAB character.
>
>No, M-i will obey indent-tabs-mode, AFAIK.
>
>In fact, I just tested it, it seems to be the case.
>
>Also, M-i advances to the next tab stop, and if that happens to be at
>a spot that a tab character cannot reach, then M-i will use spaces
>even if indent-tabs-mode is t.
Kai,
Let me first say that I have learned a great deal about Emacs from your posts and I have a great deal of respect for you and your opinions. However I think that your response was a bit hasty in this case.
What you say may well be true if one has indent-tabs-mode enabled. Since I do not have indent-tabs-mode enabled in my environment and I suspect that the vast majority of the new users of Emacs, toward whom Eric's web page is aimed, will not have it enabled either, I believe that my statement will be valid in their environments as well. I have no quick way to verify or refute your statement with regard to the operation of M-i when indent-tabs-mode is enabled, since I do not have it enabled. Nor do I care to go to the effort to verify your statement since it appears that indent-tabs-mode is an add-in that must be intentionally required to even be available (I am running Emacs 21.1 on my PC and 20.4 on Unix based machines neither of which has it available), unless of course someone inherits it by cloning another user's .emacs.
Regards,
-_
J_)
C_)ingham
. HP - NonStop Austin Software & Services - Software Quality Assurance
. Austin, TX
. "Language is the apparel in which your thoughts parade in public.
. Never clothe them in vulgar and shoddy attire." -Dr. George W. Crane-
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Understanding Emacs and Tabs
2003-05-19 14:51 Bingham, Jay
@ 2003-05-19 16:37 ` Kai Großjohann
0 siblings, 0 replies; 15+ messages in thread
From: Kai Großjohann @ 2003-05-19 16:37 UTC (permalink / raw)
Cc: help-gnu-emacs
"Bingham, Jay" <Jay.Bingham@hp.com> writes:
> Let me first say that I have learned a great deal about Emacs from
> your posts and I have a great deal of respect for you and your
> opinions. However I think that your response was a bit hasty in
> this case.
Oh, there's someone being very careful. I hope I can stand a healthy
dose of criticism :-) Point taken, I hope.
> What you say may well be true if one has indent-tabs-mode enabled.
I think you meant to say disabled. The default for indent-tabs-mode
is to be enabled.
Okay, so the full story is this: in the default Emacs configuration,
M-i will insert a tab up to the 120th column in a line. And this is
very close to always.
And there are two variables that come into play: the variable
indent-tabs-mode and the variable tab-stop-list.
Yeah, maybe I'm trying to be too exact. Maybe an introduction doesn't
need to be so exact. It was just a knee-jerk reaction on my side --
when somebody says `always' I'll answer, `but not when the full moon
shines through the window and you're sitting with your back to the
door'.
It's probably silly. I'm sorry.
--
This line is not blank.
^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: Understanding Emacs and Tabs
@ 2003-05-19 19:49 Bingham, Jay
0 siblings, 0 replies; 15+ messages in thread
From: Bingham, Jay @ 2003-05-19 19:49 UTC (permalink / raw)
Cc: help-gnu-emacs
On: Monday, May 19, 2003 11:38 AM Kai Großjohann wrote:
>Oh, there's someone being very careful. I hope I can stand a healthy
>dose of criticism :-) Point taken, I hope.
Yes, I was trying not to start a running battle, but the comment was true, I really have learned a lot from you.
>I think you meant to say disabled. The default for indent-tabs-mode
>is to be enabled.
I said what I meant to say, but my statement was incorrect due to a lack of comprehension on my part.
>Okay, so the full story is this: in the default Emacs configuration,
>M-i will insert a tab up to the 120th column in a line. And this is
>very close to always.
>
>And there are two variables that come into play: the variable
>indent-tabs-mode and the variable tab-stop-list.
Now I understand. And now that I realize that you are talking about a variable, not a mode (when I saw the -mode at the end of the name I just jumped to the conclusion that indent-tabs-mode was a function that enabled a "mode"), I see that I do indeed have indent-tabs-mode set to t in my environment and that my tab-stop-list's value is a list of numbers that ends at 120.
>Yeah, maybe I'm trying to be too exact. Maybe an introduction doesn't
>need to be so exact. It was just a knee-jerk reaction on my side --
>when somebody says `always' I'll answer, `but not when the full moon
>shines through the window and you're sitting with your back to the
>door'.
>
>It's probably silly. I'm sorry.
Apology accepted, although it was not necessary and I am glad that you had a knee-jerk reaction because once again you have enlightened me.
Thanks,
-_
J_)
C_)ingham
. HP - NonStop Austin Software & Services - Software Quality Assurance
. Austin, TX
. "Language is the apparel in which your thoughts parade in public.
. Never clothe them in vulgar and shoddy attire." -Dr. George W. Crane-
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2003-05-19 19:49 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-06 15:28 Understanding Emacs and Tabs Eric Pement
2003-05-06 17:41 ` Paul D. Smith
2003-05-16 18:56 ` Eric Pement
2003-05-10 14:16 ` Kai Großjohann
2003-05-16 20:06 ` Eric Pement
2003-05-17 20:02 ` Kai Großjohann
2003-05-17 22:27 ` Stefan Monnier
2003-05-18 8:30 ` Kai Großjohann
-- strict thread matches above, loose matches on Subject: below --
2003-05-16 19:24 Bingham, Jay
[not found] <mailman.6321.1053113095.21513.help-gnu-emacs@gnu.org>
2003-05-16 19:44 ` Paul D. Smith
2003-05-16 21:35 ` Kevin Rodgers
2003-05-17 19:57 ` Kai Großjohann
2003-05-19 14:51 Bingham, Jay
2003-05-19 16:37 ` Kai Großjohann
2003-05-19 19:49 Bingham, Jay
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.