GNU bug report logs - #3226
[sh-mode] here-document syntax inference and completion is broken

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: Paul Nienaber <phox@HIDDEN>; merged with #19929; dated Tue, 5 May 2009 22:20:05 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Forcibly Merged 3226 19929. Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.
Changed bug title to '[sh-mode] here-document syntax inference and completion is broken' from 'here-document syntax inference and completion is broken' Request was from npostavs@HIDDEN to control <at> debbugs.gnu.org. Full text available.

Message received at 3226 <at> debbugs.gnu.org:


Received: (at 3226) by debbugs.gnu.org; 16 Apr 2016 18:49:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 16 14:49:40 2016
Received: from localhost ([127.0.0.1]:37623 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1arVHo-000305-D1
	for submit <at> debbugs.gnu.org; Sat, 16 Apr 2016 14:49:40 -0400
Received: from mail-yw0-f194.google.com ([209.85.161.194]:34545)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mvoteiza@HIDDEN>) id 1arVHn-0002zs-3U
 for 3226 <at> debbugs.gnu.org; Sat, 16 Apr 2016 14:49:39 -0400
Received: by mail-yw0-f194.google.com with SMTP id h6so18804224ywc.1
 for <3226 <at> debbugs.gnu.org>; Sat, 16 Apr 2016 11:49:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=udel-edu.20150623.gappssmtp.com; s=20150623;
 h=date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:in-reply-to:user-agent;
 bh=MVc5lCZXNu+uieE8yCNY78ThJ4MjjL3QfAqygQDAar8=;
 b=l4tbY8nHA7U3X1YttrBTUMZSRX9qJTYH3SflUbQQXgU/spc9299+8qOqE97tdwm+Tc
 JAYRfTR6v8js/bezILY6CwBHmx2hJsW4pMxrQWoEx2i60SuiVQZVl9VRsCV8vtwZqQt+
 OR6hVUuocj/s5wLR4RL6oTCPMWPgcT9VphA1WnE2banQ2o8x2R35U5ahfQga8sqjj8ex
 PV/ruzNAwSXp4g65qqMUl0PwGLoTJ4lEtrp4m4k2aRTQyLhY3DQOEHKZiyI87GAWBujg
 +Lzb6C4XAXkpD3S5hiNlS7mlq7/csY33eOO60c1e80f3l5ROmrxH/TA0EzL9Rqo93cgn
 zHEA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:references
 :mime-version:content-disposition:in-reply-to:user-agent;
 bh=MVc5lCZXNu+uieE8yCNY78ThJ4MjjL3QfAqygQDAar8=;
 b=VR3uEQwXIvWNfpwgxOviPUw6be/baDUD7zOy7esRfC/a+h4AP4dYWeN0oFLBZZezRU
 rsJBv8Q5mHOFLqH+1/kkNf8T52iOG4zige7N7A/5dYZ/IYyZsegQKehuXQTJCjEOFh8o
 LDD5yEV/94Ef1ynliUP31PSM/aj5nVfakBU7dqv+/QHYH7hTvC+A/JErjE2EuRkaKgGe
 lmXj4VhpxAYalujDPec+PoN2aSrozNp8EYkQqx8x+xxq9uDIyT5SVC2aWugPuatxH1vo
 hD7azF5zWaWwNOQe6cEtoUFDaETFwbFbdKW9e2cKs3axikRrpebECfFhRzg7Rag4BCfk
 NNBg==
X-Gm-Message-State: AOPr4FU+96J2ZKTtfeZTv+GDYTEf7CwAkXrqMoy4Bx7QBejqm7Cqgnu5lKn0A8sIHy2mScN5
X-Received: by 10.129.108.3 with SMTP id h3mr15702398ywc.64.1460832573282;
 Sat, 16 Apr 2016 11:49:33 -0700 (PDT)
