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.

I did this with apt-get purge and apt-get install, /etc/nanorc is identical
with the backup.

  Check whether shell scripts are colored
correctly now.

They are, tested for two shell scripts with one example for filename-ending
recognition and one example for header recognition.

  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.

Both examples dont get colored any more.
I append the requested files, as well as both examples.

Okay.  I can reproduce when using your /etc/nanorc and ~/.nanorc.
Then I slowly reduced /etc/nanorc to the following two lines:

  include "/usr/share/nano/awk.nanorc"
  include "/usr/share/nano/sh.nanorc"

Any script.sh file still does not get any color on its keywords.
Now swap those two lines, save, and try again.  Hey!  Color!

Yes, apparently there was a bug in 2.2.6 (and a few versions
after it).  I don't know when exactly it was fixed (and I don't
remember having noticed this exact bug), but apparently nano
forgets about some or all syntaxes that were defined /after/
a syntax that is /redefined/ later.  You can also "obscure"
the shell syntax by doing for example:

  include "/usr/share/nano/python.nanorc"
  include "/usr/share/nano/sh.nanorc"
  include "/usr/share/nano/python.nanorc"

You can prevent this obscuring by deleting from /etc/nanorc
any syntax that you redefine later.

You could also prevent this by simply giving your awk syntax
a different name.  Not the file, but the syntax.  For example:

  syntax "WAAK" ...

As long as the file regex and header regex catch all your awk
and gawk and mawk files, it will work.  The name is just meant
so you can force a syntax on the command line: --syntax=python.

Benno

Reply via email to