bugGNU Octave - Bugs: bug #49182, Comment character in GUI editor...

 
 

bug #49182: Comment character in GUI editor should be configurable

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Sun 25 Sep 2016 06:53:17 PM UTC
   
 
Category:  GUI Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 18 Jan 2017 09:29:01 PM UTC, comment #13: 

OK, also verified on qt5 (fine) and pushed here:
http://hg.savannah.gnu.org/hgweb/octave/rev/bd8ea9e44230

Closing report.
Abhinav, thanks for your contribution

Philip Nienhuis <philipnienhuis>
Group Member
Tue 17 Jan 2017 09:38:18 PM UTC, comment #12: 

@Philip: Sure.  If you've reviewed it and it both works and conforms to Octave coding conventions then go ahead and push it.

Rik <rik5>
Group administrator
Tue 17 Jan 2017 09:30:36 PM UTC, comment #11: 

I tried the patch some time now. Works good.

Can this cset be pushed?

Philip Nienhuis <philipnienhuis>
Group Member
Sun 08 Jan 2017 08:01:51 PM UTC, comment #10: 

Works good in Windows as well.

Philip Nienhuis <philipnienhuis>
Group Member
Sun 08 Jan 2017 02:20:21 PM UTC, comment #9: 

Sorry for the delay.

Patch looks good and works good (on Linux) w. Qt4.

Did you try building with Qt5 as well?

Philip Nienhuis <philipnienhuis>
Group Member
Tue 22 Nov 2016 05:33:37 AM UTC, comment #8: 

Hi, could anyone familiar with GUI review the patch I attached in my previous comment please?

Abhinav Tripathi <genuinelucifer>
Tue 08 Nov 2016 06:38:57 AM UTC, comment #7: 

Hi, I am attaching a patch for this. It makes "##" as default comment string and user can change this from the preferences settings dialog. This is my first patch to core octave so I might have missed a few coding guidelines, please review it.

(file #38900)

Abhinav Tripathi <genuinelucifer>
Tue 27 Sep 2016 06:52:03 PM UTC, comment #6: 

I think the intent was always to have this be a std::string option.  The user can then set this to single character ('%', '#') or multi-character ("##") comment strings.  But for the default, why not go with the Octave coding guideline?

Rik <rik5>
Group administrator
Tue 27 Sep 2016 06:15:51 PM UTC, comment #5: 

You certainly have the freedom to make this change and submit it to be included in a future version of Octave.

John W. Eaton <jwe>
Group administrator
Tue 27 Sep 2016 05:49:34 PM UTC, comment #4: 

I would like to opt for the coice between "%" and "#" in this case (no "##"), because it feels more like FREEDOM.

Reasoning:

  • The "##" for line comments is in the Octave coding guideline, i.e. something you should follow in order to CONTRIBUTE to the Octave SOURCE CODE. But there are probably many more people around, who use Octave, but do not contribute to its source code.
  • Any number of "#" is officially allowed by the Octave LANGUAGE (and any number of "%" as well).
  • If the GUI editor would insist on "##" instead of "#", then we would keep people who are using "#" for this purpose  from using the Ctrl+R shortcut.(Just imaging you remove many #s with Shift-Ctrl-R, and when you try to restore them with Ctrl-R then use realise that this is "forbidden" by the editor. Not so nice a feeling, no freedom.)
  • On the other side, if the GUI editor uses "#", then anyone who wants "##" instead, can still press Ctrl+R twice.


Just my penny.

Hartmut <hardy>
Tue 27 Sep 2016 04:29:17 PM UTC, comment #3: 

I slightly agree with Rik, yet I can't imagine having to press <Ctrl>-r twice to be a big deal ;-)

Philip Nienhuis <philipnienhuis>
Group Member
Mon 26 Sep 2016 07:17:11 PM UTC, comment #2: 

<Ctrl>-R is used for commenting out whole lines.  So, for Octave, it would be convenient to make this "##".

Rik <rik5>
Group administrator
Mon 26 Sep 2016 07:11:46 PM UTC, comment #1: 

This looks easy to change, and probably easy to hook up to a preference setting should someone familiar with Qt wish to do that.

The comment prefix is configured here:

http://hg.savannah.gnu.org/hgweb/octave/file/d16d38338077/libgui/src/m-editor/file-editor-tab.cc#l775

It's already file-type dependent, so just needs a switch to set the user's preference to be Matlab-compatible or not. Any preference for "##" vs a single "#"?

Mike Miller <mtmiller>
Group Member
Sun 25 Sep 2016 06:53:17 PM UTC, original submission:  

AFAIK the GUI editor can only insert "%" as a comment character e.g., when invoking <Ctrl>-R.  That is, I haven't been able to find a relevant setting to change it into "#".

I think it should at least be possible to set it to "#" to be "Octave-compatible"; or maybe even "//" for editing .cc & .cpp files.


Philip Nienhuis <philipnienhuis>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #38900:  commit_string.diff added by genuinelucifer (5KiB - text/x-patch - Patch for this bug)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by genuinelucifer (Updated the item)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by hardy
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by philipnienhuis (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-01-18 philipnienhuis StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2017-01-08 philipnienhuis StatusConfirmed Ready For Test
    2016-11-08 genuinelucifer Attached File- Added commit_string.diff, #38900
    2016-09-26 hardy Carbon-Copy- Added hardy
    2016-09-26 mtmiller Severity3 - Normal 1 - Wish
        Priority5 - Normal 3 - Low
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code