See Beyond Tech

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Saturday, 1 May 2010

Making PHP-mode on Emacs 23 Work Properly

Posted on 16:39 by Unknown
So, recently I've been experimenting with emacs (I'm used the usual old propreitary stuff), and much to my surprise, it seems to be working just great! Except with some problems here and there.

One of the problems I've been having is to get PHP-mode to work properly in Emacs 23. Apparently, it used to work properly in previous versions, but then the usual instructions on the net for installing php mode don't work properly.

As per the usual instructions, you should add the following code to the .emacs file in your home directory:
(add-to-list 'load-path "~/path/to/the/el/file/")
(require 'php-mode)


But turns out that Emacs 23 doesn't like that anymore and gives you an error:

Warning (initialization): An error occurred while loading `~/rishi/.emacs':
error: `c-lang-defconst' must be used in a file
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the `--debug-init' option to view a complete error backtrace.


To fix that, you're going to need to follow the instructions on this post.

Which essentially states that instead of putting the (require 'php-mode) line you should put this instead:

(autoload 'php-mode "php-mode" "Major mode for editing php code." t)
(add-to-list 'auto-mode-alist '("\\.php$" . php-mode))
(add-to-list 'auto-mode-alist '("\\.inc$" . php-mode))


Works for me!
Email ThisBlogThis!Share to XShare to Facebook
Posted in php, programming | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Contact Me!
    Okay so you want to contact me for something? No Problem! E-Mail You can send all your questions , comments , tips (I need a lot of those)...
  • Google Easter Egg: Change your language to Bork! Bork! Bork!
    Just recently I was watching a video of Marissa Meyer talking about how Google goes about optimizing their site to incease performance and u...
  • WeTransfer Job Ad
    I like using WeTransfer to transfer things that don't fit in emails, mainly because the site is fast, has a large upload limit (2GB!) an...
  • Subscribe!
    Beyond-Teck is constantly being updated all the time! So it might be a little hard for you to keep up with all the tutorials and tricks an...
  • Mail Merge on a Mac
    I've been wanting to do Mail merge on a Mac for a while now, but until now Google seemed to have failed me. I realize that mail merges a...
  • Searching from Firefox Address Bar (like Chrome)
    While I love the concept of being able to search and access websites from only 1 single address bar, Google Chrome isn't exactly the bes...
  • Unlock your Galaxy S Phone for free?
    Warning: Check with your service provider and manufacturer before you unlock your phone. Unlocking your phone will most certainly void your ...
  • No More Green
    Today I took 5 minutes off hectic schedule to remove most of the green (almost all of the green) in this site. Many of my friends (especiall...
  • Today's Tab Tips
    I don't know about other people but to me tabs are a very essential part of my life (okay may be not life, but you get the idea right). ...
  • What is Bootsec.Bak? Can I delete it?
    Today when I was browsing through my C: folder, which I don’t always do, I noticed that I had a lot of junk on there. Most of it seemed to b...

Categories

  • addons
  • adobe
  • ads
  • adsense
  • apple
  • audio
  • blackberry
  • blog
  • blogger
  • blogging
  • cars
  • cellphones
  • clean
  • code
  • comments
  • cricket
  • downloads
  • ebooks
  • email
  • error
  • file sharing
  • firefox
  • fixes
  • free
  • games
  • gas
  • Gmail
  • google
  • hack
  • hotmail
  • installs
  • instant messaging
  • internet
  • internet explorer
  • ipod
  • laptop
  • Linux
  • Live Writer
  • lol
  • Mac
  • mac. mail
  • mail
  • messenger
  • microsoft
  • Microsoft Word
  • money
  • msn
  • music
  • Musings
  • network
  • news
  • online
  • Outlook
  • page
  • peripherals
  • phones
  • photo
  • photoshop
  • php
  • plagiarism
  • problems
  • productivity
  • programming
  • projects
  • rant
  • Registry
  • Review
  • school
  • Screenshots
  • search
  • security
  • software
  • spam
  • speech
  • speed up windows
  • spyware
  • sysfader
  • technology
  • tip
  • tricks
  • tutorials
  • ubuntu
  • updates
  • video
  • virus
  • voip
  • web
  • wi-fi
  • Windows
  • Windows 7
  • Windows Vista
  • Windows XP
  • wireless
  • work
  • wtf
  • youtube

Blog Archive

  • ►  2013 (5)
    • ►  October (2)
    • ►  August (2)
    • ►  March (1)
  • ►  2012 (6)
    • ►  December (1)
    • ►  October (1)
    • ►  June (1)
    • ►  May (1)
    • ►  January (2)
  • ►  2011 (19)
    • ►  October (1)
    • ►  August (1)
    • ►  July (8)
    • ►  June (1)
    • ►  February (4)
    • ►  January (4)
  • ▼  2010 (41)
    • ►  November (1)
    • ►  October (3)
    • ►  September (3)
    • ►  August (2)
    • ►  July (12)
    • ►  June (2)
    • ▼  May (5)
      • Sending Scheduled Emails through Apple Mail
      • 10 Things to do after a Fresh Ubuntu Install
      • Efficient Cursor Navigation while Coding
      • Flickering Monitor in Ubuntu 10.04 for ATI Cards
      • Making PHP-mode on Emacs 23 Work Properly
    • ►  April (3)
    • ►  March (4)
    • ►  February (4)
    • ►  January (2)
  • ►  2009 (59)
    • ►  December (1)
    • ►  November (1)
    • ►  October (1)
    • ►  September (3)
    • ►  August (4)
    • ►  July (4)
    • ►  June (14)
    • ►  May (1)
    • ►  April (3)
    • ►  March (3)
    • ►  February (4)
    • ►  January (20)
  • ►  2008 (108)
    • ►  December (22)
    • ►  November (10)
    • ►  October (14)
    • ►  August (13)
    • ►  July (13)
    • ►  June (6)
    • ►  May (13)
    • ►  April (10)
    • ►  March (5)
    • ►  January (2)
  • ►  2007 (33)
    • ►  December (8)
    • ►  November (1)
    • ►  October (4)
    • ►  September (10)
    • ►  August (1)
    • ►  July (2)
    • ►  June (1)
    • ►  May (2)
    • ►  April (1)
    • ►  February (2)
    • ►  January (1)
  • ►  2006 (137)
    • ►  December (1)
    • ►  November (1)
    • ►  October (1)
    • ►  August (1)
    • ►  July (3)
    • ►  June (9)
    • ►  May (20)
    • ►  April (22)
    • ►  March (33)
    • ►  February (20)
    • ►  January (26)
  • ►  2005 (55)
    • ►  December (12)
    • ►  November (19)
    • ►  October (9)
    • ►  September (15)
  • ►  2001 (1)
    • ►  January (1)
Powered by Blogger.

About Me

Unknown
View my complete profile