* Re: No automatic tabs in Emacs?
[not found] <mailman.4.1291237651.3892.help-gnu-emacs@gnu.org>
@ 2010-12-01 21:14 ` Raffaele Ricciardi
2010-12-01 21:15 ` egarrulo
1 sibling, 0 replies; 14+ messages in thread
From: Raffaele Ricciardi @ 2010-12-01 21:14 UTC (permalink / raw)
To: help-gnu-emacs
Sueroski wrote:
> Hello everyone.
> In first I have one info for you. Please send copy of your messanges to
> my email (cuz I'm not on this mailing list and I want to have aswer).
>
> And the main problem. I started learning Emacs and I very like this
> editor by now... it have great shortcuts - I can do everything without
> mouse and it may make in future my programming faster (when I'll mainly
> switched to Emacs... now I don't know about it so much)
> 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.
>
> If you don't know what I mean under term "auto tab" then watch:
> for example:
> 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");
> }
>
> And I wanna get by default without pressing TAB, get this:
>
> #include "stdio.h"
> int main(){
> printf("Hello World");
> }
>
> I know it's real but I don't know how to configure it (why Emacs don't
> have this by default? if I edit *.c file it's probably know to I write C
> code and I wanna tabs... ).
>
> Greetings and sorry for wasting time
>
> PS I think my English is not really bad but I can make few mistakes (I'm
> really young by now and I'm not native ;[) then sorry for my English
>
Forget about using Emacs for programming. Emacs is not an IDE.
Regarding your issue, read here:
http://www.emacswiki.org/emacs/AutoIndentation
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: No automatic tabs in Emacs?
[not found] <mailman.4.1291237651.3892.help-gnu-emacs@gnu.org>
2010-12-01 21:14 ` No automatic tabs in Emacs? Raffaele Ricciardi
@ 2010-12-01 21:15 ` egarrulo
2010-12-02 22:05 ` suvayu ali
1 sibling, 1 reply; 14+ messages in thread
From: egarrulo @ 2010-12-01 21:15 UTC (permalink / raw)
To: Sueroski; +Cc: help-gnu-emacs
Sueroski wrote:
> Hello everyone.
> In first I have one info for you. Please send copy of your messanges to
> my email (cuz I'm not on this mailing list and I want to have aswer).
>
> And the main problem. I started learning Emacs and I very like this
> editor by now... it have great shortcuts - I can do everything without
> mouse and it may make in future my programming faster (when I'll mainly
> switched to Emacs... now I don't know about it so much)
> 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.
>
> If you don't know what I mean under term "auto tab" then watch:
> for example:
> 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");
> }
>
> And I wanna get by default without pressing TAB, get this:
>
> #include "stdio.h"
> int main(){
> printf("Hello World");
> }
>
> I know it's real but I don't know how to configure it (why Emacs don't
> have this by default? if I edit *.c file it's probably know to I write C
> code and I wanna tabs... ).
>
> Greetings and sorry for wasting time
>
> PS I think my English is not really bad but I can make few mistakes (I'm
> really young by now and I'm not native ;[) then sorry for my English
>
Forget about using Emacs for programming. Emacs is not an IDE.
Regarding your issue, read here:
http://www.emacswiki.org/emacs/AutoIndentation
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: No automatic tabs in Emacs?
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>
0 siblings, 2 replies; 14+ messages in thread
From: suvayu ali @ 2010-12-02 22:05 UTC (permalink / raw)
To: egarrulo; +Cc: help-gnu-emacs, Sueroski
On Wed, Dec 1, 2010 at 10:15 PM, egarrulo <egarrulo@gmail.com> wrote:
> Forget about using Emacs for programming. Emacs is not an IDE.
That is a strange comment. Does one always need an IDE for
programming? Although at times it is very useful, I often find it
intrusive. Also have you checked out the CEDET library for Emacs? I
use it when I am working within a framework.
As for the OP, I find putting the terminating ";" in C/C++ works best
for me while in source code and "C-j" (i.e. press and hold Ctrl then
press j) when I am inside multiline comments.
--
Suvayu
Open source is the future. It sets us free.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: No automatic tabs in Emacs?
2010-12-02 22:05 ` suvayu ali
@ 2010-12-03 1:24 ` egarrulo
[not found] ` <mailman.0.1291339426.25881.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 14+ messages in thread
From: egarrulo @ 2010-12-03 1:24 UTC (permalink / raw)
To: suvayu ali; +Cc: help-gnu-emacs, Sueroski
suvayu ali wrote:
> On Wed, Dec 1, 2010 at 10:15 PM, egarrulo <egarrulo@gmail.com> wrote:
>
>> Forget about using Emacs for programming. Emacs is not an IDE.
>>
>
> That is a strange comment. Does one always need an IDE for
> programming? Although at times it is very useful, I often find it
> intrusive.
You'd better always use a an IDE for programming, albeit for easier
programs you . Do not discard IDEs because you have experienced using
bloated ones A nicely designed IDE will not get in your way. It will
scale nicely from one-source-file programs to multi-project
applications. Indeed, if I'm not mistaken, Emacs out-of-the-box
supports compiling and running one-source-file programs. What it lacks
is going beyond that (out-of-the-box).
> Also have you checked out the CEDET library for Emacs? I
> use it when I am working within a framework.
>
CEDET has been a recent addition to Emacs. I tried it in the past, but
I found it difficult to configure and understand. Maybe things have
changed in the meantime, or I wasn't an experienced-enough Emacser at
the time. I'll give it a try again, since you have recommended it.
I've just stumbled upon this project: http://home.gna.org/emacs-ide/
Maybe it is what I was saying Emacs lacks.
^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <mailman.0.1291339426.25881.help-gnu-emacs@gnu.org>]
* No automatic tabs in Emacs?
@ 2010-11-30 19:47 Sueroski
2010-12-02 4:04 ` PJ Weisberg
` (3 more replies)
0 siblings, 4 replies; 14+ messages in thread
From: Sueroski @ 2010-11-30 19:47 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 1738 bytes --]
Hello everyone.
In first I have one info for you. Please send copy of your messanges to
my email (cuz I'm not on this mailing list and I want to have aswer).
And the main problem. I started learning Emacs and I very like this
editor by now... it have great shortcuts - I can do everything without
mouse and it may make in future my programming faster (when I'll mainly
switched to Emacs... now I don't know about it so much)
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.
If you don't know what I mean under term "auto tab" then watch:
for example:
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");
}
And I wanna get by default without pressing TAB, get this:
#include "stdio.h"
int main(){
printf("Hello World");
}
I know it's real but I don't know how to configure it (why Emacs don't
have this by default? if I edit *.c file it's probably know to I write C
code and I wanna tabs... ).
Greetings and sorry for wasting time
PS I think my English is not really bad but I can make few mistakes (I'm
really young by now and I'm not native ;[) then sorry for my English
--
,= ,-_-. =. Sueroski
((_/)o o(\_)) Free Software User
`-'(. .)`-'
\_/ www.gnu.org
[-- Attachment #2: Type: text/html, Size: 2852 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: No automatic tabs in Emacs?
2010-11-30 19:47 Sueroski
@ 2010-12-02 4:04 ` PJ Weisberg
2010-12-02 8:29 ` Steve B
` (2 subsequent siblings)
3 siblings, 0 replies; 14+ messages in thread
From: PJ Weisberg @ 2010-12-02 4:04 UTC (permalink / raw)
To: Sueroski; +Cc: help-gnu-emacs
> 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)
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: No automatic tabs in Emacs?
2010-11-30 19:47 Sueroski
2010-12-02 4:04 ` PJ Weisberg
@ 2010-12-02 8:29 ` Steve B
2010-12-02 17:40 ` Bob Proulx
2010-12-03 12:10 ` Sergei Organov
3 siblings, 0 replies; 14+ messages in thread
From: Steve B @ 2010-12-02 8:29 UTC (permalink / raw)
To: Sueroski; +Cc: help-gnu-emacs@gnu.org
[-- Attachment #1: Type: text/plain, Size: 2018 bytes --]
C-j is your friend
On Dec 1, 2010, at 4:47, Sueroski <sueroski@interia.pl> wrote:
> Hello everyone.
> In first I have one info for you. Please send copy of your messanges to my email (cuz I'm not on this mailing list and I want to have aswer).
>
> And the main problem. I started learning Emacs and I very like this editor by now... it have great shortcuts - I can do everything without mouse and it may make in future my programming faster (when I'll mainly switched to Emacs... now I don't know about it so much)
> 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.
>
> If you don't know what I mean under term "auto tab" then watch:
> for example:
> 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");
> }
> And I wanna get by default without pressing TAB, get this:
> #include "stdio.h"
> int main(){
> printf("Hello World");
> }
> I know it's real but I don't know how to configure it (why Emacs don't have this by default? if I edit *.c file it's probably know to I write C code and I wanna tabs... ).
>
> Greetings and sorry for wasting time
>
> PS I think my English is not really bad but I can make few mistakes (I'm really young by now and I'm not native ;[) then sorry for my English
> --
> ,= ,-_-. =. Sueroski
> ((_/)o o(\_)) Free Software User
> `-'(. .)`-'
> \_/ www.gnu.org
> ----------------------------------------------------------------
> Plotki codziennie w Twoim telefonie!
> Sprawdz >> http://linkint.pl/f286d
[-- Attachment #2: Type: text/html, Size: 2937 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: No automatic tabs in Emacs?
2010-11-30 19:47 Sueroski
2010-12-02 4:04 ` PJ Weisberg
2010-12-02 8:29 ` Steve B
@ 2010-12-02 17:40 ` Bob Proulx
2010-12-03 12:10 ` Sergei Organov
3 siblings, 0 replies; 14+ messages in thread
From: Bob Proulx @ 2010-12-02 17:40 UTC (permalink / raw)
To: Sueroski; +Cc: help-gnu-emacs
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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: No automatic tabs in Emacs?
2010-11-30 19:47 Sueroski
` (2 preceding siblings ...)
2010-12-02 17:40 ` Bob Proulx
@ 2010-12-03 12:10 ` Sergei Organov
3 siblings, 0 replies; 14+ messages in thread
From: Sergei Organov @ 2010-12-03 12:10 UTC (permalink / raw)
To: Sueroski; +Cc: help-gnu-emacs
Sueroski <sueroski@interia.pl> writes:
[...]
> If you don't know what I mean under term "auto tab" then watch:
> for example:
> 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");
> }
>
> And I wanna get by default without pressing TAB, get this:
>
> #include "stdio.h"
> int main(){
> printf("Hello World");
> }
Add
(define-key global-map (kbd "RET") 'newline-and-indent)
to you .emacs, and restart emacs.
-- Sergei.
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2010-12-06 17:33 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.4.1291237651.3892.help-gnu-emacs@gnu.org>
2010-12-01 21:14 ` No automatic tabs in Emacs? 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
2010-11-30 19:47 Sueroski
2010-12-02 4:04 ` PJ Weisberg
2010-12-02 8:29 ` Steve B
2010-12-02 17:40 ` Bob Proulx
2010-12-03 12:10 ` Sergei Organov
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.