Received: from holos.localdomain (pool-96-227-83-242.phlapa.fios.verizon.net.
 [96.227.83.242])
 by smtp.gmail.com with ESMTPSA id 204sm30602117ywz.39.2016.04.16.11.49.31
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 16 Apr 2016 11:49:32 -0700 (PDT)
Received: by holos.localdomain (Postfix, from userid 1000)
 id 1BF5868838; Sat, 16 Apr 2016 14:49:31 -0400 (EDT)
Date: Sat, 16 Apr 2016 14:49:31 -0400
From: Mark Oteiza <mvoteiza@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#3226: here-document syntax inference and completion is broken
Message-ID: <20160416184931.GA24748@HIDDEN>
References: <87ab1z26m3.fsf@HIDDEN> <m2fuxk2a6n.fsf@HIDDEN>
 <CAArVCkS+fVkQKgEvcDN7pRk8xM_avM7pLghZoyuRescpz7VdPw@HIDDEN>
 <87lh538zlb.fsf@HIDDEN>
 <jwv1t6vbl16.fsf-monnier+emacsbugs@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jwv1t6vbl16.fsf-monnier+emacsbugs@HIDDEN>
User-Agent: Mutt/1.5.24+88 (2a73a6e7c6e7) (2015-08-30)
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 3226
Cc: Paul Nienaber <phox@HIDDEN>, Chong Yidong <cyd@HIDDEN>,
 Philipp Stephani <p.stephani2@HIDDEN>, Andrew Hyatt <ahyatt@HIDDEN>,
 3226 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

On 27/03/16 at 06:43pm, Stefan Monnier wrote:
> > -  (sh-electric-here-document-mode 1)
> 
> Whether or not we enable it by default, the code needs to be changed so
> that you need to type something like "<< " rather than just "<<" in
> order to trigger the electric behavior.

Until then, I moved the mode invocation to sh-mode-hook in ac00a92.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#3226; Package emacs. Full text available.

Message received at 3226 <at> debbugs.gnu.org:


Received: (at 3226) by debbugs.gnu.org; 27 Mar 2016 22:43:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 27 18:43:23 2016
Received: from localhost ([127.0.0.1]:40506 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1akJP1-0007oQ-N6
	for submit <at> debbugs.gnu.org; Sun, 27 Mar 2016 18:43:23 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.181]:54557)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1akJOz-0007oD-F4
 for 3226 <at> debbugs.gnu.org; Sun, 27 Mar 2016 18:43:22 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0CXDQA731xV/+moxEVcDoMChALIYAQCAoE8PBEBAQEBAQEBgQpBBYNdAQEEViMQCw4mEhQYDSSIP88jAQEBAQEFAQEBAR6LOoUFB4QtBZltmVKBRSODOloigngBAQE
X-IPAS-Result: A0CXDQA731xV/+moxEVcDoMChALIYAQCAoE8PBEBAQEBAQEBgQpBBYNdAQEEViMQCw4mEhQYDSSIP88jAQEBAQEFAQEBAR6LOoUFB4QtBZltmVKBRSODOloigngBAQE
X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="200924647"
Received: from 69-196-168-233.dsl.teksavvy.com (HELO ceviche.home)
 ([69.196.168.233])
 by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA;
 27 Mar 2016 18:43:15 -0400
Received: by ceviche.home (Postfix, from userid 20848)
 id 4492666167; Sun, 27 Mar 2016 18:43:15 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Mark Oteiza <mvoteiza@HIDDEN>
Subject: Re: bug#3226: here-document syntax inference and completion is broken
Message-ID: <jwv1t6vbl16.fsf-monnier+emacsbugs@HIDDEN>
References: <87ab1z26m3.fsf@HIDDEN> <m2fuxk2a6n.fsf@HIDDEN>
 <CAArVCkS+fVkQKgEvcDN7pRk8xM_avM7pLghZoyuRescpz7VdPw@HIDDEN>
 <87lh538zlb.fsf@HIDDEN>
