all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to make emacs fontify a php buffer
@ 2009-06-17 15:50 Harry Putnam
  0 siblings, 0 replies; 6+ messages in thread
From: Harry Putnam @ 2009-06-17 15:50 UTC (permalink / raw)
  To: help-gnu-emacs

I want emacs to fontify a certain file... I think it is *.php but not
really sure.

Just adding .php to it does not seem to cause emacs to fontify that file.  Of
coure I have syntax hilighting turned on.

I've posted the file here:

   www.jtan.com/~reader/script.txt

Anyone recognize what kind of code it is?
Can anyone tell how to make emacs fontify that file?





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to make emacs fontify a php buffer
       [not found] <mailman.797.1245253845.2239.help-gnu-emacs@gnu.org>
@ 2009-06-17 16:19 ` Pascal J. Bourguignon
  2009-06-17 18:17 ` Colin S. Miller
  1 sibling, 0 replies; 6+ messages in thread
From: Pascal J. Bourguignon @ 2009-06-17 16:19 UTC (permalink / raw)
  To: help-gnu-emacs

Harry Putnam <reader@newsguy.com> writes:

> I want emacs to fontify a certain file... I think it is *.php but not
> really sure.
>
> Just adding .php to it does not seem to cause emacs to fontify that file.  Of
> coure I have syntax hilighting turned on.
>
> I've posted the file here:
>
>    www.jtan.com/~reader/script.txt
>
> Anyone recognize what kind of code it is?
> Can anyone tell how to make emacs fontify that file?

Add:

    <!-- -*- mode:php -*- --> 

on the first line.


-- 
__Pascal Bourguignon__


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to make emacs fontify a php buffer
       [not found] <mailman.797.1245253845.2239.help-gnu-emacs@gnu.org>
  2009-06-17 16:19 ` How to make emacs fontify a php buffer Pascal J. Bourguignon
@ 2009-06-17 18:17 ` Colin S. Miller
  2009-06-17 21:09   ` Harry Putnam
       [not found]   ` <mailman.820.1245273011.2239.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 6+ messages in thread
From: Colin S. Miller @ 2009-06-17 18:17 UTC (permalink / raw)
  To: help-gnu-emacs

Harry Putnam wrote:
> I want emacs to fontify a certain file... I think it is *.php but not
> really sure.
> 
> Just adding .php to it does not seem to cause emacs to fontify that file.  Of
> coure I have syntax hilighting turned on.
> 
> I've posted the file here:
> 
>    www.jtan.com/~reader/script.txt
> 
> Anyone recognize what kind of code it is?
> Can anyone tell how to make emacs fontify that file?
> 
> 
> 
Harry,
assuming that
M-x php-mode
works on the file, then
add to your .emacs

(add-to-list 'auto-mode-alist '("\\.php\\'" . php-mode) 't)

will make all files ending in .php open in php-mode.

HTH,
Colin S. Miller


-- 
Replace the obvious in my email address with the first three letters of the hostname to reply.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to make emacs fontify a php buffer
  2009-06-17 18:17 ` Colin S. Miller
@ 2009-06-17 21:09   ` Harry Putnam
       [not found]   ` <mailman.820.1245273011.2239.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 6+ messages in thread
From: Harry Putnam @ 2009-06-17 21:09 UTC (permalink / raw)
  To: help-gnu-emacs

"Colin S. Miller" <no-spam-thank-you@csmiller.demon.co.uk> writes:

> Harry Putnam wrote:
>> I want emacs to fontify a certain file... I think it is *.php but not
>> really sure.
>>
>> Just adding .php to it does not seem to cause emacs to fontify that file.  Of
>> coure I have syntax hilighting turned on.
>>
>> I've posted the file here:
>>
>>    www.jtan.com/~reader/script.txt
>>
>> Anyone recognize what kind of code it is?
>> Can anyone tell how to make emacs fontify that file?
>>
>>
>>
> Harry,
> assuming that
> M-x php-mode
> works on the file, then

No it didn't work on the file... apparently php-mode library is not
loading on startup.. so added this (including your suggestion)

> add to your .emacs
>
> (add-to-list 'auto-mode-alist '("\\.php\\'" . php-mode) 't)
>
> will make all files ending in .php open in php-mode.

(require 'php-mode)
(add-to-list 'auto-mode-alist '("\\.php\\'" . php-mode) 't)

And that seems to get it done..

   Thanks for the tips posters.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to make emacs fontify a php buffer
       [not found]   ` <mailman.820.1245273011.2239.help-gnu-emacs@gnu.org>
@ 2009-06-17 21:27     ` Colin S. Miller
  2009-06-18 13:59       ` Harry Putnam
  0 siblings, 1 reply; 6+ messages in thread
From: Colin S. Miller @ 2009-06-17 21:27 UTC (permalink / raw)
  To: help-gnu-emacs

Harry,

Harry Putnam wrote:
> 
> No it didn't work on the file... apparently php-mode library is not
> loading on startup.. so added this (including your suggestion)
> 
> 
> (require 'php-mode)
> (add-to-list 'auto-mode-alist '("\\.php\\'" . php-mode) 't)
> 
Harry,

If you don't use php-mode often, then it might be better to replace
the (requires...) with
(autoload 'php-mode '"php-mode")

This will make emacs (require php-mode) when
the function (php-mode) is used by the auto-mode-alist
(or any other use of it).

This will save (some) memory and start-up time,
but will lead to a slight delay the first time each session
you use php-mode.

HTH,
Colin S. Miller

-- 
Replace the obvious in my email address with the first three letters of the hostname to reply.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to make emacs fontify a php buffer
  2009-06-17 21:27     ` Colin S. Miller
@ 2009-06-18 13:59       ` Harry Putnam
  0 siblings, 0 replies; 6+ messages in thread
From: Harry Putnam @ 2009-06-18 13:59 UTC (permalink / raw)
  To: help-gnu-emacs

"Colin S. Miller" <no-spam-thank-you@csmiller.demon.co.uk> writes:

> Harry,
>
> Harry Putnam wrote:
>>
>> No it didn't work on the file... apparently php-mode library is not
>> loading on startup.. so added this (including your suggestion)
>>
>>
>> (require 'php-mode)
>> (add-to-list 'auto-mode-alist '("\\.php\\'" . php-mode) 't)
>>
> Harry,
>
> If you don't use php-mode often, then it might be better to replace
> the (requires...) with
> (autoload 'php-mode '"php-mode")

[...]

Thanks for the nice tip...looks like a good one.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-06-18 13:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.797.1245253845.2239.help-gnu-emacs@gnu.org>
2009-06-17 16:19 ` How to make emacs fontify a php buffer Pascal J. Bourguignon
2009-06-17 18:17 ` Colin S. Miller
2009-06-17 21:09   ` Harry Putnam
     [not found]   ` <mailman.820.1245273011.2239.help-gnu-emacs@gnu.org>
2009-06-17 21:27     ` Colin S. Miller
2009-06-18 13:59       ` Harry Putnam
2009-06-17 15:50 Harry Putnam

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.