unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Better syntax highlighting
@ 2010-07-21 23:24 Giuseppe Fuggiano
  2010-07-22  7:28 ` Deniz Dogan
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Giuseppe Fuggiano @ 2010-07-21 23:24 UTC (permalink / raw)
  To: help-gnu-emacs

Hi there,

I'm learning Emacs for programming tasks and I think it's very powerful.

But, the first thing I saw migrating from Vim is that Emacs handles 
syntax highlighting differently, often messing up if a given source 
contains multiple languages (like a PHP file).  I tried a plugin named 
nxhtml, but it seems heavy and makes Emacs' startup quite slow.  I don't 
want to start an editor war here, just point out that Emacs seems so 
powerful, but doesn't have a smart syntax highlighting available out of 
the box.

I'm sure there's a solution to this. That's why I'm posting.

Regards

-- 
Giuseppe Fuggiano



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

* Re: Better syntax highlighting
       [not found] <mailman.1.1279754828.17909.help-gnu-emacs@gnu.org>
@ 2010-07-22  4:57 ` Pascal J. Bourguignon
  0 siblings, 0 replies; 7+ messages in thread
From: Pascal J. Bourguignon @ 2010-07-22  4:57 UTC (permalink / raw)
  To: help-gnu-emacs

Giuseppe Fuggiano <giuseppe.fuggiano@gmail.com> writes:

> Hi there,
>
> I'm learning Emacs for programming tasks and I think it's very powerful.
>
> But, the first thing I saw migrating from Vim is that Emacs handles
> syntax highlighting differently, often messing up if a given source
> contains multiple languages (like a PHP file).  I tried a plugin named
> nxhtml, but it seems heavy and makes Emacs' startup quite slow.  I
> don't want to start an editor war here, just point out that Emacs
> seems so powerful, but doesn't have a smart syntax highlighting
> available out of the box.
>
> I'm sure there's a solution to this. That's why I'm posting.

Use mmm-mode.

When it cannot determine it automatically,  you may add tags to
specify the language: 
   {%php-mode%}
    ... 
   {%/php-mode%}


Put: <!-- -*- mode:html;mode: mmm; coding:utf-8 -*- -->
on the first or second line of the file.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/


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

* Re: Better syntax highlighting
  2010-07-21 23:24 Giuseppe Fuggiano
@ 2010-07-22  7:28 ` Deniz Dogan
  2010-07-22  7:58 ` Andrea Crotti
  2010-07-22  8:22 ` Aidan Gauland
  2 siblings, 0 replies; 7+ messages in thread
From: Deniz Dogan @ 2010-07-22  7:28 UTC (permalink / raw)
  To: Giuseppe Fuggiano; +Cc: help-gnu-emacs

2010/7/22 Giuseppe Fuggiano <giuseppe.fuggiano@gmail.com>:
> Hi there,
>
> I'm learning Emacs for programming tasks and I think it's very powerful.
>
> But, the first thing I saw migrating from Vim is that Emacs handles syntax
> highlighting differently, often messing up if a given source contains
> multiple languages (like a PHP file).  I tried a plugin named nxhtml, but it
> seems heavy and makes Emacs' startup quite slow.  I don't want to start an
> editor war here, just point out that Emacs seems so powerful, but doesn't
> have a smart syntax highlighting available out of the box.
>
> I'm sure there's a solution to this. That's why I'm posting.
>
> Regards
>

I don't think syntax highlighting is what's hard, but rather things
such as indentation of PHP.

-- 
Deniz Dogan



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

* Re: Better syntax highlighting
  2010-07-21 23:24 Giuseppe Fuggiano
  2010-07-22  7:28 ` Deniz Dogan
@ 2010-07-22  7:58 ` Andrea Crotti
  2010-07-22  8:22 ` Aidan Gauland
  2 siblings, 0 replies; 7+ messages in thread
From: Andrea Crotti @ 2010-07-22  7:58 UTC (permalink / raw)
  To: help-gnu-emacs

Giuseppe Fuggiano <giuseppe.fuggiano@gmail.com> writes:

> Hi there,
>
> I'm learning Emacs for programming tasks and I think it's very powerful.
>
> But, the first thing I saw migrating from Vim is that Emacs handles
> syntax highlighting differently, often messing up if a given source
> contains multiple languages (like a PHP file).  I tried a plugin named
> nxhtml, but it seems heavy and makes Emacs' startup quite slow.  I
> don't want to start an editor war here, just point out that Emacs
> seems so powerful, but doesn't have a smart syntax highlighting
> available out of the box.
>
> I'm sure there's a solution to this. That's why I'm posting.
>
> Regards

