help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: shell mode - how to stop division into bogus fields


From: Bob Proulx
Subject: Re: shell mode - how to stop division into bogus fields
Date: Tue, 22 Nov 2011 18:57:25 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

XeCycle wrote:
> 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.
> 
> 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." 
> >
> > 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.
> 
> 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

Attachment: signature.asc
Description: Digital signature


reply via email to

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