LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-07-2003, 05:18 PM   #1
eduac
Member
 
Registered: Jun 2003
Distribution: Arch - www.archlinux.org
Posts: 186

Rep: Reputation: 30
emacs hightlight


guys,

how can i set the php highlight mode into the emacs?
 
Old 09-07-2003, 07:23 PM   #2
eric.r.turner
Member
 
Registered: Aug 2003
Location: Planet Earth
Distribution: Linux Mint
Posts: 216

Rep: Reputation: 31
I figured out how to set it up for my local user account. There's a way to set it up so that all users get php-mode, but I haven't played around with that.

1. mkdir ~/.php-mode

2. download the php-mode.el from http://sourceforge.net/projects/php-mode/ into your ~/.php-mode/ directory.

3. Run emacs and type "M-0 M-x byte-recompile-directory RET ~/.php-mode/ RET". This will byte compile php-mode.el into php-mode.ecl.

4. Edit your ~/.emacs file by adding these two lines:
Code:
(setq load-path (cons "~/.php-mode/" load-path))
(autoload 'php-mode "php-mode" "php editing mode." t)
5. Close emacs and run it again to re-read your .emacs file.

6. Open a PHP file and type "M-x php-mode".

I know, this isn't obvious. I had a tough time finding instructions on how to do this. There are ways of automatically putting Emacs into php-mode when you open a .php file, but I haven't figured that out yet.

Hope that helps!
 
Old 09-07-2003, 07:48 PM   #3
eduac
Member
 
Registered: Jun 2003
Distribution: Arch - www.archlinux.org
Posts: 186

Original Poster
Rep: Reputation: 30
thanks a lot!!!!
 
Old 09-08-2003, 05:49 AM   #4
dakensta
Member
 
Registered: Jun 2003
Location: SEUK
Distribution: Debian & OS X
Posts: 194

Rep: Reputation: 35
To autoload your php mode, I think you need something like this:

(setq auto-mode-alist (cons '("\\.php$" . php-mode) auto-mode-alist))

or you if you use php mode pretty much exclusively

(require 'php-mode)

which will load up php mode whenever you start emacs.
 
Old 09-08-2003, 08:06 PM   #5
lackluster
Member
 
Registered: Apr 2002
Location: D.C - USA
Distribution: slackware-current
Posts: 488

Rep: Reputation: 30
this might help you:

Code:
lackluster@lackluster:~$ cat .emacs
(custom-set-variables
  ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 '(case-fold-search t)
 '(current-language-environment "ASCII")
 '(global-font-lock-mode t nil (font-lock)))
(custom-set-faces
  ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
  ;; Your init file should contain only one such instance.
 )

;; HTML-MODE
(load-library "html-helper-mode")
(load-library "hhm-config")

;; JAVASCRIPT-MODE
(load-library "javascript-mode")

;; PHP
(load-library "php-mode")
(add-hook 'php-mode-hook 'auto-fill-mode)

;; Config
(setq backup-directory-alist `(("." . , "/home/lackluster/.emacs.d/backups")))
(setq inferior-lisp-program #'/usr/local/bin/clisp)
 
Old 09-08-2003, 08:07 PM   #6
lackluster
Member
 
Registered: Apr 2002
Location: D.C - USA
Distribution: slackware-current
Posts: 488

Rep: Reputation: 30
also:

Code:
lackluster@lackluster:/usr/share/emacs/site-lisp$ ls
a2ps-print.el   add-default.el     autotest-mode.el   doc-to-texi.el*      javascript-mode.el  po-compat.elc    smart-complete.el
a2ps-print.elc  ansi-doc.el*       autotest-mode.elc  gcl.el*              man1-to-texi.el*    po-mode.el       sshell.el*
a2ps.el         autoconf-mode.el   dbl.el*            hhm-config.el        php-mode.el         po-mode.elc      subdirs.el
a2ps.elc        autoconf-mode.elc  default.el         html-helper-mode.el  po-compat.el        rep-debugger.el  t-mouse.el
 
  


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
where is the .emacs file in the emacs source code tarball? aizkorri Programming 2 01-13-2007 02:05 PM
emacs not responding to .emacs file in Mandriva 2005 LE. Please help LaptopLinux Mandriva 1 06-08-2005 08:36 AM
Unwanted text hightlight in vi lel800 Linux - Software 3 12-10-2004 11:37 AM
edb (emacs database) won't open file - emacs 20 & 21 tip184 Linux - Software 0 04-03-2004 07:31 AM
emacs and VM xunilpassion Linux - Software 0 11-24-2003 12:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:22 AM.

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