Sure but actually multi-mode syntax highlighting is not an easy thing.
Nxhtml does it pretty well and if you compile it it's pretty fast.

Also consider that I think you can load it only when needed (autoload).

Emacs is probably the editor that can highlights more programming
languages very well (there's really everything).

Emacsers by the way never close emacs (unless they reboot the machine)
so the boot time is not so important after all...




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

* Re: Better syntax highlighting
  2010-07-21 23:24 Giuseppe Fuggiano
  2010-07-22  7:28 ` Deniz Dogan
  2010-07-22  7:58 ` Andrea Crotti
@ 2010-07-22  8:22 ` Aidan Gauland
  2010-07-22 10:30   ` Deniz Dogan
  2 siblings, 1 reply; 7+ messages in thread
From: Aidan Gauland @ 2010-07-22  8:22 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 852 bytes --]

Giuseppe Fuggiano wrote:
> I'm learning Emacs for programming tasks and I think it's very powerful.
> 
> But, the first thing I saw migrating from Vim is that Emacs handles
> syntax highlighting differently, often messing up if a given source
> contains multiple languages (like a PHP file).  I tried a plugin named
> nxhtml, but it seems heavy and makes Emacs' startup quite slow.  I don't
> want to start an editor war here, just point out that Emacs seems so
> powerful, but doesn't have a smart syntax highlighting available out of
> the box.
> 
> I'm sure there's a solution to this. That's why I'm posting.

I stumbled upon this page...
<http://www.emacswiki.org/cgi-bin/wiki/MultipleModes>
...but I've never tried anything listed there, because I don't suffer from
multiple-personality disorder. ;)

Hope this helps,
Aidan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

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

* Re: Better syntax highlighting
  2010-07-22  8:22 ` Aidan Gauland
@ 2010-07-22 10:30   ` Deniz Dogan
  2010-07-22 11:25     ` Lennart Borgman
  0 siblings, 1 reply; 7+ messages in thread
From: Deniz Dogan @ 2010-07-22 10:30 UTC (permalink / raw)
  To: Aidan Gauland; +Cc: help-gnu-emacs

2010/7/22 Aidan Gauland <aidalgol@no8wireless.co.nz>:
> Giuseppe Fuggiano wrote:
>> I'm learning Emacs for programming tasks and I think it's very powerful.
>>
>> But, the first thing I saw migrating from Vim is that Emacs handles
>> syntax highlighting differently, often messing up if a given source
>> contains multiple languages (like a PHP file).  I tried a plugin named
>> nxhtml, but it seems heavy and makes Emacs' startup quite slow.  I don't
>> want to start an editor war here, just point out that Emacs seems so
>> powerful, but doesn't have a smart syntax highlighting available out of
>> the box.
>>
>> I'm sure there's a solution to this. That's why I'm posting.
>
> I stumbled upon this page...
> <http://www.emacswiki.org/cgi-bin/wiki/MultipleModes>
> ...but I've never tried anything listed there, because I don't suffer from
> multiple-personality disorder. ;)
>

Note that nxhtml actually uses mumamo for a lot of its functionality,
e.g. mako-nxhtml-mumamo-mode, asp-nxhtml-mumamo-mode and
django-nxhtml-mumamo-mode.

-- 
Deniz Dogan



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

* Re: Better syntax highlighting
  2010-07-22 10:30   ` Deniz Dogan
@ 2010-07-22 11:25     ` Lennart Borgman
  0 siblings, 0 replies; 7+ messages in thread
From: Lennart Borgman @ 2010-07-22 11:25 UTC (permalink / raw)
  To: Deniz Dogan; +Cc: help-gnu-emacs

>>> I'm learning Emacs for programming tasks and I think it's very powerful.
>>>
>>> But, the first thing I saw migrating from Vim is that Emacs handles
>>> syntax highlighting differently, often messing up if a given source
>>> contains multiple languages (like a PHP file).  I tried a plugin named
>>> nxhtml, but it seems heavy and makes Emacs' startup quite slow.  I don't

It takes less than a second on a my quite slow machine - if I byte
compile nXhtml. (Otherwise it takes much longer depending on the way
Emacs loads things.)



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

end of thread, other threads:[~2010-07-22 11:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1.1279754828.17909.help-gnu-emacs@gnu.org>
2010-07-22  4:57 ` Better syntax highlighting Pascal J. Bourguignon
2010-07-21 23:24 Giuseppe Fuggiano
2010-07-22  7:28 ` Deniz Dogan
2010-07-22  7:58 ` Andrea Crotti
2010-07-22  8:22 ` Aidan Gauland
2010-07-22 10:30   ` Deniz Dogan
2010-07-22 11:25     ` Lennart Borgman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).