aspose file tools*
The moose likes Linux / UNIX and the fly likes emacs and annoying tab characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "emacs and annoying tab characters" Watch "emacs and annoying tab characters" New topic
Author

emacs and annoying tab characters

Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Actually, it's not the tab characters that annoy me. It's emacs behavior of mixing tabs and spaces in indentation. I often use emacs for coding but I'm really annoyed that it mixes tabs and spaces. Does anyone happen to know what I need to do to make emacs use only one or the other? Preferrably, I would like to use all spaces for indentation.

Thanks in advance!

Layne


Java API Documentation
The Java Tutorial
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15639
    
  15

Hey, this is Emacs. It knows BETTER than you do! [TM]

Memory's a little fuzzy, but I think Meta+x "untabify" or something like that will get rid of the tabs. Do this:

Press ESC (Meta)
Press x (down there on the bottom row )
When the prompt appears down below the status line, type "untab" and press the tab key and it will look for possible completions. Hopefully there's only one, but at least that should give a hint. Actually, I think it may be "untabify-buffer". There may also be an untabify-region that you'd use to untabify a "highlighted" section of the buffer.

Press Enter to execute the command.


Customer surveys are for companies who didn't pay proper attention to begin with.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

In your ~/.emacs file, put



This tells emacs to use all spaces instead of tabs, except in Makefiles, which need tabs to work correctly. If you never edit Makefiles, you could leave off everything but the first line.


[Jess in Action][AskingGoodQuestions]
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Thanks for all the suggestions. I'll try them out when I get home tonight.

Layne
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: emacs and annoying tab characters
 
Similar Threads
Indenting Problem (Sun Coding Conventions)
Coding standards
Assignment code indentation...help!
Array
Nested IF's