From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nerius Landys Newsgroups: gmane.emacs.help Subject: [emacs] tabs, spaces, and indentation Date: Wed, 6 Oct 2010 13:06:05 -0700 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e65bbaf4bd29de0491f84ef9 X-Trace: dough.gmane.org 1286401230 10961 80.91.229.12 (6 Oct 2010 21:40:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 6 Oct 2010 21:40:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 06 23:40:28 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 1P3bip-0008LW-6g for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Oct 2010 23:40:23 +0200 Original-Received: from localhost ([127.0.0.1]:32834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P3bio-0004eg-G3 for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Oct 2010 17:40:22 -0400 Original-Received: from [140.186.70.92] (port=33242 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P3aHa-0006pM-FB for help-gnu-emacs@gnu.org; Wed, 06 Oct 2010 16:08:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P3aFf-0002E3-U6 for help-gnu-emacs@gnu.org; Wed, 06 Oct 2010 16:06:13 -0400 Original-Received: from mail-qy0-f176.google.com ([209.85.216.176]:44890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P3aFf-0002Du-QC for help-gnu-emacs@gnu.org; Wed, 06 Oct 2010 16:06:11 -0400 Original-Received: by qyk4 with SMTP id 4so943433qyk.0 for ; Wed, 06 Oct 2010 13:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=iui1mNY68NorH07AVSTfkprI2kcpDYgkIQKf3RS6Z04=; b=jB2mXCioncL8nvos/xONKf4Od8AVNVbwXLIK1WXtQWXkGuuQzstEzc0lGbuL1Nktlj mt1gFPzyNrgPgnfMbgX9czRyE74B7ihSlLjym5ceaHROM9f/i0eCLD132v8js62VBsIu gF9KTRYWm+xK04uNRGwE80ISQ4XWXgOvcx/LA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=rKloCTgMZXNSkbQt1pYIRmwRC4vobynDOXhn2UEIK52iQTvyYteSxsY3s8AURWN6JB 3nA2GStmj6n7VMhSQ/5BtdxR02gsYev/MbFwHVscLthV/NwbVVCyHED1q/SrxTxvEsYA PmtwXXqFRX4kd5UAZh4rO4cYKmsbRlxTo2nI8= Original-Received: by 10.229.184.149 with SMTP id ck21mr9038328qcb.198.1286395565779; Wed, 06 Oct 2010 13:06:05 -0700 (PDT) Original-Received: by 10.229.52.17 with HTTP; Wed, 6 Oct 2010 13:06:05 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Wed, 06 Oct 2010 17:36:05 -0400 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:75081 Archived-At: --0016e65bbaf4bd29de0491f84ef9 Content-Type: text/plain; charset=ISO-8859-1 Hi. I use emacs all the time for programming and shell scripting. Now I'm dabbling in an open source project that is written in C, and the entire code base uses tabs extensively (instead of spaces for indentation). I very much prefer to use spaces for indentation; however I must use tabs for this project in order to make the code consistent. I am looking for some quick command or something that will place my emacs into a special mode that is suitable for working with tabbed C code. Then of course I'd like a command that puts me back into the regular settings that I have and am used to. (In other words, a toggle on and off.) Here are some details. I am running FreeBSD 8.0 and I have emacs installed with no X11, from the port editors/emacs-nox11. The version of emacs is 23.2_4,2. I have no additional bells and whistles installed for emacs other than what comes with this FreeBSD port and my .emacs config, which is more or less like so: (setq transient-mark-mode t) (setq make-backup-files nil) ;(setq-default indent-tabs-mode nil) [ commented out ] (setq-default c-basic-offset 2) I tried searching on Google for commands that may help me, but most of what I found explained how to enable the kind of behavior that I'm NOT looking (I'm going in the opposite direction unfortunately). 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. Is it possible to toggle the mode consisting of #1 and #2 on and off? Please help, and thank you very much! --0016e65bbaf4bd29de0491f84ef9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi.=A0 I use emacs all the time for programming and shell scripting.=A0 Now= I'm dabbling in an open source project that is written in C, and the e= ntire code base uses tabs extensively (instead of spaces for indentation).= =A0 I very much prefer to use spaces for indentation; however I must use ta= bs for this project in order to make the code consistent.=A0 I am looking f= or some quick command or something that will place my emacs into a special = mode that is suitable for working with tabbed C code.=A0 Then of course I&#= 39;d like a command that puts me back into the regular settings that I have= and am used to.=A0 (In other words, a toggle on and off.)

Here are some details.

I am running FreeBSD 8.0 and I have emacs= installed with no X11, from the port editors/emacs-nox11.=A0 The version o= f emacs is 23.2_4,2.=A0 I have no additional bells and whistles installed f= or emacs other than what comes with this FreeBSD port and my .emacs config,= which is more or less like so:

(setq transient-mark-mode t)
(setq make-backup-files nil)
;(setq-= default indent-tabs-mode nil) [ commented out ]
(setq-default c-basic-of= fset 2)

I tried searching on Google for commands that may help me, b= ut most of what I found explained how to enable the kind of behavior that I= 'm NOT looking (I'm going in the opposite direction unfortunately).=

The current default behavior that I am experiencing is as follows:
<= br>1. When I hit the Tab key, it indents the current line at the correct in= dentation level.=A0 Existing Tabs are preserved but spaces might be added.<= br> 2. When I complete some syntax on a line, such as adding a semicolon or clo= sing 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.=A0 Th= at is all.
2. I notice that sometimes when I complete a like (e.g. addin= g a semicolon or adding a paren) it auto-indents for me.=A0 I want to turn = this off completely.

Is it possible to toggle the mode consisting of #1 and #2 on and off?= =A0 Please help, and thank you very much!

--0016e65bbaf4bd29de0491f84ef9--