all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Silvio Levy <levy@msri.org>
To: Bob Proulx <bob@proulx.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: shell mode - how to stop division into bogus fields
Date: Tue, 22 Nov 2011 18:34:23 -0800	[thread overview]
Message-ID: <20111123023423.26529180B26@neo.msri.org> (raw)
In-Reply-To: Your message of Tue, 22 Nov 2011 18:57:25 -0700


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, <return>
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:

  <green>$</green>
    <bold white>echo one</bold white> two <bold white>two</bold white>

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



             reply	other threads:[~2011-11-23  2:34 UTC|newest]

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

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=20111123023423.26529180B26@neo.msri.org \
    --to=levy@msri.org \
    --cc=bob@proulx.com \
    --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.