unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Kévin Le Gouguec" <kevin.legouguec@gmail.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: 52496@debbugs.gnu.org, Lars Ingebrigtsen <larsi@gnus.org>,
	Yilkal Argaw <yilkalargawworkneh@gmail.com>
Subject: bug#52496: syntax highlighting problem on emacs shell-script mode
Date: Sun, 19 Dec 2021 16:46:56 +0100	[thread overview]
Message-ID: <87pmpsmwb3.fsf@gmail.com> (raw)
In-Reply-To: <877dc0d53p.fsf@igel.home> (Andreas Schwab's message of "Sun, 19 Dec 2021 15:47:06 +0100")

Andreas Schwab <schwab@linux-m68k.org> writes:

> On Dez 19 2021, Lars Ingebrigtsen wrote:
>
>> Andreas Schwab <schwab@linux-m68k.org> writes:
>>
>>> On Dez 19 2021, Lars Ingebrigtsen wrote:
>>>
>>>> Right.  I haven't real the shell documentation -- is "@" a valid heredoc
>>>> ... separator?
>>>
>>> Any word is.
>>
>> But is @ word constituent?
>
> A shell word can be almost anything.

Relevant part of (bash) Redirections:

>    The format of here-documents is:
>      [N]<<[-]WORD
>              HERE-DOCUMENT
>      DELIMITER
> 
>    No parameter and variable expansion, command substitution, arithmetic
> expansion, or filename expansion is performed on WORD.  If any part of
> WORD is quoted, the DELIMITER is the result of quote removal on WORD,

And (bash) Definitions:

> 'word'
>      A sequence of characters treated as a unit by the shell.  Words may
>      not include unquoted 'metacharacters'.

Preceded by:

> 'metacharacter'
>      A character that, when unquoted, separates words.  A metacharacter
>      is a 'space', 'tab', 'newline', or one of the following characters:
>      '|', '&', ';', '(', ')', '<', or '>'.

(AFAICT the same goes for POSIX sh[1])

So IIUC for here-documents anything is fair game except (1)
{single,double,back} quotes (2) metacharacters (3) backslashes and
comment openers (#); all of which can still be used if quoted or escaped
*on the opening line only*.


[1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_04





  reply	other threads:[~2021-12-19 15:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15  0:35 bug#52496: syntax highlighting problem on emacs shell-script mode Yilkal Argaw
2021-12-19 12:54 ` Lars Ingebrigtsen
2021-12-19 13:30   ` Andreas Schwab
2021-12-19 13:33     ` Lars Ingebrigtsen
2021-12-19 13:57       ` Andreas Schwab
2021-12-19 14:10         ` Lars Ingebrigtsen
2021-12-19 14:47           ` Andreas Schwab
2021-12-19 15:46             ` Kévin Le Gouguec [this message]
2021-12-20  9:46               ` Lars Ingebrigtsen
2021-12-21  4:20                 ` Yilkal Argaw
     [not found]   ` <CAJddU=rbKWaPHBmxAGz-bM4TsziYPOoC5tOJMKpybWOE-GJEPA@mail.gmail.com>
2021-12-19 19:42     ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmpsmwb3.fsf@gmail.com \
    --to=kevin.legouguec@gmail.com \
    --cc=52496@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=schwab@linux-m68k.org \
    --cc=yilkalargawworkneh@gmail.com \
    /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 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).