From: Jorge Godoy on
rx wrote:

> I have commented out a lot of C++ code and miss the block feature in
> python more than I missed the nested comments in C++.
> Besides nothing really strange happened.
> Sometimes you just need to dissable some of the code temporarly as quickly
> as possible, and I like that it is not higlighted any more, since I will
> not look into it before I dissable the comment.

This is how I do it: select the lines I want to comment and ask Emacs to
comment that region. It is the same command and method for "n" different
languages and I don't care if there is multiline comment support or not.
It is really as fast as inserting /* and ending with */ (in fact, I type
less than to achieve that since I only use three keys, counting the
Ctrl-Space to start the block).

--
Jorge Godoy <godoy(a)ieee.org>

"Quidquid latine dictum sit, altum sonatur."
- Qualquer coisa dita em latim soa profundo.
- Anything said in Latin sounds smart.
From: Jorge Godoy on
rx wrote:

>
> "Jorge Godoy" <godoy(a)ieee.org> wrote in message
> news:2145108.A1WUCsNlIN(a)jupiter.g2ctech...
>> Edward Elliott wrote:
>>
>
>>
>> You can use either """ or '''. I don't keep changing them in my code, so
>> I
>> can always use the other type (usually I use " so for commenting things
>> out
>> I'd use ') to do that.
>>
>
> Try that on this code:
>
> a=3
> a=a*a
> b='''This is a
> very long
> long
> text'''
> print a
>
>
> like:
>
> a=3
> '''
> a=a*a
> b='''This is a
> very long
> long
> text'''
> '''
> print a
>
>
>
> raises SyntaxError

Of course! You should have used """ since you already used ''' in your
triple-quoted text. But I'm just repeating what I already said (and kept
above so that you can see it again).

--
Jorge Godoy <godoy(a)ieee.org>

"Quidquid latine dictum sit, altum sonatur."
- Qualquer coisa dita em latim soa profundo.
- Anything said in Latin sounds smart.
From: rx on



"Jorge Godoy" <godoy(a)ieee.org> wrote in message
news:1296658.ifSUO08S9I(a)jupiter.g2ctech...
> rx wrote:
>
>> I have commented out a lot of C++ code and miss the block feature in
>> python more than I missed the nested comments in C++.
>> Besides nothing really strange happened.
>> Sometimes you just need to dissable some of the code temporarly as
>> quickly
>> as possible, and I like that it is not higlighted any more, since I will
>> not look into it before I dissable the comment.
>
> This is how I do it: select the lines I want to comment and ask Emacs to
> comment that region. It is the same command and method for "n" different
> languages and I don't care if there is multiline comment support or not.
> It is really as fast as inserting /* and ending with */ (in fact, I type
> less than to achieve that since I only use three keys, counting the
> Ctrl-Space to start the block).

It would be much nicer to have it in the language since there are many
editors and many ways to do what you do (it would also make it more easy to
make a editor).
Besides it could be done with two keys if that really important - but I
doubt it.
But in a way you are also right if you use more than a few languages in the
same editor, but then again the editor would still be able to do the
commenting if you prefered that.
I don't understand the problem - why should comments (and I hope you believe
there should be a one line comment at least) be restricted to one line.
It doesn't work that way for if, while, for.


From: Jorge Godoy on
rx wrote:

> I don't understand the problem - why should comments (and I hope you
> believe there should be a one line comment at least) be restricted to one
> line. It doesn't work that way for if, while, for.

It is the minimum case that can solve a problem commenting one line -- or
part of it as in "print '3' # print the number 3" -- or commenting multiple
lines. It is also easier to deal with since you don't have to end your
comment all the time.

For "if", "while", "for", etc. you have ":" and the indentation. You don't
have an "endif", "endwhile", "endfor" (so, why having an "end comment"?).

--
Jorge Godoy <godoy(a)ieee.org>

"Quidquid latine dictum sit, altum sonatur."
- Qualquer coisa dita em latim soa profundo.
- Anything said in Latin sounds smart.
From: rx on

>
> Of course! You should have used """ since you already used ''' in your
> triple-quoted text. But I'm just repeating what I already said (and kept
> above so that you can see it again).
>
> --
> Jorge Godoy <godoy(a)ieee.org>
>

Sorry - I should have read more carefully.
I like the idea and will use it I think.
Still a little strange to newcomers that there are three ways to do the same
and that you should be carefull to use the right '''/""" inside the comment
else the comment will not work for some reason.

#comment

'''
comment
'''

"""
comment
"""


First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7 8 9
Prev: how do you pronounce 'tuple'?
Next: A Unicode problem -HELP