* bug#72745: `bash-mode` doesn't recognize comments inside command substitution
@ 2024-08-21 13:02 shynur .
2024-08-24 9:19 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: shynur . @ 2024-08-21 13:02 UTC (permalink / raw)
To: 72745
Reproduce:
1. echo -e 'echo $(echo 42 # print 42)\n)' > /tmp/a.bash
Content of `/tmp/a.bash`:
echo $(echo 42 # print 42)
)
2. emacs -Q, version 29.4
3. eval: (set-face-italic font-lock-comment-face t)
4. Open file `/tmp/a.bash`.
Only the first `)` is italic; "# print 42" is not.
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#72745: `bash-mode` doesn't recognize comments inside command substitution
2024-08-21 13:02 bug#72745: `bash-mode` doesn't recognize comments inside command substitution shynur .
@ 2024-08-24 9:19 ` Eli Zaretskii
2024-08-24 15:12 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2024-08-24 9:19 UTC (permalink / raw)
To: shynur ., Stefan Monnier; +Cc: 72745
> From: "shynur ." <one.last.kiss@outlook.com>
> Date: Wed, 21 Aug 2024 13:02:24 +0000
>
> Reproduce:
> 1. echo -e 'echo $(echo 42 # print 42)\n)' > /tmp/a.bash
> Content of `/tmp/a.bash`:
> echo $(echo 42 # print 42)
> )
> 2. emacs -Q, version 29.4
> 3. eval: (set-face-italic font-lock-comment-face t)
> 4. Open file `/tmp/a.bash`.
>
> Only the first `)` is italic; "# print 42" is not.
I'm not sure this is not the right behavior.
Does anyone else have an opinion here?
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#72745: `bash-mode` doesn't recognize comments inside command substitution
2024-08-24 9:19 ` Eli Zaretskii
@ 2024-08-24 15:12 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-24 15:28 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-08-24 15:12 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: shynur ., 72745
>> Reproduce:
>> 1. echo -e 'echo $(echo 42 # print 42)\n)' > /tmp/a.bash
>> Content of `/tmp/a.bash`:
>> echo $(echo 42 # print 42)
>> )
>> 2. emacs -Q, version 29.4
>> 3. eval: (set-face-italic font-lock-comment-face t)
>> 4. Open file `/tmp/a.bash`.
>>
>> Only the first `)` is italic; "# print 42" is not.
>
> I'm not sure this is not the right behavior.
> Does anyone else have an opinion here?
Too many "not"s in one sentence, and too many nested "echo"s in
the other.
But when I try to run
#!/bin/bash
echo $(echo 42 # print 42)
)
echo there
it returns
42
there
as expected. IOW, I agree with the title of this bug report (and in my
test, Emacs doesn't highlighted any part of that script with the comment face).
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#72745: `bash-mode` doesn't recognize comments inside command substitution
2024-08-24 15:12 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-08-24 15:28 ` Eli Zaretskii
0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2024-08-24 15:28 UTC (permalink / raw)
To: Stefan Monnier; +Cc: one.last.kiss, 72745
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: "shynur ." <one.last.kiss@outlook.com>, 72745@debbugs.gnu.org
> Date: Sat, 24 Aug 2024 11:12:06 -0400
>
> >> Reproduce:
> >> 1. echo -e 'echo $(echo 42 # print 42)\n)' > /tmp/a.bash
> >> Content of `/tmp/a.bash`:
> >> echo $(echo 42 # print 42)
> >> )
> >> 2. emacs -Q, version 29.4
> >> 3. eval: (set-face-italic font-lock-comment-face t)
> >> 4. Open file `/tmp/a.bash`.
> >>
> >> Only the first `)` is italic; "# print 42" is not.
> >
> > I'm not sure this is not the right behavior.
> > Does anyone else have an opinion here?
>
> Too many "not"s in one sentence, and too many nested "echo"s in
> the other.
>
> But when I try to run
>
> #!/bin/bash
> echo $(echo 42 # print 42)
> )
> echo there
>
> it returns
>
> 42
> there
>
> as expected. IOW, I agree with the title of this bug report (and in my
> test, Emacs doesn't highlighted any part of that script with the comment face).
FWIW, I tried bash-ts-mode, and it doesn't show the comment face
there, either.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-08-24 15:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-21 13:02 bug#72745: `bash-mode` doesn't recognize comments inside command substitution shynur .
2024-08-24 9:19 ` Eli Zaretskii
2024-08-24 15:12 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-24 15:28 ` Eli Zaretskii
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).