From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: TAB
Date: Mon, 17 Nov 2003 12:42:40 -0700 [thread overview]
Message-ID: <3FB924B0.2040700@yahoo.com> (raw)
In-Reply-To: mailman.170.1069096910.399.help-gnu-emacs@gnu.org
Dan Anderson wrote:
> On Mon, 2003-11-17 at 12:31, Kevin Rodgers wrote:
>>David Rasmussen wrote:
>>
>>>When I edit java-files, most of the times emacs inserts spaces when I
>>>press TAB to indent something. But sometimes I've found it inserts a TAB
>>>character instead. Why?
>>
>>C-h v indent-tabs-mode
>>
>>>How can I turn it off? I never want TAB
>>>characters when editing Java or C++ source code files.
>>>
>>(setq-default indent-tabs-mode nil) ; for all modes, or
>>
>>(add-hook 'java-mode-hook ; for just java mode
>> (lambda () (setq indent-tabs-mode nil)))
>
> That tells him how to turn of tabs. Is there any way to change tabs to
> spaces? i.e. when tabbing insert 4 spaces instead of a tab (if tabs
> default to 4 spaces long)?
I don't even know what you mean by "turn off tabs". Setting indent-tabs-mode
to nil does exactly what its doc string says: the TAB key, which is bound to
c-indent-command, will always insert spaces and never insert tab characters:
| TAB runs the command c-indent-command
| which is an interactive compiled Lisp function in `cc-cmds'.
| (c-indent-command &optional ARG)
|
| Indent current line as C code, and/or insert some whitespace.
...
| [*] The amount and kind of whitespace inserted is controlled by the
| variable `c-insert-tab-function', which is called to do the actual
| insertion of whitespace. Normally the function in this variable
| just inserts a tab character, or the equivalent number of spaces,
| depending on the variable `indent-tabs-mode'.
--
Kevin Rodgers
next prev parent reply other threads:[~2003-11-17 19:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-17 14:32 TAB David Rasmussen
2003-11-17 17:31 ` TAB Kevin Rodgers
2003-11-17 18:16 ` TAB Dan Anderson
2003-11-18 19:23 ` TAB jan
[not found] ` <mailman.170.1069096910.399.help-gnu-emacs@gnu.org>
2003-11-17 19:42 ` Kevin Rodgers [this message]
2003-11-17 19:49 ` TAB Sean Richards
2003-11-19 9:42 ` TAB David Rasmussen
2003-11-19 14:17 ` TAB Eli Zaretskii
2003-11-18 0:45 ` TAB Dan Anderson
-- strict thread matches above, loose matches on Subject: below --
2003-11-17 20:42 TAB Joe Corneli
[not found] <20020319140511.A2178@sasken.com>
[not found] ` <20020319092050.960E9CD2B9@smtp.bcn.isoco.net>
2002-03-26 12:59 ` Tab Alexander Koptelov
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3FB924B0.2040700@yahoo.com \
--to=ihs_4664@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).