From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Nienaber Newsgroups: gmane.emacs.bugs Subject: bug#3226: here-document syntax inference and completion is broken Date: Tue, 15 Oct 2019 15:09:18 -0700 Message-ID: References: <4A00BA64.7080700@phox.ca> <87eezjm5ss.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000fea4fd0594fa3c50" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="63776"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 3226@debbugs.gnu.org, Stefan Monnier To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 16 01:09:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iKVwF-000GS8-RC for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Oct 2019 01:09:11 +0200 Original-Received: from localhost ([::1]:33094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKVwE-0003xB-Nz for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Oct 2019 19:09:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42859) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKVw7-0003uL-MM for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2019 19:09:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iKVw6-0002ki-9q for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2019 19:09:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36192) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iKVw5-0002kX-RL for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2019 19:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iKVw5-0006Ek-KX for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2019 19:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Nienaber Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Oct 2019 23:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 3226 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 3226-submit@debbugs.gnu.org id=B3226.157118088523904 (code B ref 3226); Tue, 15 Oct 2019 23:09:01 +0000 Original-Received: (at 3226) by debbugs.gnu.org; 15 Oct 2019 23:08:05 +0000 Original-Received: from localhost ([127.0.0.1]:45013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iKVvA-0006DT-PN for submit@debbugs.gnu.org; Tue, 15 Oct 2019 19:08:05 -0400 Original-Received: from mail-qk1-f179.google.com ([209.85.222.179]:42594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iKV0Z-0004gM-BI for 3226@debbugs.gnu.org; Tue, 15 Oct 2019 18:09:36 -0400 Original-Received: by mail-qk1-f179.google.com with SMTP id f16so20792414qkl.9 for <3226@debbugs.gnu.org>; Tue, 15 Oct 2019 15:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=phox-ca.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UQqafl8+mh5UH8itBKTBmVonPERWOWj437zteWU1PcE=; b=Ax76pyoZGosgmMLCEMUxqtjwcP1d8YcTS0MA+f6e0cdpMcD+ZDkjPOoKNL48Agbs+W BlOH13MqEX1MOfvYFX36N6vCTnB9I1+P2GmdfBnx9DwTKB7LJmbhgHiM+NvxKztNCaXX oMA+7fYN+Q39I91KQZMIacz//pqNFrVLA/57f4xMLqVcTDR+JprH/mmoCaQCVgZjONxf zJufLBRvEX6+ZsdCoRW77EU3HYOb3SzXyL8tM8bZ30xy5klpTuWPD3Y9Kg7vk7HAPcoT JxW/chPrQU50Xcu2onhxX9kp0WU6ZZ74/Um0i5kSj/6cshsqbcCoBmVjWVVl4M6RTZqH hyyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UQqafl8+mh5UH8itBKTBmVonPERWOWj437zteWU1PcE=; b=Dn8LJXUYy2RT1F0vvuJWwsdRNxDFImGf6dQO99H5iYtwavtuIMH0Ma01HIj20AspBe oDi8LwZuJQe7P00dc76cdbVxK7r2l5xfvxlpMyhu5Da2mWS6N+dqb+4blq29iZQXBfuh f+rKm3dn97+5btFp4fxTQMYFwGESx2qr3+CWVGDxpzJQPTx26h3rnIg2dLPwmFG6Mi09 208r7HqKLjmBZks9WO2OJiy7M+cNxY/Oejl7Q+izCYMbX5asxg4jmkK40tGSUf/bbs4H viCyjjO3qSTFq/fhIUA4wtzQ9sxPK7VvtkbhUGqCZ6LUeZzihbkiQsH4GviMXzKHhIV0 qSOQ== X-Gm-Message-State: APjAAAWR0KqXJ/OTSCk2cIdv4eT5FGnctwyAeRhRbJxhdrDBV7GO+GgU 9gPmH833RMUzxQ62CvfQPFbfzmHRz/NNAphK2qqwcQ== X-Google-Smtp-Source: APXvYqyoKXcS6W4QT5udvs1Sa1XLjuiP63UCOvWb4qWUuHBFXD1l1wS/IrRnS3p8aNKV3ir0cHBMG3FWnSYMGJ57kEc= X-Received: by 2002:ae9:f204:: with SMTP id m4mr35193935qkg.300.1571177369603; Tue, 15 Oct 2019 15:09:29 -0700 (PDT) In-Reply-To: <87eezjm5ss.fsf@gnus.org> X-Mailman-Approved-At: Tue, 15 Oct 2019 19:08:03 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:169405 Archived-At: --000000000000fea4fd0594fa3c50 Content-Type: text/plain; charset="UTF-8" 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 '< wrote: > Stefan Monnier 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 > > and > > foo << EOF > EOF > > identically. > > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no > --000000000000fea4fd0594fa3c50 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
While I use here-strings more than here-docs by a huge mar= gin I would also like to not negatively impact people using the former a lo= t, so in light of that I'd like to suggest going with Stefan's sugg= estion, importantly because it's also totally valid to trip on '<= ;<-' and '<<[A-Za-z]', whereas here-strings are always= only '<<<'.=C2=A0 Also '<<EOF' is the overw= helmingly more common form that I see vs '<< EOF'.

Thanks again for fixing this!

On Fri, Oct 11, 2019 at 12:38 P= M Lars Ingebrigtsen <larsi@gnus.org> wrote:
Ste= fan Monnier <monnier@iro.umontreal.ca> 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.=C2=A0 This is incorrect behaviour, a= s it
>> breaks entry of BASH here-strings when the user's intent is >> still ambiguous.
>
> Thanks for your report.=C2=A0 Indeed, sh-mode does not know about
> here-strings at all.=C2=A0 I guess waiting for "<<[^<]&q= uot; 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.=C2=A0 And as far a= s I can
tell, all the shells handle

foo <<EOF
EOF

and

foo << EOF
EOF

identically.

--
(domestic pets only, the antidote for overdose, milk.)
=C2=A0 =C2=A0bloggy blog: http://lars.ingebrigtsen.no
--000000000000fea4fd0594fa3c50--