From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thibaut Verron Newsgroups: gmane.emacs.devel Subject: Re: Default setting for sh-maybe-here-document-mode Date: Mon, 23 Feb 2015 09:41:33 +0100 Message-ID: References: Reply-To: thibaut.verron@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b3a834cd6a0e8050fbd5fdc X-Trace: ger.gmane.org 1424680926 26815 80.91.229.3 (23 Feb 2015 08:42:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Feb 2015 08:42:06 +0000 (UTC) Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 23 09:42:05 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YPoaY-0000z2-51 for ged-emacs-devel@m.gmane.org; Mon, 23 Feb 2015 09:42:02 +0100 Original-Received: from localhost ([::1]:42548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPoaX-0000kX-JV for ged-emacs-devel@m.gmane.org; Mon, 23 Feb 2015 03:42:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPoaS-0000h5-Uf for emacs-devel@gnu.org; Mon, 23 Feb 2015 03:41:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YPoaR-0000ZR-Lp for emacs-devel@gnu.org; Mon, 23 Feb 2015 03:41:56 -0500 Original-Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:56267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPoaR-0000ZF-BU for emacs-devel@gnu.org; Mon, 23 Feb 2015 03:41:55 -0500 Original-Received: by mail-wi0-f172.google.com with SMTP id l15so14984843wiw.5 for ; Mon, 23 Feb 2015 00:41:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=0+aD4WkFA6/gDSPDjWqD5Ch7P28DUy+6VT4S7E+5Mx0=; b=ITa67mCmbu1l2jZSTGxFc7OV0bMqG9jk3up7QodCJUyIRD4rFKdz7W6OvUFddZSw7n 8utHOoW/KOstjLLF+VIoGfC5P8R8DrRK4a/9azXRhvaLaR7xbhqqGGFtazNoBJWb5lUt gHYh1uC7L9sgL59MOUnRRFmC9nLzsBZDmvvFqZxNa8++JJU64dI+WKtvumE67G/kvcAe dDYAnpGokwp3mNs/bx+n9bJ6cOwkksNp6nIOgZODcQ2SB9aPa+B9FN4HqEqQ6uWsDhFf M5k33TNIAWIR3RiAJ/Px13aGR24lzi3clZ8SF6rEPvMBaCmzcjoYNY0U6nKFnmFeiF/G jAtA== X-Received: by 10.194.2.75 with SMTP id 11mr19679228wjs.78.1424680914688; Mon, 23 Feb 2015 00:41:54 -0800 (PST) Original-Received: by 10.27.179.17 with HTTP; Mon, 23 Feb 2015 00:41:33 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183416 Archived-At: --047d7b3a834cd6a0e8050fbd5fdc Content-Type: text/plain; charset=UTF-8 2015-02-23 0:24 GMT+01:00 Stefan Monnier : > > Now I am curious, I'll probably dive in the mailing list history to find > > out more about this motivation. > > I don't think there's much history about it in the mailing-list. > Using post-self-insert-hook has the advantage of being more modular than > a key-binding: you can make it do heredoc expansion in sh-script without > affecting whether it does automatic reindent (via electric-indent-mode) > or automatic pairing (via electric-pair-mode), or ... > Oh I see, too many modes abusing key rebinding have lead me to believe it was the idiom for this kind of behavior. > > >> > Another use-case, even if you never use here-strings, is that you > >> > want to enter a single <, but enter << instead. You would expect > >> > this mistake to be corrected with a single backspace, but it's not. > >> We could special case this, potentially, but at the same time `undo' is > >> your friend. > > I know, but for some reason I can't get the hang of using undo in the > flow > > of writing text. > > It's definitely more intrusive, admittedly. I'd welcome a patch which > makes backspace actually undo the expansion. > With your solution of requiring an additional (printed) character after the <, I think accidental expansion would get much rarer already. > > > This is a good idea, but in this case you also need to include < < - > > as a trigger. > > Indeed, and probably < < ' as well. > By the way, the bug report is sent now, sorry for the delay, I was without an internet connection for the week-end. Thibaut --047d7b3a834cd6a0e8050fbd5fdc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
2015= -02-23 0:24 GMT+01:00 Stefan Monnier <monnier@iro.umontreal.ca&= gt;:
> Now I a= m curious, I'll probably dive in the mailing list history to find
> out more about this motivation.

I don't think there's much history about it in the mailing-l= ist.
Using post-self-insert-hook has the advantage of being more modular than a key-binding: you can make it do heredoc expansion in sh-script without affecting whether it does automatic reindent (via electric-indent-mode)
or automatic pairing (via electric-pair-mode), or ...
=
Oh I see, too many modes abusing key rebinding have lead me = to believe it was the idiom for this kind of behavior.
=C2=A0

>> > Another use-case, even if you never use here-strings, is that= you
>> > want to enter a single <, but enter << instead.=C2= =A0 You would expect
>> > this mistake to be corrected with a single backspace, but it&= #39;s not.
>> We could special case this, potentially, but at the same time `und= o' is
>> your friend.
> I know, but for some reason I can't get the hang of using undo in = the flow
> of writing text.

It's definitely more intrusive, admittedly.=C2=A0 I'd welcom= e a patch which
makes backspace actually undo the expansion.

With your solution of requiring an additional (printed) character aft= er the <, I think accidental expansion would get much rarer already.=C2= =A0
=C2=A0

> This is a good idea, but in this case you also need to include < &l= t; -
> as a trigger.

Indeed, and probably < < ' as well.
<= br>
By the way, the bug report is sent now, sorry for the delay, = I was without an internet connection for the week-end.

=
Thibaut
--047d7b3a834cd6a0e8050fbd5fdc--