the program, instead of just a direct call via "/bin/program".
Doing this for Shell scripts, and for Python, Perl and Ruby.
This fixes Savannah bug #43270 reported by Kitty.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5095
35c25a1d-7b9e-4130-9fde-
d3aeb78583b8
+2014-09-21 Benno Schulenberg <bensberg@justemail.net>
+ * doc/syntax/{perl,python,ruby,sh}.nanorc: Recognize also header
+ lines of the form "#!/usr/bin/env thing" besides "#!/bin/thing".
+ This fixes Savannah bug #43270 reported by Kitty.
+
2014-08-29 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (do_justify): Replace the old get_shortcut() wrapper
with the new func_from_key().
## Here is an example for Perl.
syntax "perl" "\.p[lm]$"
-header "^#!.*/perl[-0-9._]*"
+header "^#!.*perl[-0-9._]*"
magic "Perl script text"
color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\>" "\<(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\>" "\<(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\>" "\<(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\>" "\<(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
## Here is an example for Python.
syntax "python" "\.py$"
-header "^#!.*/python[-0-9._]*"
+header "^#!.*python[-0-9._]*"
# Function definitions.
icolor brightblue "def [0-9A-Z_]+"
## Here is an example for Ruby.
syntax "ruby" "\.rb$"
-header "^#!.*/ruby[-0-9._]*"
+header "^#!.*ruby[-0-9._]*"
# Asciibetical list of reserved words.
color yellow "\<(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\>"
## Here is an example for Bourne shell scripts.
syntax "sh" "\.sh$"
-header "^#!.*/(ba|k|pdk)?sh[-0-9_]*"
+header "^#!.*(ba|k|pdk)?sh[-0-9_]*"
magic "(POSIX|Bourne.*) shell script text"
icolor brightgreen "^[0-9A-Z_]+\(\)"