LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Doing the automatic Indentation of the whole text in Emacs (https://www.linuxquestions.org/questions/linux-software-2/doing-the-automatic-indentation-of-the-whole-text-in-emacs-808749/)

Fabio Paolini 05-19-2010 12:11 AM

Doing the automatic Indentation of the whole text in Emacs
 
Hi, I use emacs to write in C, Java, Latex and other languanges. I can always make an automatic indentation of each line of the text pressing the tab key. However I wonder if there is a way to indent the whole text with a single command.

Thanks to any help.

Aquarius_Girl 05-19-2010 12:12 AM

Try searching LQ before asking a question:
See the following thread,
http://www.linuxquestions.org/questi...-emacs-803059/

Fabio Paolini 05-20-2010 08:40 AM

Quote:

Try searching LQ before asking a question:
Ok, but I really had searched before, in the LinuxQuestions and google, but probably using wrong key words. I realized also, with the link you sent me, that an automatic indentation was not exactly what I wanted. I don't want something that changes the text as I am writing, but a command that indents all the text, instead of tab that indents just the current line.

Well, I found that simple and useful link:
http://everything2.com/title/the+key...rs+should+know
and then I was able to find a kind of "help commands" like
C-x C-h and C-h b with which it is possible to find a lot of commands.
At last, I found the "indent selected region" command C-M-\ that if pressed after the "select all" command C-x h will indent all text.
Now I would like how could I create a new single command that would work as this two above. I'm reading an emacs tutorial:
http://www.emacswiki.org/emacs-en
but the syntax of the .emacs file does not seem very easy to me.
Thanks again.

Aquarius_Girl 05-20-2010 08:44 AM

Quote:

Originally Posted by Fabio Paolini (Post 3975464)
Well, I found that simple and usefull link:
http://everything2.com/title/the+key...rs+should+know
and then I was able to find a kind of "help commands" like
C-x C-h and C-h b with which it is possible to find a lot of commands.
At last, I found the "indent selected region" command C-M-\ that if pressed after the "select all" command C-x h will indent all text.

Well thanks for presenting the commands :)

Aquarius_Girl 05-20-2010 09:27 AM

Quote:

but the syntax of the .emacs file does not seem very easy to me.
That is written in Lisp language !

Fabio Paolini 05-21-2010 08:17 AM

Quote:

That is written in Lisp language !
Thanks, I didn't know that. Now I have at least a starting point.


All times are GMT -5. The time now is 06:20 AM.