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: Re: shell mode - how to stop division into bogus fields Date: Tue, 22 Nov 2011 18:34:23 -0800 Message-ID: <20111123023423.26529180B26@neo.msri.org> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1322015678 24420 80.91.229.12 (23 Nov 2011 02:34:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 Nov 2011 02:34:38 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Bob Proulx Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 23 03:34:34 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 1RT2fR-0004eX-V6 for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Nov 2011 03:34:34 +0100 Original-Received: from localhost ([::1]:41832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RT2fR-0004Ya-GF for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Nov 2011 21:34:33 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:45273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RT2fM-0004XW-7v for help-gnu-emacs@gnu.org; Tue, 22 Nov 2011 21:34:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RT2fL-0002Q6-3Y for help-gnu-emacs@gnu.org; Tue, 22 Nov 2011 21:34:28 -0500 Original-Received: from spike.lmi.net ([66.117.140.17]:58894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RT2fK-0002Pw-SZ for help-gnu-emacs@gnu.org; Tue, 22 Nov 2011 21:34:27 -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 160AE154098; Tue, 22 Nov 2011 18:34:23 -0800 (PST) Original-Received: by neo.msri.org (Postfix, from userid 1000) id 26529180B26; Tue, 22 Nov 2011 18:34:23 -0800 (PST) Original-Received: from neo.msri.org (localhost [127.0.0.1]) by neo.msri.org (Postfix) with ESMTP id 1035F1803C2; Tue, 22 Nov 2011 18:34:23 -0800 (PST) In-reply-to: Your message of Tue, 22 Nov 2011 18:57:25 -0700 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 66.117.140.17 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:83009 Archived-At: Thanks to Bob and XeCycle for checking out the problem. XeCycle, were you trying it with -Q? Bob, your elaboration of the 2nd part of the problem (below) agrees with what I see, I think. But your way of expressing it is clearer. I've made a bit of progress. If I set comint-use-prompt-regexp to "t" *and* change comint-prompt-regexp to match my csh prompt, does actually send the interpolated line (rather than just a piece of it) to the shell. That's the desired behavior. The problem then comes when I'm interacting with a subprogram -- e.g., if I call Mathematica or mysql in the shell, I have to either change comint-prompt-regexp to match the prompt of whatever software I'm interacting with at the moment, or erase each prompt before sending the line. Silvio > Silvio Levy writes: > > 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. >=20 > Cannot reproduce your problem. I can reproduce it. It annoyed me too. I see this same problem on emacs 23.3.1 from Debian Sid using emacs -Q. I have no solution for it however. > > 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."=20 > > > > 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. >=20 > Cannot reproduce this, either. I'm using GNU Emacs 24.0.91.2 > (x86_64-unknown-linux-gnu, GTK+ Version 2.24.8) of 2011-11-19. > You can also try `-Q', to see if your distro or local admin broke > it. I have different behavior of C-a. For me it takes me to the beginning of what emacs thinks is the beginning of the line. But because of the above described behavior that is incorrect. The two problems are definitely related. $ echo one two one two Then move the point to this position: $ echo one two ^-point is now here Then type C-c . invoking comit-insert-previous-argument and the result will be: $ echo one two two ^-point is now here The syntax highlighting is, using my own html-like coloration for description, the following: $ echo one two two C-e always takes point to the end of the line. C-a takes point to one of three places depending upon location. $ echo one two two ^a ^b ^c If point is within "echo one" then C-a goes to position marked 'a'. If within "two " then C-a goes to position 'b'. If within the last "two" then it goes to position 'c'. And C-e always goes to the end of the line. Bob --UHN/qo2QbUvPLonB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk7MUwUACgkQ0pRcO8E2ULY5MQCeI2XiJ9VaQ9BsA1ep1XmnJKy7 stkAnjHTlfdYAx3ASRFg2ln75kCm1ohz =Z26r -----END PGP SIGNATURE----- --UHN/qo2QbUvPLonB--