unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Highlight awk syntax in bash files
@ 2023-02-14  6:30 goncholden
  2023-02-14 15:50 ` Yuri Khan
  0 siblings, 1 reply; 3+ messages in thread
From: goncholden @ 2023-02-14  6:30 UTC (permalink / raw)
  To: emacs-devel@gnu.org

[-- 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 --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Highlight awk syntax in bash files
  2023-02-14  6:30 Highlight awk syntax in bash files goncholden
@ 2023-02-14 15:50 ` Yuri Khan
  2023-02-15  4:03   ` goncholden
  0 siblings, 1 reply; 3+ messages in thread
From: Yuri Khan @ 2023-02-14 15:50 UTC (permalink / raw)
  To: goncholden; +Cc: emacs-devel@gnu.org

On Tue, 14 Feb 2023 at 18:58, goncholden <goncholden@protonmail.com> wrote:
>
> 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.

If that is added, people will ask for sed, perl, python, sql, elisp,
and all other syntaxes that can be passed as an argument to any
interpreter. Where do you draw the line?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Highlight awk syntax in bash files
  2023-02-14 15:50 ` Yuri Khan
@ 2023-02-15  4:03   ` goncholden
  0 siblings, 0 replies; 3+ messages in thread
From: goncholden @ 2023-02-15  4:03 UTC (permalink / raw)
  To: Yuri Khan; +Cc: emacs-devel@gnu.org


------- Original Message -------
On Tuesday, February 14th, 2023 at 3:50 PM, Yuri Khan <yuri.v.khan@gmail.com> wrote:


> On Tue, 14 Feb 2023 at 18:58, goncholden goncholden@protonmail.com wrote:
> 
> > 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.
> 
> 
> If that is added, people will ask for sed, perl, python, sql, elisp,
> and all other syntaxes that can be passed as an argument to any
> interpreter. Where do you draw the line?

It is common for shell scripts to call awk and sed.  Congruously, the place to draw the line.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-15  4:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-14  6:30 Highlight awk syntax in bash files goncholden
2023-02-14 15:50 ` Yuri Khan
2023-02-15  4:03   ` goncholden

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).