From: Bob Proulx <bob@proulx.com>
To: Sueroski <sueroski@interia.pl>
Cc: help-gnu-emacs@gnu.org
Subject: Re: No automatic tabs in Emacs?
Date: Thu, 2 Dec 2010 10:40:09 -0700 [thread overview]
Message-ID: <20101202174009.GC15659@hysteria.proulx.com> (raw)
In-Reply-To: <4CF554E6.4090009@interia.pl>
Sueroski wrote:
> And I'm flustrated about one think... so, I'm programmer (mainly
> Python and PHP) and actually all editors gives me automatic adding
> tab... I haven't this on Emacs and I don't know how to do it. I must
> on every line press TAB and it's not good ;[
> So... what I must change to have auto tabs in Emacs? I searched most
> of sites but everything telling how to select type of tabs, leight
> of tabs etc.
I think the default expectation is that instead of pressing Enter
(also known as C-m the carriage return character) that if you press
C-j you will get what you want. The C-j (the newline character) is by
default bound to newline-and-indent. Try using C-j instead of Enter
and see if that does what you want.
You can change your keymap so that Enter (C-m) also calls
newline-and-indent just like C-J and automatically indents the next
line for you. Set up a hook for the modes you care about and change
the keymap.
(add-hook 'c-mode-hook
'(lambda ()
(define-key c-mode-map "\C-m" 'newline-and-indent)))
Change the above as appropriate for the other modes you wish to use.
I used to always map C-m to newline-and-indent. But more recently
have been using random unconfigured machines and don't get my normal
customizations. I have therefore trained myself to use C-j now
instead since that is a default behavior and doesn't need
configuration.
Bob
next prev parent reply other threads:[~2010-12-02 17:40 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
2010-12-02 8:29 ` Steve B
2010-12-02 17:40 ` Bob Proulx [this message]
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=20101202174009.GC15659@hysteria.proulx.com \
--to=bob@proulx.com \
--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.