From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.bugs Subject: bug#3226: here-document syntax inference and completion is broken Date: Sun, 27 Mar 2016 15:56:00 -0400 Message-ID: <87lh538zlb.fsf@udel.edu> References: <87ab1z26m3.fsf@cyd.mit.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1459108644 27992 80.91.229.3 (27 Mar 2016 19:57:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Mar 2016 19:57:24 +0000 (UTC) Cc: Paul Nienaber , 3226@debbugs.gnu.org, Chong Yidong , Andrew Hyatt , Stefan Monnier To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 27 21:57: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 1akGo9-0005SJ-O4 for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Mar 2016 21:57:09 +0200 Original-Received: from localhost ([::1]:37256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akGo9-00040Q-3P for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Mar 2016 15:57:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akGo5-00040J-7Y for bug-gnu-emacs@gnu.org; Sun, 27 Mar 2016 15:57:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akGo2-0000tT-06 for bug-gnu-emacs@gnu.org; Sun, 27 Mar 2016 15:57:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43300) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akGo1-0000tP-S5 for bug-gnu-emacs@gnu.org; Sun, 27 Mar 2016 15:57:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1akGo1-0003hu-NC for bug-gnu-emacs@gnu.org; Sun, 27 Mar 2016 15:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Mar 2016 19:57: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: Original-Received: via spool by 3226-submit@debbugs.gnu.org id=B3226.145910857014191 (code B ref 3226); Sun, 27 Mar 2016 19:57:01 +0000 Original-Received: (at 3226) by debbugs.gnu.org; 27 Mar 2016 19:56:10 +0000 Original-Received: from localhost ([127.0.0.1]:40427 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akGnC-0003go-DN for submit@debbugs.gnu.org; Sun, 27 Mar 2016 15:56:10 -0400 Original-Received: from mail-qk0-f170.google.com ([209.85.220.170]:34108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1akGnA-0003gb-DE for 3226@debbugs.gnu.org; Sun, 27 Mar 2016 15:56:08 -0400 Original-Received: by mail-qk0-f170.google.com with SMTP id x64so46815829qkd.1 for <3226@debbugs.gnu.org>; Sun, 27 Mar 2016 12:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=U0C1b+YakqyId6sglyE6sA0YaIvNv2ffPSGIAFSVED4=; b=B+6nrQ8d3XDgEGlL3RBzACrV8Qoyt4T4W9BNpF+Fyudub3ntZmmygHxUCVj+Kcsexx ym7A2FPhpyFPuCyD647GQZhblaz+7deTwNFDVAPmCInKWWs02CocM0a6LPR8OkEHgUes p2bO9zVgUVdEmjLkDlvJbk6jZMXD2iV66tSB2Q6CUmygXvHL7Jr0QW+d547i5ZD3rQK5 Zhu2OMr1Tw4qFrh3nNK3iuW4vcOgUTQ5/fDz2KedaHK+UWtCvk313XeKcypzfxXBBTfS /j/LSu1DamG6csR+MeTTP5ZrLt26Dh2e1ZEPxq6uU7+iOF8NKJKecqAz7575VTpHs+BZ CHew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=U0C1b+YakqyId6sglyE6sA0YaIvNv2ffPSGIAFSVED4=; b=DYz7/OhmBXiKEs+8jybxYj/6yWFhIf+vWRE4/8x0VAfh+rlAAQDN2p9qrL//cf3+ar xMCiRwJUxB1OIMf8ud0riFgpqh3TzsHCjQx0xng16fS0U3GORcBmWfnIirIt3JbARUun y0O9NigJ/C7sa2pzyXkVnp0m2Z+54aRBeyB3u9ADRRaBB6sgGF/CLkNekarGMW7bTraN hIAk4Dticrtw1bHwc3LzNlYO++iR4MNj3gtv530n61E8F1w9AHIDlWxlwXrKMu/TSdZB LRL/1FSVDl+kMCcvpBr88d16ppwjv1zBdbeVaKCdcFpCcVjnrW7JCcnyQ/61oHUV8FPo SDLA== X-Gm-Message-State: AD7BkJJTkpGKqpWQF7aLMq6CyWxSMoL6/a7AaAYf+gFhoV/ogQSrHWQyA5qKnV5/riGUr8Of X-Received: by 10.129.50.13 with SMTP id y13mr2482263ywy.305.1459108562644; Sun, 27 Mar 2016 12:56:02 -0700 (PDT) Original-Received: from holos.localdomain (pool-96-227-83-242.phlapa.fios.verizon.net. [96.227.83.242]) by smtp.gmail.com with ESMTPSA id t123sm14528306ywe.4.2016.03.27.12.56.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Mar 2016 12:56:01 -0700 (PDT) Original-Received: by holos.localdomain (Postfix, from userid 1000) id CFF2568841; Sun, 27 Mar 2016 15:56:00 -0400 (EDT) In-Reply-To: (Philipp Stephani's message of "Sun, 14 Feb 2016 14:44:58 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) 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:115605 Archived-At: Philipp Stephani writes: > 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. I agree. In addition to breaking here strings, it also complicates writing here docs not using sh-here-document-word, as well as here docs with additional contents after <