emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Highlight awk syntax in bash files


From: goncholden
Subject: Highlight awk syntax in bash files
Date: Tue, 14 Feb 2023 06:30:03 +0000

I have seen that using bask with a call to awk code does not colour highlight the awk syntax.

It would be highly desirable if emacs could also highlight the awk code enclosed in single quotes.

prax ()
 {
  ## Print coloured function controls

  awk -v fgb="$blu" -v fgw="$wht" -v rst="$sgr"  \
    'BEGIN {
       "tput sgr0" |& getline sgr
       "tput bold; tput setaf 15" |& getline wht
       "tput bold; tput setaf 39" |& getline blu
     }
     /Code:$/ { kl=1 ; next }
     !NF { kl=0 }
     kl { printf("%s%s%s\n", blu, $0, sgr) }
     !kl { printf("%s%s%s\n", wht, $0, sgr) }
    ' <<< "$@"

 }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]