Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#70 Comment in/out function and shortcut

Final_Release_(1.0)
closed-fixed
Tino Weinkauf
7
2003-12-08
2002-08-20
Raphael Goubet
No

There should be a "Comment in/out" function, to which a
shortcut should be assigned. It would comment (or
comment out) either the current line, or the selected
lines at one time.

In case of multiple line selection, if some lines are
commented and others are not, commenting should be
switched for each line. This would make it easy to
activate lines and deactivate alternative ones.

Discussion

  • Sven Wiegand
    Sven Wiegand
    2003-04-18

    Logged In: YES
    user_id=310850

    I would prefer three different functions:

    1. 'Comment': This should comment out all selected lines and
    if some of them are already commented out, they won't change.

    2. 'Uncomment': This should uncomment all selected lines and
    if some of them are already no comments, they won't change.

    3. 'Toggle Comment': This should change the
    comment/non-comment state of each selected line, as
    described by raphael.

     
  • Tino Weinkauf
    Tino Weinkauf
    2003-08-11

    Logged In: YES
    user_id=439379

    > 1. 'Comment': This should comment out all selected lines and
    > if some of them are already commented out,
    > they won't change.

    This could bring trouble. Imagine some code like this:

    %My own package
    \usepackage[pdftex]{mypackage}

    If I comment out both lines, I would like to have:

    %%My own package
    %\usepackage[pdftex]{mypackage}

    If not, then uncommenting both lines results in a text not
    meant to be read by latex ("My own package").

    Sometimes one needs to comment out big blocks of text and
    there may be some comments already in there. I don't want to
    look manually for these comments and take care of them.

    So we should say:

    1. 'Comment': This should comment out all selected lines by
    adding a "%"-sign in the first column.
    If some of them are already commented out, they will be
    treated the same way: They get an additional "%"-sign in the
    first column.

    I agree to the rest, but I have 2 questions:

    'Uncomment': How to treat lines, that start with whitespaces
    and the first non-white char is the "%"? I.e.:

    %Some text or command

    Do we uncomment them or not? I would say, that we shouldn't
    uncomment them. Our Comment in/out function should just
    treat the first column of each row. This makes it simple and
    is easy to understand by the user.

    'Uncomment': How to treat lines, that start with more than
    one "%"-sign? I.e.:

    %%% Some text

    I think, we should just delete the first "%"-sign (so 2
    "%"-signs are left). This would go hand in hand with the
    Comment-function described above.

    [We had some user requests for this these days. So I change
    the priority.]

     


Anonymous


Cancel   Add attachments