[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#3226: here-document syntax inference and completion is broken
From: |
Paul Nienaber |
Subject: |
bug#3226: here-document syntax inference and completion is broken |
Date: |
Tue, 15 Oct 2019 23:04:44 -0700 |
Ah yeah totally fair.
Definitely do cover '<<-' as well (=> '<<-EOF\n\nEOF') for the
strip-leading-tabs here-doc behaviour :)
Thanks again.
~Paul
> On Oct 15, 2019, at 18:40, Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
> Paul Nienaber <phox@phox.ca> writes:
>
>> 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'.
>
> The additional wrinkle here is that sh-mode will insert the
> sh-here-document-word when expanding.
>
> So if the user types <<X, what should that be expanded to? Just
> appending EOF would be bad, and replacing the X with EOF would be bad,
> and expanding to
>
> foo <<X
>
> X
>
> would be bad, and prompting for what to expand to would be pretty
> pointless, too.
>
> I guess is "X" is "E", then expanding to
>
> foo <<EOF
>
> EOF
>
> would be nice, though. I think I'll add that.
>
> But I didn't see any way to make the <<[^<] thing work in any intuitive
> way. If anybody has an idea here, I'm all ears.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog: http://lars.ingebrigtsen.no