From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Default setting for sh-maybe-here-document-mode Date: Sun, 22 Feb 2015 18:24:11 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1424647511 964 80.91.229.3 (22 Feb 2015 23:25:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Feb 2015 23:25:11 +0000 (UTC) Cc: emacs-devel To: Thibaut Verron Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 23 00:25:02 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 1YPftV-0001Xr-7O for ged-emacs-devel@m.gmane.org; Mon, 23 Feb 2015 00:25:01 +0100 Original-Received: from localhost ([::1]:41544 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPftU-0005r4-Mn for ged-emacs-devel@m.gmane.org; Sun, 22 Feb 2015 18:25:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPftH-0005qn-PJ for emacs-devel@gnu.org; Sun, 22 Feb 2015 18:24:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YPftE-0000Pl-J1 for emacs-devel@gnu.org; Sun, 22 Feb 2015 18:24:47 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:11097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPftE-0000Pg-Ex for emacs-devel@gnu.org; Sun, 22 Feb 2015 18:24:44 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArsTAPOG1lRsoXmY/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWGAsFCws0EhQYDSSIOAjOIwEBAQEGAQEBAR6PeAeEKgWKJ484jhqBeYFFIoQMIIJzAQEB X-IPAS-Result: ArsTAPOG1lRsoXmY/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWGAsFCws0EhQYDSSIOAjOIwEBAQEGAQEBAR6PeAeEKgWKJ484jhqBeYFFIoQMIIJzAQEB X-IronPort-AV: E=Sophos;i="5.09,536,1418101200"; d="scan'208";a="111181106" Original-Received: from 108-161-121-152.dsl.teksavvy.com (HELO pastel.home) ([108.161.121.152]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Feb 2015 18:24:43 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 161701028; Sun, 22 Feb 2015 18:24:11 -0500 (EST) In-Reply-To: (Thibaut Verron's message of "Fri, 20 Feb 2015 18:23:10 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:183406 Archived-At: > 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 ... >> > 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. > This is a good idea, but in this case you also need to include < < - > as a trigger. Indeed, and probably < < ' as well. Stefan