bugGNU nano - Bugs: bug #65779, [Wish] an option to display all...

 
 

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

bug #65779: [Wish] an option to display all available syntax names

Submitter:  davidhcefx <davidhcefx>
Submitted:  Thu 23 May 2024 10:15:07 AM UTC
   
 
Severity:  1 - Wish Status:  Fixed
Assigned to:  bens Open/Closed:  Closed

Jump to the original submission

Sat 13 Jul 2024 08:51:55 AM UTC, comment #6: 

The feature was released in nano-8.1.

The fix was released in nano-8.1.  Thanks again for reporting.

Benno Schulenberg <bens>
Group administrator
Fri 31 May 2024 09:49:34 AM UTC, comment #5: 

You’re welcome, glad to hear that!

davidhcefx <davidhcefx>
Fri 31 May 2024 09:30:26 AM UTC, comment #4: 

Option -z/--listsyntaxes was added to git in commit 49c2f5de.  Thanks for the suggestion.

Benno Schulenberg <bens>
Group administrator
Sat 25 May 2024 01:19:48 PM UTC, comment #3: 

A proposed patch was mailed to the devel list: https://lists.gnu.org/archive/html/nano-devel/2024-05/msg00026.html.

A slightly adjusted version is attached here.


(file #56102)

Benno Schulenberg <bens>
Group administrator
Thu 23 May 2024 02:11:22 PM UTC, comment #2: 

Well, I couldn't resist implementing this, tentatively -- see attached patch.  For now it only has a short option: -z.

(file #56096)

Benno Schulenberg <bens>
Group administrator
Thu 23 May 2024 11:41:44 AM UTC, comment #1: 

In theory it would be nice if nano could list all available syntax names.  But... how often does one need to specify the syntax explicitly?  The average user: never, I guess.

If you need to do this somewhat regularly, why not create a little script?  Something like:

grep -o "^syntax \w\+" /usr/share/nano/*rc | grep -o "\w\+$"


(Syntax names are always all lowercase -- at least those provided by nano itself.)

Benno Schulenberg <bens>
Group administrator
Thu 23 May 2024 10:15:07 AM UTC, original submission:  

There is the -Y option for nano:


 -Y <name>      --syntax=<name>         Syntax definition to use for coloring


However, every time I wish to apply a specific syntax to the target file, I cannot remember what's the correct name of it. So I have to keep guessing (Is it capitalized, or is it under another name?), until I finally gave up and grep in the /usr/share/nano/ folder. Do you also consider it helpful if there's an option to list all the defined syntax names?

davidhcefx <davidhcefx>

 

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

 

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 davidhcefx (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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-07-13 bens Open/ClosedOpen Closed
    2024-05-31 bens StatusReady for test Fixed
    2024-05-25 bens Attached File- Added 0001-new-feature-option-z-lists-the-names-of-available-sy.patch, #56102
        StatusNone Ready for test
        Assigned toNone bens
    2024-05-23 bens Attached File- Added available-syntaxes.patch, #56096
    2024-05-23 bens Severity3 - Normal 1 - Wish
        Summary[Wish] Option to display all available syntax names [Wish] an option to display all available syntax names

    Back to the top

    Powered by Savane 3.13-e652.
    Corresponding source code