From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Silvio Levy Newsgroups: gmane.emacs.help Subject: shell mode - how to stop division into bogus fields Date: Mon, 21 Nov 2011 00:11:40 -0800 Message-ID: <20111121081140.E2CEA1810AB@neo.msri.org> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1321864923 30991 80.91.229.12 (21 Nov 2011 08:42:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 21 Nov 2011 08:42:03 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Nov 21 09:41:57 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RSPRs-00024F-2v for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Nov 2011 09:41:56 +0100 Original-Received: from localhost ([::1]:42043 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSPRr-0000fy-KA for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Nov 2011 03:41:55 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:34725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSOye-00045d-3w for help-gnu-emacs@gnu.org; Mon, 21 Nov 2011 03:11:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSOyd-0002bq-1f for help-gnu-emacs@gnu.org; Mon, 21 Nov 2011 03:11:44 -0500 Original-Received: from spike.lmi.net ([66.117.140.17]:49777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSOyc-0002bg-Os for help-gnu-emacs@gnu.org; Mon, 21 Nov 2011 03:11:43 -0500 Original-Received: from neo.msri.org (75-101-50-210.dsl.static.sonic.net [75.101.50.210]) by spike.lmi.net (Postfix) with ESMTP id 5369915407D; Mon, 21 Nov 2011 00:11:41 -0800 (PST) Original-Received: by neo.msri.org (Postfix, from userid 1000) id E2CEA1810AB; Mon, 21 Nov 2011 00:11:40 -0800 (PST) Original-Received: from neo.msri.org (localhost [127.0.0.1]) by neo.msri.org (Postfix) with ESMTP id CDABC180A09; Mon, 21 Nov 2011 00:11:40 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 66.117.140.17 X-Mailman-Approved-At: Mon, 21 Nov 2011 03:41:52 -0500 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:82989 Archived-At: [Better version of a message I tried to send a few minutes ago] So, starting with Emacs 21 (if I recall correctly) the behavior of shell mode changed so that it's become much harder to reuse previous commands. For instance, suppose you have run the command myprompt> foo bar In the old behavior, if you went back to that line, edited it, and hit return, the whole line would be fed to the shell, except for myprompt>. In the new behavior, most kinds of editing break up the line into bogus "fields". For instance, suppose you realize you forgot an argument, and you supply it from the kill-ring. You now have myprompt> foo baz bar (where "baz" was dropped in via C-y). Now, if hit return with point on top of "baz", only "bar" is sent - somehow, emacs regards "baz" as a prompt and what comes after as the desired command. (If point is on "bar", likewise) only "bar" is sent. In effect the line has been chopped into multiple logical lines, and that causes many errors. I've spent quite a bit of time searching for documentation about this, without success. The file comint.el talks about fields but I see a variable to turn off this behavior. And worse, it looks like such documentation as there is, is wrong. For instance, http://www.gnu.org/s/libtool/manual/emacs/Shell-Prompts.html says that "when point is in input on the same line as a prompt, C-a puts point at the beginning of the input if comint-use-prompt-regexp is nil and at the beginning of the line otherwise." In fact, for me (under emacs 23.1.1, called with -q, and having hit M-x shell which opens my default shell, csh), C-a always puts point at the beginning of the "piece" it's on, regardless of the value of comint-use-prompt-regexp. Can anyone teach me how the old behavior can be restored? Thanks in advance Silvio Levy levy@msri.org