all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: PJ Weisberg <pj@irregularexpressions.net>
To: Sueroski <sueroski@interia.pl>
Cc: help-gnu-emacs@gnu.org
Subject: Re: No automatic tabs in Emacs?
Date: Wed, 1 Dec 2010 20:04:01 -0800	[thread overview]
Message-ID: <AANLkTin_ed8VxGYfvQEuz7YPKOhTr_7YUj+4ZfXt11RX@mail.gmail.com> (raw)
In-Reply-To: <4CF554E6.4090009@interia.pl>

> I'm writing on C my code:
>
> #include "stdio.h"
> int main(){
> }
>
> And I wanna add something to main. I push Enter and write my code. In Emacs I get this:
>
> #include "stdio.h"
> int main(){
> printf("Hello World");
> }

Actually you don't, because emacs by default indents the line when you
press ';'. ;-)

There might be a better way to do it, but you can accomplish what you
describe by putting this in your .emacs file:

(defadvice newline (after always-auto-indent)
  (indent-according-to-mode))
(ad-activate 'newline)

I'm personally at the point where I'm sometimes surprised when I
unconsciously press TAB in another editor and it inserts some
whitespace at the cursor instead of fixing my indentation.  If you've
really got a love for having the editor take care of your whitespace,
try this:

(c-toggle-auto-newline 1)
(c-toggle-hungry-state 1)



  reply	other threads:[~2010-12-02  4:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-30 19:47 No automatic tabs in Emacs? Sueroski
2010-12-02  4:04 ` PJ Weisberg [this message]
2010-12-02  8:29 ` Steve B
2010-12-02 17:40 ` Bob Proulx
2010-12-03 12:10 ` Sergei Organov
     [not found] <mailman.4.1291237651.3892.help-gnu-emacs@gnu.org>
2010-12-01 21:14 ` Raffaele Ricciardi
2010-12-01 21:15 ` egarrulo
2010-12-02 22:05   ` suvayu ali
2010-12-03  1:24     ` egarrulo
     [not found]     ` <mailman.0.1291339426.25881.help-gnu-emacs@gnu.org>
     [not found]       ` <icfwufk5bo.fsf@verizon.net>
     [not found]         ` <6d104acb-b2b8-419a-b30d-c1db0474386c@m35g2000vbn.googlegroups.com>
     [not found]           ` <877hfrpg0p.fsf@kuiper.lan.informatimago.com>
     [not found]             ` <a8c083ff-7bef-49a1-b156-220e103681c4@j18g2000prn.googlegroups.com>
     [not found]               ` <a026e8c1-9a26-498b-bb75-33ca809c43cf@n32g2000pre.googlegroups.com>
     [not found]                 ` <buoaakjo4c1.fsf@dhlpc061.dev.necel.com>
     [not found]                   ` <e9c7ebf7-19c6-497e-825e-2ac3de014e73@21g2000prv.googlegroups.com>
     [not found]                     ` <buozksjkxm3.fsf@dhlpc061.dev.necel.com>
2010-12-06 10:41                       ` Mario Lassnig
     [not found]                         ` <b8c79625-42c3-4c95-ac21-5d0034583dd5@o23g2000prh.googlegroups.com>
2010-12-06 12:03                           ` Mario Lassnig
2010-12-06 12:11                         ` Richard Riley
     [not found]           ` <icbp52k6bf.fsf@verizon.net>
     [not found]             ` <fb8fc567-e2b8-4363-b7ff-256a62fc7bbb@o11g2000prf.googlegroups.com>
     [not found]               ` <buo1v5vo3t7.fsf@dhlpc061.dev.necel.com>
2010-12-06 12:15                 ` Richard Riley
     [not found]                 ` <96096e34-9a6a-469b-b4cd-53df0976bb7e@v17g2000prc.googlegroups.com>
     [not found]                   ` <buor5dvkwto.fsf@dhlpc061.dev.necel.com>
     [not found]                     ` <619f3816-6211-4782-a717-4a5c4730f69b@w21g2000vby.googlegroups.com>
     [not found]                       ` <buoaakjku34.fsf@dhlpc061.dev.necel.com>
     [not found]                         ` <155552f5-fa5c-4cf1-a84a-9d4c06bba2ec@j19g2000prh.googlegroups.com>
     [not found]                           ` <jwvipz6q4zd.fsf-monnier+gnu.emacs.help@gnu.org>
     [not found]                             ` <idj34f$d45$1@quimby.gnus.org>
     [not found]                               ` <b18ab95e-9d98-4282-9265-1e6cce1d642d@a28g2000prb.googlegroups.com>
2010-12-06 17:33                                 ` Richard Riley

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTin_ed8VxGYfvQEuz7YPKOhTr_7YUj+4ZfXt11RX@mail.gmail.com \
    --to=pj@irregularexpressions.net \
    --cc=help-gnu-emacs@gnu.org \
    --cc=sueroski@interia.pl \
    /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.
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.