Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8503355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:44:10+00:00 2026-06-11T01:44:10+00:00

I am using Emacs with php-mode.el: http://php-mode.sourceforge.net/php-mode.el.html I have the following lines in my

  • 0

I am using Emacs with php-mode.el: http://php-mode.sourceforge.net/php-mode.el.html

I have the following lines in my .emacs file:

(load-file "~/.emacs.d/php-mode.el")
(require 'php-mode)
(setq c-default-style "linux" c-basic-offset 4)

It is working really nicely for the most part. The issue is that for certain bits of code Emacs displays the code differently to other editors. For example, I have the following code in Emacs:

public function showStuff($items, $Stuff) {
    $restrict = true;
    $stuff  = false;
    $moreStuff = true;

    if (($restrict && $stuff >= $moreStuff) 
        || ( $moreStuff > 10)) {
        return true;
    }           
    return false;
}

But viewing the same file in Eclipse/Sublime Text/Text Wrangler looks like:

public function showStuff($items, $Stuff) {
    $restrict = true;
    $stuff  = false;
    $moreStuff = true;

    if (($restrict && $stuff >= $moreStuff) 
    || ( $moreStuff > 10)) {
    return true;
    }           
    return false;
}

Can anyone comment on why I am seeing these results and a possible solution?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:44:12+00:00Added an answer on June 11, 2026 at 1:44 am

    As it seems you want to use spaces rather than tabs, I think this is basically a duplicate of:

    I can't find this: How do I use 4 SPACES instead of a TAB in EMACS?

    Or if you wanted this only for PHP files, then you would use:

    (add-hook 'php-mode-hook 'my-php-mode-hook)
    (defun my-php-mode-hook ()
      "My PHP mode configuration."
      (setq indent-tabs-mode nil
            tab-width 4
            c-basic-offset 4))
    

    Before that, with the code looking correct in Emacs, convert the tabs to spaces with:

    • C-xh
    • M-x untabify RET

    I would also take a look at:
    http://www.emacswiki.org/emacs/CategoryIndentation

    (or take note of it, at least — indentation can be trickier than expected in Emacs, and there’s lots of good information there.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have emacs 23.3.1, running on windows. php-mode 1.5 from http://php-mode.sourceforge.net/ , Modified: 2008-11-04
I am using Emacs 23 and php-mode.el 1.5.0. When I have this in my
I have started using emacs org-mode recently to maintain my TODO lists. I have
I'm using emacs with dired, (require 'dired-details) (dired-details-install) and ido, (setq ido-enable-flex-matching t) (setq
When using emacs for writing erlang source code, I have made the following configuration.
Im using the pastie.el file located at http://www.emacswiki.org/emacs/download/pastie.el . This is supposed to help
I am using emacs 24 on Windows 7 and have installed technomancy's clojure-mode along
I started using emacs and slime to develop some little service. I have found
I'm using emacs tramp mode to remotely edit files over ssh. The problem is
I am now using Emacs 23 with visual-line-mode turned of for text editing but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.