From: goncholden <goncholden@protonmail.com>
To: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Highlight awk syntax in bash files
Date: Tue, 14 Feb 2023 06:30:03 +0000 [thread overview]
Message-ID: <8YCKs1XB8tbj7KFkc7HckeBDRAmelZcoLg5jGi9OGInF9qe9oOzYxihPYRzS6IEHVBYYLiP6gCvLPH-u3qQrjtRzz5mthKEQQ7pgCOxg9DU=@protonmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 543 bytes --]
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) }
' <<< "$@"
}
[-- Attachment #2: Type: text/html, Size: 2696 bytes --]
next reply other threads:[~2023-02-14 6:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-14 6:30 goncholden [this message]
2023-02-14 15:50 ` Highlight awk syntax in bash files Yuri Khan
2023-02-15 4:03 ` goncholden
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='8YCKs1XB8tbj7KFkc7HckeBDRAmelZcoLg5jGi9OGInF9qe9oOzYxihPYRzS6IEHVBYYLiP6gCvLPH-u3qQrjtRzz5mthKEQQ7pgCOxg9DU=@protonmail.com' \
--to=goncholden@protonmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.