bugGNU nano - Bugs: bug #55435, [Request] allow quotestr to be...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #55435: [Request] allow quotestr to be changed per syntax definition

Submitter:  David Griffith <dgriffi>
Submitted:  Thu 10 Jan 2019 10:52:34 AM UTC
   
 
Severity:  1 - Wish Status:  Wont Fix
Assigned to:  None Open/Closed:  Closed

Jump to the original submission

Fri 15 Mar 2019 06:14:37 PM UTC, comment #11: 

Closing, as the default quoting regex has been extended, and the documentation has been changed to mention what it can be used for.

Benno Schulenberg <bens>
Group administrator
Thu 24 Jan 2019 06:58:50 AM UTC, comment #10: 

Works for me.  Thanks for accepting the changes.

David Griffith <dgriffi>
Wed 23 Jan 2019 07:06:41 PM UTC, comment #9: 

Thanks for the patches.  I have, however, opted for a much conciser wording.  See commit 2eb19605.

Benno Schulenberg <bens>
Group administrator
Wed 23 Jan 2019 04:30:21 PM UTC, comment #8: 

Another patch to clean up the blurbs.  Please add both patches and then squash/fixup as you see fit.

(file #46079)

David Griffith <dgriffi>
Wed 23 Jan 2019 04:11:46 PM UTC, comment #7: 

In the patch I uploaded, I didn't notice that you already changed the default regex.  I was operating under the assumption that none of those changes would be made, that I would just add commentary on how useful quotestr is to rejustifying blocks of line comments.  I'll upload a new patch to clean up that mess.

David Griffith <dgriffi>
Wed 23 Jan 2019 04:05:09 PM UTC, comment #6: 

Patch attached.

(file #46078)

David Griffith <dgriffi>
Tue 22 Jan 2019 07:16:33 PM UTC, comment #5: 

The proposed expansion of the quoting regex has been pushed to master, commit c5a72103.

I'm waiting for your patch to improve the documentation of the quoting regex.

Benno Schulenberg <bens>
Group administrator
Tue 15 Jan 2019 05:12:54 PM UTC, comment #4: 

After doing:

  grep -h ^comment syntax/*rc | sort -u

I suggest changing the default quoting regex to:

  "^([ \t]*([!#%:;>|}]|/{2}|--))+"

This would additionally cover comment blocks in Fortran, TeX, Lisp, Lua, and Postgress.  Not much, but... a bit better than just C plus all the languages that use #.  What do you say?

Benno Schulenberg <bens>
Group administrator
Mon 14 Jan 2019 07:45:28 PM UTC, comment #3: 

Setting the quotestr per syntax is not needed, and a patch for that will not be accepted.  But you are welcome to submit a patch describing how quotestr can be used to enable rewrapping a block of comment lines.

Benno Schulenberg <bens>
Group administrator
Fri 11 Jan 2019 11:03:53 PM UTC, comment #2: 

Not the double-slash comments, but hashmarks.  Whenever I needed a block of comments in a language that used those, I used the begin/end type of comments (ie, "/*" and "*/".

https://en.wikipedia.org/wiki/Comment_(computer_programming) describes a bunch of common and uncommon comment characters.

For Fortran IV, I intended that to be viewed as a regular expression, not as a control modifier, because it works only if 'C' is in the first column.

For your suggested solution, I did an abbreviated version of that already.  I'd be happy to implement and upload a patch implementing quotestr per syntax.  If that's not acceptable, how about if I edit the manpage to talk about using quotestr for block comments?

David Griffith <dgriffi>
Fri 11 Jan 2019 06:43:32 PM UTC, comment #1: 

Comment blocks that start with "//" (double slash) have become justifiable only last June, so when you're saying you've been doing this for a long time, this makes me wonder.

Anyway, I don't think it is needed to define quotestr per syntax.  I think it is enough if the user sets the desired in their nanorc, adding any characters to the regex that can start a comment.

So, instead of the default regex of

"^([ \t]*([#:>|}]|//))+"

you could use:

"^([ \t]*([#:>|}%!;]|//|REM|--|\'))+"

Does this work for you?

(Does Fortran really use control-C (0x03) as a comment introducer?)

Benno Schulenberg <bens>
Group administrator
Thu 10 Jan 2019 10:52:34 AM UTC, original submission:  

It would be nice be able to do "set quotestr" or some equivalent within a syntax definition.

For a long time, I used ^J to re-justify a block of comments in programming languages that use "#" and "//" as comment markers that mark off the rest of the line.  It just worked and I didn't think much of it.  Now I'd like to re-justify blocks commented with '%' (TeX, LaTeX, etc), '!' (Inform6, Xresources, Fortran90, Cisco stuff, etc), ';' (some assembly languages), "REM" (old BASIC stuff), '\'' (newer BASIC stuff), "--" (ADA, Haskell, etc), and "^C" (Fortran IV) to name a few.

If nobody else wants to do it, I'll do it.

David Griffith <dgriffi>

 

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

Attached Files
file #46079:  quotestr-2.patch added by dgriffi (5KiB - text/x-patch)
file #46078:  quotestr.patch added by dgriffi (4KiB - text/x-patch - Patch to add to documentation discussion of rejustifying blocks of line comments.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by dgriffi (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.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-15 bens Open/ClosedOpen Closed
    2019-01-23 dgriffi Attached File- Added quotestr-2.patch, #46079
    2019-01-23 dgriffi Attached File- Added quotestr.patch, #46078
    2019-01-14 bens StatusNone Wont Fix
        Summary{Request] allow quotestr to be changed per syntax definition [Request] allow quotestr to be changed per syntax definition
    2019-01-11 bens Severity3 - Normal 1 - Wish
        SummaryAllow quotestr to be changed per syntax definition {Request] allow quotestr to be changed per syntax definition

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code