bugGNU nano - Bugs: bug #42094, filename regex for man pages is...

 
 

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

bug #42094: filename regex for man pages is very broad

Submitter:  Benno Schulenberg <bens>
Submitted:  Thu 10 Apr 2014 08:45:17 PM UTC
   
 
Severity:  3 - Normal Status:  Wont Fix
Assigned to:  None Open/Closed:  Closed

Sat 21 Jun 2014 11:14:57 AM UTC, comment #3: 

Can't think of any way to avoid this, apart from requiring that the word "man" occurs somewhere in the path:

syntax "man" "man.*\.[1-9]x?$"

But that will prevent all files that are edited in the current directory from being recognized as a man page by this regex.  However, when libmagic has not been disabled, it will still work in most cases.  So... is the above acceptable?

Benno Schulenberg <bens>
Group administrator
Fri 16 May 2014 10:15:30 AM UTC, comment #2: 

It works the other way around: the filename regex that is defined last gets matched first.  I still use explicit includes, and moving the 'include man.nanorc' to before the 'include changelog.nanorc' makes all ChangeLog.* files be coloured properly.

When people start using 'include /usr/share/nano/*.nanorc', it may be a good idea to rename man.nanorc to 111man.nanorc, and add a comment in the file as to why it is named that way.

Benno Schulenberg <bens>
Group administrator
Fri 16 May 2014 09:09:58 AM UTC, comment #1: 

What happens is that ChangeLog.1 matches the filename regex for man pages, and thus gets coloured as a man page.  It's just that there is nothing in a changelog that matches manpage commands, so there are no telltale signs.

I finally figured it out after changing the filename regex in changelog.nanorc and seeing that ChangeLog.0 got coloured with my default syntax (which lights up tabs) and ChangeLog.1 not.

But why does ChangeLog.1 get matched sooner by "\.[1-9]x?$" than by "Change[Ll]og.*", when the latter is a better match and the file comes sooner in the alphabet?

Benno Schulenberg <bens>
Group administrator
Thu 10 Apr 2014 08:45:17 PM UTC, original submission:  

When in changelog.nanorc I change the line

  syntax "changelog" "^Change[Ll]og"

to

  syntax "changelog" "Change[Ll]og.*"

it does not work as expected: it does not match for example the file Changelog.1  It does match Changelog.a or Changelog.21 or Changelog.a1, but not any changelog that ends with a period plus a single digit.  Is this a fault in regular expressions on my system?  Or a mistake on nano's part?

Benno Schulenberg <bens>
Group administrator

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-04-02 bens StatusNeed Info Wont Fix
        Open/ClosedOpen Closed
        SummaryFilename regex for man pages is very broad filename regex for man pages is very broad
    2014-06-21 bens StatusNone Need Info
    2014-05-16 bens SummaryFilename regex in syntax is not properly matched Filename regex for man pages is very broad

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code