LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-19-2010, 12:11 AM   #1
Fabio Paolini
Member
 
Registered: Dec 2008
Location: Brazil
Distribution: Slackware 12 Debian 5
Posts: 52

Rep: Reputation: 17
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.
 
Old 05-19-2010, 12:12 AM   #2
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Try searching LQ before asking a question:
See the following thread,
http://www.linuxquestions.org/questi...-emacs-803059/
 
Old 05-20-2010, 08:40 AM   #3
Fabio Paolini
Member
 
Registered: Dec 2008
Location: Brazil
Distribution: Slackware 12 Debian 5
Posts: 52

Original Poster
Rep: Reputation: 17
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.

Last edited by Fabio Paolini; 05-20-2010 at 08:45 AM.
 
Old 05-20-2010, 08:44 AM   #4
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
Originally Posted by Fabio Paolini View Post
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
 
Old 05-20-2010, 09:27 AM   #5
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
Quote:
but the syntax of the .emacs file does not seem very easy to me.
That is written in Lisp language !
 
Old 05-21-2010, 08:17 AM   #6
Fabio Paolini
Member
 
Registered: Dec 2008
Location: Brazil
Distribution: Slackware 12 Debian 5
Posts: 52

Original Poster
Rep: Reputation: 17
Quote:
That is written in Lisp language !
Thanks, I didn't know that. Now I have at least a starting point.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Emacs indentation Miarld Linux - Newbie 1 10-15-2009 09:01 AM
Easy string/text manipulation/indentation for restructured text brianmcgee Linux - Software 1 04-22-2008 08:27 PM
emacs' html indentation prell Linux - Software 1 05-26-2005 07:21 PM
emacs: requiring tabs in all indentation prell Linux - Software 0 08-24-2004 09:32 AM
Kate Automatic Indentation Quirk cuboidz Linux - Software 0 03-23-2004 01:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration