From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#3226: here-document syntax inference and completion is broken Date: Sun, 14 Feb 2016 14:44:58 +0000 Message-ID: References: <87ab1z26m3.fsf@cyd.mit.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114b0bec55352a052bbbf286 X-Trace: ger.gmane.org 1455461181 7510 80.91.229.3 (14 Feb 2016 14:46:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Feb 2016 14:46:21 +0000 (UTC) Cc: Paul Nienaber , 3226@debbugs.gnu.org To: Andrew Hyatt , Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 14 15:46:12 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aUxwA-0005Dm-SK for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Feb 2016 15:46:11 +0100 Original-Received: from localhost ([::1]:51140 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUxw9-0003xy-Ua for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Feb 2016 09:46:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60889) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUxw6-0003xn-8q for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 09:46:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aUxw3-0004Gb-0i for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 09:46:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47840) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aUxw2-0004GX-SF for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 09:46:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aUxw2-00067u-6u for bug-gnu-emacs@gnu.org; Sun, 14 Feb 2016 09:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Feb 2016 14:46:02 +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: Original-Received: via spool by 3226-submit@debbugs.gnu.org id=B3226.145546111623494 (code B ref 3226); Sun, 14 Feb 2016 14:46:02 +0000 Original-Received: (at 3226) by debbugs.gnu.org; 14 Feb 2016 14:45:16 +0000 Original-Received: from localhost ([127.0.0.1]:38615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aUxvI-00066s-2X for submit@debbugs.gnu.org; Sun, 14 Feb 2016 09:45:16 -0500 Original-Received: from mail-wm0-f45.google.com ([74.125.82.45]:35219) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aUxvF-00066f-Oy for 3226@debbugs.gnu.org; Sun, 14 Feb 2016 09:45:14 -0500 Original-Received: by mail-wm0-f45.google.com with SMTP id c200so80465839wme.0 for <3226@debbugs.gnu.org>; Sun, 14 Feb 2016 06:45:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=YQTqMpM/bV3Za74PuDWfetjz4qNYkcGMxRjw0TfTIb4=; b=USOL7XECFxnH/+M0JuZtjKRs2dNU6/DoksRw/9WiIpsAcFQNXCDZ+FSSZ9RMTb9Wle z0kZmKINBv5izp8jfZIXzyBkxEHDdloHUA5l4TmE+LCjiE9vHWjbkBIOxekDOUQxY2y5 nSrJYAH4lX1J5v0xNjZo6RwA3ZeDvw8GEPGmyYjCoKS06WVuhcca6MalylMfsNQotCu0 q5I9Q5B6MsPBTAnnkbu+5hczZeeE72u6lxO0hw2XW5/73mPE7vDrohhmJfVAJYUx81eJ PovSeosFRwUKs3PZFYkM2wyu6Cf/aqDxWKSFPp1vz4Wi0s2fGsZ9zoUwlDsF9kPD0Sh+ FFbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; bh=YQTqMpM/bV3Za74PuDWfetjz4qNYkcGMxRjw0TfTIb4=; b=JdLQTrBW5yOYO4ixAX1+C6YG1Q5hAjQd8bjqraL+FjoKMX9y5StYAs9icI6wov7eAm BqA9BQnl2+cD2KhJQbNJrBywKoheeofoSmPqTtv94cTFxw27l0oEeWGYX5ZIfs7TRhYa mgPs8z/YRqRVKdXvOh8DOQrloEC6Z9JRpWzZz/ziIfiQTSsLhdk2Hq3jFZO4XB4N9Reg 2n1r5a7h2pdduixQp6OvGRTRuRrvBQnA9TDUJmM+M6dfUbeNGloBSO2hariUu2FmFGVO 0ljF96oR+Df8Ir0E9ApYKA4i83nNV8EJmsDgN/MhFqpYbgnvnnZuPOeLyOCHoY3XBrkZ Q++A== X-Gm-Message-State: AG10YOSKHFaJa8XcaHxP3zH0X/tpiQpwPQoAZI9BSVP+5P58XeBaxCGmSiT0bF5BeTmJsC+bo5DwKm4J8Wj1EQ== X-Received: by 10.28.188.195 with SMTP id m186mr7456404wmf.64.1455461108100; Sun, 14 Feb 2016 06:45:08 -0800 (PST) In-Reply-To: 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: 208.118.235.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:113013 Archived-At: --001a114b0bec55352a052bbbf286 Content-Type: text/plain; charset=UTF-8 Andrew Hyatt schrieb am Di., 26. Jan. 2016 um 06:16 Uhr: > Chong Yidong writes: > > >> Cook yourself up a bash script and type a line of code like: > >> for i in $(/bin/vim << > >> > >> 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. This should only respond to things ending in, for example > >>"<< " or possibly "< >> > >> Further, emacs does something outright wrong: An attempt to fix the > >>situation by inserting another '<' between the "<<" and "EOF" +results > >>in ANOTHER pair of "EOF" being inserted in a syntactically invalid way. > > > > I fixed the second problem, but I don't see any easy way to solve the > > first one. > > > > (The difficulty of fixing the first bug is illustrative of the problems > > with individual major modes rolling their own "electric" completion > > facilities. It might be nice to have a minor mode that provides a > > unified framework for this kind of functionality; which may also need > > built-in support.) > > Just a note that I've reproduced the original problem in Emacs 25, so it > appears to be unfixed at present. > > > The behavior can be disabled using (add-hook 'sh-mode-hook (lambda () (sh-electric-here-document-mode 0))) I think this behavior should be customizable and off by default. --001a114b0bec55352a052bbbf286 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Andrew= Hyatt <ahyatt@gmail.com> sch= rieb am Di., 26. Jan. 2016 um 06:16=C2=A0Uhr:
Chong Yidong <cyd@stupidchicken.com> writes:

>> Cook yourself up a bash script and type a line of code like:
>> for i in $(/bin/vim <<
>>
>> 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 t= he
>>cursor on the new blank line.=C2=A0 This is incorrect behaviour, as= it
>>breaks entry of BASH here-strings when the user's intent is sti= ll
>>ambiguous.=C2=A0 This should only respond to things ending in, for = example
>>"<< " or possibly "<<E", but certai= nly NOT just "<<".
>>
>> Further, emacs does something outright wrong: An attempt to fix th= e
>>situation by inserting another '<' between the "<= ;<" and "EOF" +results
>>in ANOTHER pair of "EOF" being inserted in a syntacticall= y invalid way.
>
> I fixed the second problem, but I don't see any easy way to solve = the
> first one.
>
> (The difficulty of fixing the first bug is illustrative of the problem= s
> with individual major modes rolling their own "electric" com= pletion
> facilities.=C2=A0 It might be nice to have a minor mode that provides = a
> unified framework for this kind of functionality; which may also need<= br> > built-in support.)

Just a note that I've reproduced the original problem in Emacs 25, so i= t
appears to be unfixed at present.



The behavior can be disabled using=

(add-hook 'sh-mode-hook (lambda () (sh-electr= ic-here-document-mode 0)))

I think this behavior s= hould be customizable and off by default.=C2=A0
--001a114b0bec55352a052bbbf286--