unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Andrew Hyatt <ahyatt@gmail.com>, Chong Yidong <cyd@stupidchicken.com>
Cc: Paul Nienaber <phox@phox.ca>, 3226@debbugs.gnu.org
Subject: bug#3226: here-document syntax inference and completion is broken
Date: Sun, 14 Feb 2016 14:44:58 +0000	[thread overview]
Message-ID: <CAArVCkS+fVkQKgEvcDN7pRk8xM_avM7pLghZoyuRescpz7VdPw@mail.gmail.com> (raw)
In-Reply-To: <m2fuxk2a6n.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1578 bytes --]

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

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

[-- Attachment #2: Type: text/html, Size: 2293 bytes --]

  reply	other threads:[~2016-02-14 14:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-16 14:09 bug#3226: here-document syntax inference and completion is broken Chong Yidong
2016-01-26  5:15 ` Andrew Hyatt
2016-02-14 14:44   ` Philipp Stephani [this message]
2016-03-27 19:56     ` Mark Oteiza
2016-03-27 22:43       ` Stefan Monnier
2016-04-16 18:49         ` Mark Oteiza
  -- strict thread matches above, loose matches on Subject: below --
2009-05-05 22:15 Paul Nienaber
2009-05-06  3:36 ` Stefan Monnier
2019-10-11 19:38   ` Lars Ingebrigtsen
2019-10-15 22:09     ` Paul Nienaber
2019-10-16  1:40       ` Lars Ingebrigtsen
2019-10-16  6:04         ` Paul Nienaber
2019-10-16  7:20           ` Lars Ingebrigtsen
2019-10-16 12:43         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAArVCkS+fVkQKgEvcDN7pRk8xM_avM7pLghZoyuRescpz7VdPw@mail.gmail.com \
    --to=p.stephani2@gmail.com \
    --cc=3226@debbugs.gnu.org \
    --cc=ahyatt@gmail.com \
    --cc=cyd@stupidchicken.com \
    --cc=phox@phox.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).