[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

shell mode - how to stop division into bogus fields

From: Silvio Levy
Subject: shell mode - how to stop division into bogus fields
Date: Mon, 21 Nov 2011 00:11:40 -0800

[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,

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

Can anyone teach me how the old behavior can be restored?

Thanks in advance

Silvio Levy

reply via email to

[Prev in Thread] Current Thread [Next in Thread]