Date: Sun, 27 Mar 2016 18:43:15 -0400
In-Reply-To: <87lh538zlb.fsf@HIDDEN> (Mark Oteiza's message of "Sun, 27 Mar
 2016 15:56:00 -0400")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 3226
Cc: Paul Nienaber <phox@HIDDEN>, Chong Yidong <cyd@HIDDEN>,
 Philipp Stephani <p.stephani2@HIDDEN>, Andrew Hyatt <ahyatt@HIDDEN>,
 3226 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

> -  (sh-electric-here-document-mode 1)

Whether or not we enable it by default, the code needs to be changed so
that you need to type something like "<< " rather than just "<<" in
order to trigger the electric behavior.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#3226; Package emacs. Full text available.

Message received at 3226 <at> debbugs.gnu.org:


Received: (at 3226) by debbugs.gnu.org; 27 Mar 2016 19:56:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 27 15:56:10 2016
Received: from localhost ([127.0.0.1]:40427 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1akGnC-0003go-DN
	for submit <at> debbugs.gnu.org; Sun, 27 Mar 2016 15:56:10 -0400
Received: from mail-qk0-f170.google.com ([209.85.220.170]:34108)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mvoteiza@HIDDEN>) id 1akGnA-0003gb-DE
 for 3226 <at> debbugs.gnu.org; Sun, 27 Mar 2016 15:56:08 -0400
Received: by mail-qk0-f170.google.com with SMTP id x64so46815829qkd.1
 for <3226 <at> 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)
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)
Received: by holos.localdomain (Postfix, from userid 1000)
 id CFF2568841; Sun, 27 Mar 2016 15:56:00 -0400 (EDT)
From: Mark Oteiza <mvoteiza@HIDDEN>
To: Philipp Stephani <p.stephani2@HIDDEN>
Subject: Re: bug#3226: here-document syntax inference and completion is broken
References: <87ab1z26m3.fsf@HIDDEN> <m2fuxk2a6n.fsf@HIDDEN>
 <CAArVCkS+fVkQKgEvcDN7pRk8xM_avM7pLghZoyuRescpz7VdPw@HIDDEN>
Date: Sun, 27 Mar 2016 15:56:00 -0400
In-Reply-To: <CAArVCkS+fVkQKgEvcDN7pRk8xM_avM7pLghZoyuRescpz7VdPw@HIDDEN>
 (Philipp Stephani's message of "Sun, 14 Feb 2016 14:44:58 +0000")
Message-ID: <87lh538zlb.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 3226
Cc: Paul Nienaber <phox@HIDDEN>, Chong Yidong <cyd@HIDDEN>,
 Andrew Hyatt <ahyatt@HIDDEN>, Stefan Monnier <monnier@HIDDEN>,
 3226 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)


Philipp Stephani <p.stephani2@HIDDEN> writes:

> Andrew Hyatt <ahyatt@HIDDEN> schrieb am Di., 26. Jan. 2016 um 06:16 Uhr:
>
>  Chong Yidong <cyd@HIDDEN> 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 "<<E", but certainly NOT just "<<".
>  >>
>  >> 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 <<TAG. For example, this is valid bash:

sed -f - <<EOF <(foo "$x") | bar
s/cat/dog/g
EOF

The behavior has been in place for a long time though (IIUC Stefan's
mail correctly, since emacs 23), so I am wary of applying the following:

diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 4fb5835..324cbf1 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1228,6 +1228,7 @@ defcustom sh-set-shell-hook nil
 (defcustom sh-mode-hook nil
   "Hook run by `sh-mode'."
   :type 'hook
+  :options '(sh-electric-here-document-mode)
   :group 'sh-script)
 
 (defcustom sh-learn-basic-offset nil
@@ -1616,7 +1617,8 @@ define-derived-mode sh-mode prog-mode "Shell-script"
 \\[sh-execute-region]	 Have optional header and region be executed in a subshell.
 
 `sh-electric-here-document-mode' controls whether insertion of two
-unquoted < insert a here document.
+unquoted < insert a here document.  You can enable this behavior by
+adding to `sh-mode-hook'.
 
 If you generally program a shell different from your login shell you can
 set `sh-shell-file' accordingly.  If your shell's file name doesn't correctly
@@ -1653,7 +1655,6 @@ define-derived-mode sh-mode prog-mode "Shell-script"
   (setq-local syntax-propertize-function #'sh-syntax-propertize-function)
   (add-hook 'syntax-propertize-extend-region-functions
             #'syntax-propertize-multiline 'append 'local)
-  (sh-electric-here-document-mode 1)
   (setq-local skeleton-pair-alist '((?` _ ?`)))
   (setq-local skeleton-pair-filter-function 'sh-quoted-p)
   (setq-local skeleton-further-elements




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#3226; Package emacs. Full text available.

Message received at 3226 <at> debbugs.gnu.org:


Received: (at 3226) by debbugs.gnu.org; 14 Feb 2016 14:45:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 14 09:45:16 2016
Received: from localhost ([127.0.0.1]:38615 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aUxvI-00066s-2X
	for submit <at> debbugs.gnu.org; Sun, 14 Feb 2016 09:45:16 -0500
Received: from mail-wm0-f45.google.com ([74.125.82.45]:35219)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <p.stephani2@HIDDEN>) id 1aUxvF-00066f-Oy
 for 3226 <at> debbugs.gnu.org; Sun, 14 Feb 2016 09:45:14 -0500
Received: by mail-wm0-f45.google.com with SMTP id c200so80465839wme.0
 for <3226 <at> 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)
MIME-Version: 1.0
References: <87ab1z26m3.fsf@HIDDEN> <m2fuxk2a6n.fsf@HIDDEN>
In-Reply-To: <m2fuxk2a6n.fsf@HIDDEN>
From: Philipp Stephani <p.stephani2@HIDDEN>
Date: Sun, 14 Feb 2016 14:44:58 +0000
Message-ID: <CAArVCkS+fVkQKgEvcDN7pRk8xM_avM7pLghZoyuRescpz7VdPw@HIDDEN>
Subject: Re: bug#3226: here-document syntax inference and completion is broken
To: Andrew Hyatt <ahyatt@HIDDEN>, Chong Yidong <cyd@HIDDEN>
Content-Type: multipart/alternative; boundary=001a114b0bec55352a052bbbf286
X-Spam-Score: -0.5 (/)
X-Debbugs-Envelope-To: 3226
Cc: Paul Nienaber <phox@HIDDEN>, 3226 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

--001a114b0bec55352a052bbbf286
Content-Type: text/plain; charset=UTF-8

Andrew Hyatt <ahyatt@HIDDEN> schrieb am Di., 26. Jan. 2016 um 06:16 Uhr:

> Chong Yidong <cyd@HIDDEN> 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 "<<E", but certainly NOT just "<<".
> >>
> >> 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

<div dir=3D"ltr"><br><br><div class=3D"gmail_quote"><div dir=3D"ltr">Andrew=
 Hyatt &lt;<a href=3D"mailto:ahyatt@HIDDEN">ahyatt@HIDDEN</a>&gt; sch=
rieb am Di., 26. Jan. 2016 um 06:16=C2=A0Uhr:<br></div><blockquote class=3D=
"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding=
-left:1ex">Chong Yidong &lt;<a href=3D"mailto:cyd@HIDDEN" target=
=3D"_blank">cyd@HIDDEN</a>&gt; writes:<br>
<br>
&gt;&gt; Cook yourself up a bash script and type a line of code like:<br>
&gt;&gt; for i in $(/bin/vim &lt;&lt;<br>
&gt;&gt;<br>
&gt;&gt; A default emacs install will complete with &quot;EOF\n\nEOF&quot; =
(in a more<br>
&gt;&gt;clever fashion so the rest of the line is undisturbed), and place t=
he<br>
&gt;&gt;cursor on the new blank line.=C2=A0 This is incorrect behaviour, as=
 it<br>
&gt;&gt;breaks entry of BASH here-strings when the user&#39;s intent is sti=
ll<br>
&gt;&gt;ambiguous.=C2=A0 This should only respond to things ending in, for =
example<br>
&gt;&gt;&quot;&lt;&lt; &quot; or possibly &quot;&lt;&lt;E&quot;, but certai=
nly NOT just &quot;&lt;&lt;&quot;.<br>
&gt;&gt;<br>
&gt;&gt; Further, emacs does something outright wrong: An attempt to fix th=
e<br>
&gt;&gt;situation by inserting another &#39;&lt;&#39; between the &quot;&lt=
;&lt;&quot; and &quot;EOF&quot; +results<br>
&gt;&gt;in ANOTHER pair of &quot;EOF&quot; being inserted in a syntacticall=
y invalid way.<br>
&gt;<br>
&gt; I fixed the second problem, but I don&#39;t see any easy way to solve =
the<br>
&gt; first one.<br>
&gt;<br>
&gt; (The difficulty of fixing the first bug is illustrative of the problem=
s<br>
&gt; with individual major modes rolling their own &quot;electric&quot; com=
pletion<br>
&gt; facilities.=C2=A0 It might be nice to have a minor mode that provides =
a<br>
&gt; unified framework for this kind of functionality; which may also need<=
br>
&gt; built-in support.)<br>
<br>
Just a note that I&#39;ve reproduced the original problem in Emacs 25, so i=
t<br>
appears to be unfixed at present.<br>
<br><br></blockquote><div><br></div><div>The behavior can be disabled using=
</div><div><br></div><div>(add-hook &#39;sh-mode-hook (lambda () (sh-electr=
ic-here-document-mode 0)))</div><div><br></div><div>I think this behavior s=
hould be customizable and off by default.=C2=A0</div></div></div>

--001a114b0bec55352a052bbbf286--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#3226; Package emacs. Full text available.

Message received at 3226 <at> debbugs.gnu.org:


Received: (at 3226) by debbugs.gnu.org; 26 Jan 2016 05:15:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 26 00:15:38 2016
Received: from localhost ([127.0.0.1]:36530 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aNvyc-0001fB-Mx
	for submit <at> debbugs.gnu.org; Tue, 26 Jan 2016 00:15:38 -0500
Received: from mail-qg0-f51.google.com ([209.85.192.51]:33267)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <ahyatt@HIDDEN>) id 1aNvya-0001ev-Lq
 for 3226 <at> debbugs.gnu.org; Tue, 26 Jan 2016 00:15:37 -0500
Received: by mail-qg0-f51.google.com with SMTP id b35so127111213qge.0
 for <3226 <at> debbugs.gnu.org>; Mon, 25 Jan 2016 21:15:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version:content-type;
 bh=JBswm33YRSn62rrjQKtZRDRpIsvprGmnd+56T41cntY=;
 b=wcJJq7SzcAeWIfGk9dSePOGAjMOdPLWVTMUUGVVcL2dVz6eh6d1286a7qoCxBkjapw
 pTPDNCb1tjd13XICtYydVX93gDLoNRJAx7zJchVWo6CiKxjQmMgO/0DrgrkatD586fGo
 2Nud/MN4j9CdyNlDQrXGTcQiPPxqptdgIJ8+txrK4JaG/2LesgFbFIOl89X6ql3YgTn2
 r6D7nKGR5Gf8RkNv5pWtaze8lOPXsYj/+O01kWW1kDeOIudR0pf810cjyvyV14qST9WD
 Gy+yHn/CUAY1cmS+25kyWTQkz+cHIz2Hgd/0INxiFU8Sgf6PQ38pwdwC/TrG6sfrvFBf
 sPhg==
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:content-type;
 bh=JBswm33YRSn62rrjQKtZRDRpIsvprGmnd+56T41cntY=;
 b=gM4E5fcWVC8WTKXH/tHKIZEotLDgu1Y3aWo4+vRiWIaWm/lsWD7ojmTc3VLKm63UNY
 gzvANLcImjAH6K3O9NpZ70ZucAX10nEG8ko8moQxU0BY5Z6khmvl9hx+/rE4qFK0oM46
 CDDgGrjTV+z3Va7yJ3KJXf+igtpqsuEVjS774bf0SEE1uI7FTuQrUwz8CySFlbGEhiTj
 zFYkbwe1BnGTusExrRJhDUW5+/LRHT4IfN1k4tP1U4kJmvBT03VZaeUz7nqSLZkQkXAk
 88bGj3wz5q5uI60EDU3vBrmeAl3So2Qz8NY65nrz9/tEkafWkFuwgRgOqhuXQLkKTuBO
 KyIw==
X-Gm-Message-State: AG10YOR6y3shcuO0QCshgaA6S+86ZUdo8CD4+ItCirZkTKR3+MxHrHGO3FYBMoJ5Mecv1w==
X-Received: by 10.140.104.146 with SMTP id a18mr25444552qgf.59.1453785331462; 
 Mon, 25 Jan 2016 21:15:31 -0800 (PST)
Received: from Andrews-MacBook-Pro.local.ahyatt-laptop
 (cpe-74-73-128-199.nyc.res.rr.com. [74.73.128.199])
 by smtp.gmail.com with ESMTPSA id q66sm10114169qhb.31.2016.01.25.21.15.29
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 25 Jan 2016 21:15:29 -0800 (PST)
From: Andrew Hyatt <ahyatt@HIDDEN>
To: Chong Yidong <cyd@HIDDEN>
Subject: Re: bug#3226: here-document syntax inference and completion is broken
References: <87ab1z26m3.fsf@HIDDEN>
Date: Tue, 26 Jan 2016 00:15:28 -0500
In-Reply-To: <87ab1z26m3.fsf@HIDDEN> (Chong Yidong's message of "Sun, 16
 Aug 2009 10:09:08 -0400")
Message-ID: <m2fuxk2a6n.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (darwin)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 3226
Cc: Paul Nienaber <phox@HIDDEN>, 3226 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Chong Yidong <cyd@HIDDEN> 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 "<<E", but certainly NOT just "<<".
>>
>> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#3226; Package emacs. Full text available.

Message received at 3226@HIDDEN:


Received: (at 3226) by emacsbugs.donarmstrong.com; 16 Aug 2009 14:08:10 +0000
From cyd@HIDDEN Sun Aug 16 07:08:10 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-1.6 required=4.0 tests=AWL,FOURLA autolearn=no
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7GE890M027255
	for <3226@HIDDEN>; Sun, 16 Aug 2009 07:08:10 -0700
Received: by cyd.mit.edu (Postfix, from userid 1000)
	id B02BB57E25D; Sun, 16 Aug 2009 10:09:08 -0400 (EDT)
From: Chong Yidong <cyd@HIDDEN>
To: Paul Nienaber <phox@HIDDEN>
Cc: 3226 <at> debbugs.gnu.org
Subject: Re: here-document syntax inference and completion is broken
Date: Sun, 16 Aug 2009 10:09:08 -0400
Message-ID: <87ab1z26m3.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

> 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 "<<E", but certainly NOT just "<<".
>
> 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.)



Acknowledgement sent to Chong Yidong <cyd@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#3226; Package emacs. Full text available.

Message received at 3226@HIDDEN:


Received: (at 3226) by emacsbugs.donarmstrong.com; 6 May 2009 03:36:30 +0000
From monnier@HIDDEN Tue May  5 20:36:30 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-2.5 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER,
	MURPHY_DRUGS_REL8,XIRONPORT autolearn=ham
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n463aQ2Y012406
	for <3226@HIDDEN>; Tue, 5 May 2009 20:36:28 -0700
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ArUFABKiAErO+IYe/2dsb2JhbACBUM1jhAEFhU4
X-IronPort-AV: E=Sophos;i="4.40,301,1238990400"; 
   d="scan'208";a="38052017"
Received: from 206-248-134-30.dsl.teksavvy.com (HELO ceviche.home) ([206.248.134.30])
  by ironport2-out.teksavvy.com with ESMTP; 05 May 2009 23:36:20 -0400
Received: by ceviche.home (Postfix, from userid 20848)
	id A34EFB523F; Tue,  5 May 2009 23:36:20 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Paul Nienaber <phox@HIDDEN>
Cc: 3226 <at> debbugs.gnu.org
Subject: Re: bug#3226: here-document syntax inference and completion is broken
Message-ID: <jwvljpakixl.fsf-monnier+emacsbugreports@HIDDEN>
References: <4A00BA64.7080700@HIDDEN>
Date: Tue, 05 May 2009 23:36:20 -0400
In-Reply-To: <4A00BA64.7080700@HIDDEN> (Paul Nienaber's message of "Tue, 05
	May 2009 15:15:00 -0700")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

> 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.


        Stefan






Acknowledgement sent to Stefan Monnier <monnier@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#3226; Package emacs. Full text available.

Message received at submit@HIDDEN:


Received: (at submit) by emacsbugs.donarmstrong.com; 5 May 2009 22:15:18 +0000
From phox@HIDDEN Tue May  5 15:15:17 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from lists.gnu.org (lists.gnu.org [199.232.76.165])
	by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n45MFBhb017485
	for <submit@HIDDEN>; Tue, 5 May 2009 15:15:13 -0700
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1M1Sut-0008SI-4P
	for bug-gnu-emacs@HIDDEN; Tue, 05 May 2009 18:15:11 -0400
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1M1Sum-0008QG-PJ
	for bug-gnu-emacs@HIDDEN; Tue, 05 May 2009 18:15:09 -0400
Received: from [199.232.76.173] (port=39892 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1M1Sum-0008QD-Kl
	for bug-gnu-emacs@HIDDEN; Tue, 05 May 2009 18:15:04 -0400
Received: from rv-out-0708.google.com ([209.85.198.241]:25294)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <phox@HIDDEN>)
	id 1M1Sum-0002W4-Cd
	for bug-gnu-emacs@HIDDEN; Tue, 05 May 2009 18:15:04 -0400
Received: by rv-out-0708.google.com with SMTP id f25so5123335rvb.6
        for <bug-gnu-emacs@HIDDEN>; Tue, 05 May 2009 15:15:02 -0700 (PDT)
Received: by 10.141.168.16 with SMTP id v16mr214152rvo.147.1241561702844;
        Tue, 05 May 2009 15:15:02 -0700 (PDT)
Received: from frank.pcic.uvic.ca (frank.pcic.uvic.ca [142.104.194.104])
        by mx.google.com with ESMTPS id k2sm13286371rvb.4.2009.05.05.15.15.01
        (version=TLSv1/SSLv3 cipher=RC4-MD5);
        Tue, 05 May 2009 15:15:02 -0700 (PDT)
Message-ID: <4A00BA64.7080700@HIDDEN>
Date: Tue, 05 May 2009 15:15:00 -0700
From: Paul Nienaber <phox@HIDDEN>
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b5pre) Gecko/20090503 Shredder/3.0b3pre
MIME-Version: 1.0
To: bug-gnu-emacs@HIDDEN
Subject: here-document syntax inference and completion is broken
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)

Steps to reproduce:

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 "<<E", but certainly NOT just "<<".  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.


~Paul Nienaber






Acknowledgement sent to Paul Nienaber <phox@HIDDEN>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Report forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#3226; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 1 Apr 2017 23:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.