From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Autogen in Emacs Shell Date: Sat, 02 May 2015 09:31:06 +0300 Message-ID: <83bni3qymt.fsf@gnu.org> References: <83twvzszjv.fsf@gnu.org> <20150501092657.GA19316@tuxteam.de> <20150501150340.GB30776@tuxteam.de> <83sibgqjb3.fsf@gnu.org> <83d22kqeal.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1430548312 21260 80.91.229.3 (2 May 2015 06:31:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 May 2015 06:31:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 02 08:31:41 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1YoQxf-0002CF-RX for geh-help-gnu-emacs@m.gmane.org; Sat, 02 May 2015 08:31:39 +0200 Original-Received: from localhost ([::1]:56189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoQxf-0001rg-5b for geh-help-gnu-emacs@m.gmane.org; Sat, 02 May 2015 02:31:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoQxV-0001pf-A5 for help-gnu-emacs@gnu.org; Sat, 02 May 2015 02:31:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YoQxR-00088u-Ar for help-gnu-emacs@gnu.org; Sat, 02 May 2015 02:31:29 -0400 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:47815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoQxQ-00088e-Tw for help-gnu-emacs@gnu.org; Sat, 02 May 2015 02:31:25 -0400 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NNP00J00LDVOA00@mtaout28.012.net.il> for help-gnu-emacs@gnu.org; Sat, 02 May 2015 09:30:16 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NNP00BOHM2GR380@mtaout28.012.net.il> for help-gnu-emacs@gnu.org; Sat, 02 May 2015 09:30:16 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.184 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104155 Archived-At: > Date: Fri, 1 May 2015 21:46:53 +0200 > From: Alexander Shukaev > Cc: help-gnu-emacs >=20 > > Those 3 newlines were really typed into the shell. How come? > =20 > Now that we know that the contents of this file are sent as an = input > string to the shell when it starts, what did you expect? The sh= ell > gets 3 lines, each one of which is a comment, so it does nothin= g, but > displays the newline. What is surprising here? > =20 >=20 > =E2=80=8BThe point then is that this file actually does not serve i= ts purpose. It does > not behave as, for example, ".bashrc" does. In other words, one can= not simply > write multiline shell code in there without experiencing this ugly = side effect. I think you can, just with little more creativity (see below), but wh= y would you want to? You already have .bashrc, and can easily test tha= t you are running under Emacs, if that's the issue. AFAIU, the emacs_bash.sh file is supported for some very specialized situations, and probably for Posix platforms, so I have hard time imagining why i= t would be needed on Windows. > I understand the problem here, but why not, for instance, concatena= te lines > with " ; " =E2=80=8Bin order to make one line out of them=E2=80= =8B before sending them to 'bash'? For that, the code needs to be much smarter and understand the semantics of the string it sends. E.g., what if a line ends with a backslash, or some other special character? But you can do that yourself -- make only one line out of several.