Hello Bernward,

I checked the regexes and could not find any clou, that the regex for awk could
catch shell scripts:

Okay.

If a wrong regex would be the cause of the problem, the effect should be a wrong
syntax highlighting, but not just _no_ highlighting.

Correct.

To figure out what is going wrong, please move your /etc/nanorc and your .nanorc
to a safe place, and then force a reinstall of nano.  This should put a correct
/etc/nanorc back into your filesystem.  Check whether shell scripts are colored
correctly now.  If yes, then again make your one-line .nanorc, that does an 
include
of your self-made awk.nanorc.  Then check again if shell scripts get colored 
okay.
If not, then please show me the exact contents of your .nanorc, your awk.nanorc,
and your /etc/nanorc.

(I have just run 2.2.6, and when I use your one-line .nanorc, shell scripts 
still
get colored fine, so... it's not a fault in 2.2.6 proper.  But... now I see that
your nano has a strange version number: 2.2.6-1+b1.  That version I cannot find
anywhere in Debian.  The only 2.2.6 version is in oldstable, and that is 2.2.6-3
(https://packages.debian.org/source/oldstable/nano).  So...  Did you compile 
nano
yourself?  Or are you on something else than plain Debian?)

In the meantime, I found two things which seem noteworthy, one information and
one rumour:

1) on the nano home page, the recommendation for the current version 2.8 to 
build
a user specific .nanorc still suggests to copy the sample.nanorc to start with,
which is the same as copying /etc/nanorc

It is only the same as copying /etc/nanorc, because distros copy the sample 
rcfile
to /etc/nanorc.  Which is good -- it should be the recommended practice.

[https://www.nano-editor.org/dist/v2.8/faq.html#3.9a]. This means, that puting
only selected commands in .nanorc ist _not_ recommended.

No, one shouldn't read it like that.  That FAQ item was written long ago; I will
change it to say one should read 'man nanorc' and then edit ~/.nanorc and put
there just the few settings that one wants.  I suppose that the recommendation
to copy the sample.nanorc file to ~/.nanorc was made just so that you don't need
to have two terminals open side-by-side but have all the data right there in one
file and you can just throw away what you don't need and uncomment the things
that you want.  But I never did it that way.  I always just put the settings
that I needed into ~/.nanorc, like set boldtext, set nowrap, set smooth, and
set quickblank.

2) On https://github.com/nanorc/nanorc I found an anonymous rumour: „There
appears to be a bug in older versions of nano that causes highlighting to fail
when /etc/nanorc and ~/.nanorc both contain syntax rules. The usual workaround 
is
to remove all syntax and include commands from one file or the other, or to use 
a
newer version of nano.“ But I could not find a reference for this statement nor 
a
version, for which it should be valid.
I suspect that that rumour was caused by your bug report three years ago.  :)

Let's find out where things go wrong by first making your situation as standard
as possible, as described above, and then making small modifications.

Regards,

Benno

Reply via email to