bugGNU Octave - Bugs: bug #52695, Uncomment should work with any...

 
 

bug #52695: Uncomment should work with any kind of comment

Submitted by:  Marshall <marsian>
Submitted on:  Tue 19 Dec 2017 06:07:36 PM UTC  
 
Category: GUISeverity: 3 - Normal
Priority: 5 - NormalItem Group: Feature Request
Status: NoneAssigned to: Torsten <ttl>
Originator Name: MarsianOpen/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 19 Dec 2017 10:58:01 PM UTC, comment #4:

The original poster wrote:

"
(It would also be nice if there were a separate test-comment-command that could create %! type comments, but maybe that's better for a different feature request)
"

I see that

[BTW, note that in the submenu in which the above appears, there are three entries with the U shortcut key selection.]

Another thing that could be done to address the above would be a new code sequence

in which the Ctrl+Alt+R will pop up a dialog box with a radio button list (or some similar construct) having

and once a person clicks the choice, it's that comment character that is selected.

So, one could do Ctrl+R to get their favorite comment character (% or whatever preference set up) and then to get %! it would be a slightly slower process of Ctrl+Alt+R and a few down-arrow keystrokes and ENTER. A radio button, drop-down list, etc. should all have close to the same sort of action as far as keyboard input goes.

Dan Sebald <sebald>
Tue 19 Dec 2017 09:45:36 PM UTC, comment #3:

Good idea (original post and the preference entry). I will take care of it.

Torsten <ttl>
Project MemberIn charge of this item.
Tue 19 Dec 2017 06:50:06 PM UTC, comment #2:

I like your suggestion to add %! as a "test comment". Especially to be able to uncomment test blocks.

Note that there's an easy workaround by just commenting in matlab style twice, select the test lines and then search/replace %% by %! in the selection, or %! by "" (empty).

Philip Nienhuis <philipnienhuis>
Project Member
Tue 19 Dec 2017 06:40:09 PM UTC, comment #1:

Could have a preference entry for

in which only one radio button is selectable. And then also

in which multiple radio buttons are selectable.

This comment/uncomment character only applies to the first non-whitespace character of a line, correct?

Dan Sebald <sebald>
Tue 19 Dec 2017 06:07:36 PM UTC, original submission:

In the new dev version, there is an editor preference for setting the desired comment symbol to insert (%, #, or ##). Uncomment works only with the selected comment option. I think the uncomment command should work with any type of comment. As a bonus it could also work with %! which is found in the tests. (It would also be nice if there were a separate test-comment-command that could create %! type comments, but maybe that's better for a different feature request).

This is useful for working with code that may not have the preferred commenting style, and where I might want to uncomment large blocks of code (or tests).

At a minimum I think uncommenting should work with both % and #, whether or not it works with ## (which is just # twice) or %!.

As a possible counter-argument, I can see the value of not having uncommenting working with both # and %, maybe to allow the non-default comment to be a permanent-comment that persists in a large section of commented code with valid non-code comments. If that is a desirable feature I would recommend adding another uncomment-all command so that either simple uncomment could be used (only un-commenting the default), and/or uncommenting independent of the option. I'm not sure which key-commands I'd suggest, maybe leaving it blank for optional assignment, since I have re-assigned some of the key commands from the octave defaults anyways.

Marshall <marsian>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ttl (Posted a comment)
  • -unavailable- added by sebald (Posted a comment)
  • -unavailable- added by marsian (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 19 Dec 2017 09:45:36 PM UTCttlAssigned toNone=>ttl
      Operating SystemMicrosoft Windows=>Any

    Back to the top


    Powered by Savane 3.1-cleanup1