Coming soon - Get a detailed view of why an account is flagged as spam!
view details
7
Why is Emacs not respecting all of ~/.emacs?
Post Body

I've spent several hours over the last few days trying to get Emacs set up the way I like it, and I've come very close but have run into a problem.

I'm a fully satisfied Vim user on Windows 7, but I'm interested in switching to Emacs, so I managed to figure out enough about the HOME folder on windows, Emacs' Lisp, and package management to get evil downloaded and running, so I got down to actually coding some and I realized that tab does nothing.

Of course, that's not true, as I figured out after scouring Google. Tab does do something, it indents to all possible correct stops where a language expects an indent. If no indent is expected, the line is put to the expected stop (back to no indent if that's the way Emacs sees things). That's frustrating in of itself, but I figure I do so little plain text editing that it doesn't matter in the end.

But then I begin working in PHP since that's my current project's language, and there's not a native mode for that, so I install one, and get to work, and the "smart" indent is really funny looking.

class namespace ()
{
    function foo ()
    {
        if (x)
            {
                echo $bar;
            }
    }
}

Essentially, PHP mode is inconsistent with its curly brace placement, and everything in flow loops is two indents deeper than the ifs and elses.

I've tried adding everything I could find on Google to my .emacs file to try and turn off smart indenting and nothing has worked. There are a couple other things that haven't worked in my .emacs file either (like turning off the ~ and #file# backups and autosaves), and I've either been living with it, or in the case of the package manager, I've put it in a different place in the file.

Here's my .emacs file.

I figure the problem is either that all of this is hardcoded behavior, or I have to put all of these things into .emacs differently. What do I need to do to make tab, regardless of circumstance, insert 4 spaces?

Author
Account Strength
100%
Account Age
13 years
Verified Email
Yes
Verified Flair
No
Total Karma
7,060
Link Karma
244
Comment Karma
6,816
Profile updated: 2 days ago
Posts updated: 10 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
11 years ago