Subject: bug#3226: here-document syntax inference and completion is broken

From: Paul Nienaber <[email-masked]>
Date: Tue, 15 Oct 2019 15:09:18 -0700

While I use here-strings more than here-docs by a huge margin I would also
like to not negatively impact people using the former a lot, so in light of
that I'd like to suggest going with Stefan's suggestion, importantly
because it's also totally valid to trip on '<<-' and '<<[A-Za-z]', whereas
here-strings are always only '<<<'.  Also '<<EOF' is the overwhelmingly
more common form that I see vs '<< EOF'.

Thanks again for fixing this!

On Fri, Oct 11, 2019 at 12:38 PM Lars Ingebrigtsen <[email-masked]> wrote:

> Stefan Monnier <[email-masked]> writes:
>
> >> A default emacs install will complete with "EOF\n\nEOF" (in a more
> >> clever fashion so the rest of the line is undisturbed), and place the
> >> cursor on the new blank line.  This is incorrect behaviour, as it
> >> breaks entry of BASH here-strings when the user's intent is
> >> still ambiguous.
> >
> > Thanks for your report.  Indeed, sh-mode does not know about
> > here-strings at all.  I guess waiting for "<<[^<]" is a good idea.
> > Patches welcome for Emacs-23.2.
>
> I've now made it look for a space after the << -- that feels more
> natural than << and then some arbitrary character.  And as far as I can
> tell, all the shells handle
>
> foo <<EOF
> EOF
>
> and
>
> foo << EOF
> EOF
>
> identically.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>