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: Fri, 20 Feb 2015 12:08:49 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1424452177 13748 80.91.229.3 (20 Feb 2015 17:09:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Feb 2015 17:09:37 +0000 (UTC) Cc: emacs-devel To: Thibaut Verron Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 20 18:09:26 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 1YOr4v-0003HC-MY for ged-emacs-devel@m.gmane.org; Fri, 20 Feb 2015 18:09:25 +0100 Original-Received: from localhost ([::1]:33312 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOr4u-00011e-R6 for ged-emacs-devel@m.gmane.org; Fri, 20 Feb 2015 12:09:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOr4r-000112-AB for emacs-devel@gnu.org; Fri, 20 Feb 2015 12:09:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOr4m-0008ID-5o for emacs-devel@gnu.org; Fri, 20 Feb 2015 12:09:21 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:6033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOr4m-0008I9-1g for emacs-devel@gnu.org; Fri, 20 Feb 2015 12:09:16 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4TAPOG1lTO+LI//2dsb2JhbABbgwZSW4IyhVO6eoVrBAICgQ1EAQEBAQEBfIQNAQQBViMFCws0EhQYDSSIOAgNzhYBAQEBBgEBAQEej3gHhCoFiieIRIZ0No1kgXmBRSKEDCCCcwEBAQ X-IPAS-Result: Av4TAPOG1lTO+LI//2dsb2JhbABbgwZSW4IyhVO6eoVrBAICgQ1EAQEBAQEBfIQNAQQBViMFCws0EhQYDSSIOAgNzhYBAQEBBgEBAQEej3gHhCoFiieIRIZ0No1kgXmBRSKEDCCCcwEBAQ X-IronPort-AV: E=Sophos;i="5.09,536,1418101200"; d="scan'208";a="111022087" Original-Received: from 206-248-178-63.dsl.teksavvy.com (HELO pastel.home) ([206.248.178.63]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Feb 2015 12:09:15 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id F2B8F1775; Fri, 20 Feb 2015 12:08:49 -0500 (EST) In-Reply-To: (Thibaut Verron's message of "Fri, 20 Feb 2015 16:49:27 +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:183328 Archived-At: >> Hmm... indeed, maybe it should be a global minor mode? > And auto-loaded? I think we could make it so that (setq sh-electric-here-document-mode nil) in your ~/.emacs would be sufficient. Autoloading it and having users put (sh-electric-here-document-mode -1) in their ~/.emacs means that those users end up loading sh-script.el eagerly. > This could work. Another option would be to reenable the binding on > '<' (see just below), and let users who do not want the behavior use > self-insert-command. No, using post-self-insert-hook instead of a key-binding was the main motivation behind the change. Reverting this is not an option. > It is very easy: try to feed a single line to a command, using a > here-string. In other words, try to enter > command <<< "line of text" Ah, right, I remember this now (obviously, I never use it myself). Could you file a bug report for it? I think the feature was developed at a time where <<< didn't exist, and accommodating <<< will require some rethinking. > This use-case can be accommodated with this piece of code: > http://emacs.stackexchange.com/a/5338/184 > It still fails in case the here-document is supposed to start with a <, > which is reasonable, but would probably be even more confusing as a default. It's also rather jarring to have a "big" chunk of text be inserted there, and it may not occur to the user than hitting a third < will get her what she wanted. > 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. > By the way, we could design it so that the feature is still accessible, but > through more conventional entry points, for example by pressing TAB with > point after << . Right, or we could trigger the heredoc template after `< < SPC' rather than just after '< <'. In any case, given the use of <<< I agree that the current moment at which heredoc is triggered is inappropriate. Stefan