From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steve Revilak Newsgroups: gmane.emacs.help Subject: Re: [emacs] tabs, spaces, and indentation Date: Fri, 8 Oct 2010 22:08:01 -0400 Message-ID: <20101009020801.GD4996@srevilak.net> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nHwqXXcoX0o6fKCv" X-Trace: dough.gmane.org 1286591159 20901 80.91.229.12 (9 Oct 2010 02:25:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 9 Oct 2010 02:25:59 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 09 04:25:58 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P4P8H-0001kq-Nm for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Oct 2010 04:25:58 +0200 Original-Received: from localhost ([127.0.0.1]:39919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4P8H-0003g9-6e for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Oct 2010 22:25:57 -0400 Original-Received: from [140.186.70.92] (port=38049 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4P5E-0002KM-2i for help-gnu-emacs@gnu.org; Fri, 08 Oct 2010 22:22:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4Or1-0005In-EN for help-gnu-emacs@gnu.org; Fri, 08 Oct 2010 22:08:08 -0400 Original-Received: from mail7.sea5.speakeasy.net ([69.17.117.52]:51102) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4Or1-0005Ih-2X for help-gnu-emacs@gnu.org; Fri, 08 Oct 2010 22:08:07 -0400 Original-Received: (qmail 7425 invoked from network); 9 Oct 2010 02:08:04 -0000 Original-Received: from pool-108-7-96-54.bstnma.fios.verizon.net (HELO srevilak.net) (srevilak@[108.7.96.54]) (envelope-sender ) by mail7.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 9 Oct 2010 02:08:04 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:75100 Archived-At: --nHwqXXcoX0o6fKCv Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable >From: Nerius Landys >The current default behavior that I am experiencing is as follows: > >1. When I hit the Tab key, it indents the current line at the correct >indentation level. Existing Tabs are preserved but spaces might be added. >2. When I complete some syntax on a line, such as adding a semicolon or >closing a paren, it indents the line for me automatically. > >The behavior for this particular mode of operation that would be nice is as >follows: > >1. Hitting the Tab key places a literal Tab character in my file. That is >all. >2. I notice that sometimes when I complete a like (e.g. adding a semicolon >or adding a paren) it auto-indents for me. I want to turn this off >completely. CC-mode gives you a lot of options for controlling indentation. M-x Info-goto-node RET (ccmode)Commands RET The subsections "Indentation commands", "Minor Modes" and "Electric keys" will probably be the most relevant for what you're trying to accomplish. For (1) something like (setq c-basic-offset 8 indent-tabs-mode t c-insert-tab-function 'tab-to-tab-stop) (setq c-syntactic-indentation nil) ; maybe, or maybe not this one should be close to the behavior you're looking for.=20 For (2), try (c-toggle-electric-state -1) Steve --nHwqXXcoX0o6fKCv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) iEYEARECAAYFAkyvzoEACgkQX7YJI4BuyDRhPACdFmT1EpBe02DCqeQl7uG6bv2A 8OIAoMNFebnfXNAn/vF29feJbXLmb2Ol =lYIM -----END PGP SIGNATURE----- --nHwqXXcoX0o6fKCv--