emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: php-bug, multi- and single-line comment switches


From: Stefan Monnier
Subject: Re: php-bug, multi- and single-line comment switches
Date: Thu, 09 Mar 2006 17:51:39 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> Not clear where is the bug: you're presumably editing this buffer using
>> html-mode, which tells Emacs that what you're writing is HTML text,
> ...
>> 
>> Please try to use one of the various multi-mode packages (mmm-mode for
>> example)

> There are always ways with Emacs to do it, sure.  My suggestion is to
> enable it right out of the box.  People will use html-mode, insert
> php-code ... and lose time.

I agree that it would be good for HTML mode to automatically be setup to
recognize subparts in PHP, Javascript, younameit, ...

> Why not implement a routine as already sent,
> which checks, if being inside a php-construct?

Where would you use it?  Only in comment-region?  what about font-lock
and indentation?  What about Javascript?

The right way to do it is to enable mmm-mode (or something similar) right
out of the box.  Sadly it's not bundled with Emacs yet.

> If there is a feature in languages as common as C and C++
> -  different ways to comment -
>  /* Example code */ and  // Example code
> Emacs should support that.

It does: both styles are recognized by font-lock and indentation and by
uncomment-regions.  And by setting comment-start and comment-end you can
insert either of the two.

The problem is not one of writing code but of deciding which feature to make
easily available.  You can't make everything available, because then you've
just moved the difficulty elsewhere (which is for the user to find and
remember the various commands).

> In that way: My suggestion is to make things as easy as possible.

Unless you assume that our goal is not to make things as easy as possible,
this suggestion is not very constructive.

> If I'm on a line, struck by the idea to comment it, why then care for
> transient-mark-mode and active region stuff?

As explained the problem is not the code, but the way to make available.
If the user has to use M-x foo-comment-stuff to comment out the current
line, I'm pretty sure he'll prefer using C-SPC C-e M-; (assuming he uses
transient-mark-mode).

In any case you're talking to the wrong guy: I wrote comment-dwim, so
clearly I already have my favorite behavior available right on M-; and I'm
unlikely to be excited by something else that does the same kind of thing in
a different way.

Send it to address@hidden if you want it included in Emacs, or
otherwise send it to gnu.emacs.sources so at least others whose usage
pattern is closer to yours can benefit (and/or help you lobby to get it
included somehow).


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]