[Geany-devel] Changes to templates

Lex Trotman elextr at xxxxx
Wed Mar 16 10:25:02 UTC 2011


On 16 March 2011 20:57, Thomas Martitz
<thomas.martitz at student.htw-berlin.de> wrote:
> On 16.03.2011 00:29, Lex Trotman wrote:
>>
>>>>>>> Fix filetypes.c to use /* */ style comments rather than C++ style
>>>>>>> comments.
>>>>>>
>>>>>> I'd personally agree with this change, but it has a drawback:
>>>>>> multi-line
>>>>>> C comments can't be nested. So the comment/un-comment command becomes
>>>>>> a
>>>>>> little less useful since it'd break if commenting stuff including
>>>>>> comments.
>>
>> My Geany comments C code with // so nesting can be infinite and that
>> makes function headers as /* comments */ fine and works on C99 +
>> compilers and the inserted function headers work on all compilers.
>>
>> When compilers won't let you use // to comment out blocks and you
>> can't nest /* comments */ then thats a limitation of that version of
>> the language and no matter what Geany does you will always have to
>> comment around other comments.
>>
>> So I'd agree with Matthew that the built in functionality should
>> support the lowest common denominator.
>
>
> FWIW, C99 is the current standard in effect, since more than a decade
> already, and thus //-style comments are perfectly valid. It's not Geany's
> fault if you can't use them.

As above agree.

>
> For CTRL+E, it's user configurable even, isn't it? Then I see no problem.
> But defaulting to //-style seems sane because it's very annoying to work
> around the nested comment problem.

IIUC its the filetype comment_open and (for multiline) comment_close
options that set what ctrl-E uses, but those are also what are used to
comment the templates.

We need a new option to be able to separate /* commented */ templates
and ctrl-E using //

Cheers
Lex

>
> But for templates /* */-style should be used, I agree.
>



More information about the Devel mailing list