all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Silvio Levy <levy@msri.org>
To: help-gnu-emacs@gnu.org
Subject: shell mode - how to stop division into bogus fields
Date: Mon, 21 Nov 2011 00:11:40 -0800	[thread overview]
Message-ID: <20111121081140.E2CEA1810AB@neo.msri.org> (raw)

[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




             reply	other threads:[~2011-11-21  8:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-21  8:11 Silvio Levy [this message]
2011-11-21 12:15 ` shell mode - how to stop division into bogus fields XeCycle
2011-11-23  1:57   ` Bob Proulx
  -- strict thread matches above, loose matches on Subject: below --
2011-11-23  2:34 Silvio Levy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111121081140.E2CEA1810AB@neo.msri.org \
    --to=levy@msri.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.