unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* emacs shell cursor movement is broken in 22.1
@ 2008-03-13 20:44 jimka
  2008-03-15  2:41 ` wainstead
  2008-03-16  0:42 ` Jason Rumney
  0 siblings, 2 replies; 12+ messages in thread
From: jimka @ 2008-03-13 20:44 UTC (permalink / raw)
  To: help-gnu-emacs

I've used the emacs shell for 20 years and emacs 22.1 has added a
bunch
of "features" which make like difficult.

Can someone explain to me how to make the cursor navigation functions
work in a more sane way.

E.g.,

1) if i use the shell command !!:p to print the previous shell
command.
In previous versions of emacs i could simply edit that line and press
return and
it would enter it as the next input to the shell.  Now, emacs 22.1
ignores it
when i press enter on such a line.

2) if i use !!:p to print the shell command such as "ls -R
xyzzy*.x.y.*"
then move the curser up to the line and insert something at the
beginning of the line
like cd /xyzzy; so that the new line content is "cd /xyzzy;ls -R
xyzzy*.x.y.*"

 At that point if i press C-E to go to the end of the line and C-A to
go to
the beginning of the line, the cursor stops at the ls -l, and does not
move back to the REAL
beginning of the line.   I've checked and C-A is still bound to move-
beginning-of-line
and i looked at the elisp code for move-beginning-of-line and cannot
figure out
why it is not really going to the beginning, and how to influence it
to do sl.

3) similarly on the above line "cd /xyzzy;ls -R xyzzy*.x.y.*" pressing
C-K
only cuts the part from cd /xyzzy;.  ie. it does not cut to the end of
the line
like it did for the past 20 years. kill-line seems to still be bound
to kill-line
and in every other mode kill-line really kills the rest of the line.

Can someone please give me some clues about what is going wrong?
Maybe it is some minor mode i need to disable???

many thanks
-jim


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: emacs shell cursor movement is broken in 22.1
  2008-03-13 20:44 emacs shell cursor movement is broken in 22.1 jimka
@ 2008-03-15  2:41 ` wainstead
  2008-03-15 15:01   ` jimka
  2008-03-16  0:42 ` Jason Rumney
  1 sibling, 1 reply; 12+ messages in thread
From: wainstead @ 2008-03-15  2:41 UTC (permalink / raw)
  To: help-gnu-emacs

On Mar 13, 4:44 pm, jimka <ji...@rdrop.com> wrote:
> I've used the emacs shell for 20 years and emacs 22.1 has added a
> bunch
> of "features" which make like difficult.
>
> Can someone explain to me how to make the cursor navigation functions
> work in a more sane way.
>
> E.g.,
>
> 1) if i use the shell command !!:p to print the previous shell
> command.
> In previous versions of emacs i could simply edit that line and press
> return and
> it would enter it as the next input to the shell.  Now, emacs 22.1
> ignores it
> when i press enter on such a line.
>
> 2) if i use !!:p to print the shell command such as "ls -R
> xyzzy*.x.y.*"
> then move the curser up to the line and insert something at the
> beginning of the line
> like cd /xyzzy; so that the new line content is "cd /xyzzy;ls -R
> xyzzy*.x.y.*"
>
>  At that point if i press C-E to go to the end of the line and C-A to
> go to
> the beginning of the line, the cursor stops at the ls -l, and does not
> move back to the REAL
> beginning of the line.   I've checked and C-A is still bound to move-
> beginning-of-line
> and i looked at the elisp code for move-beginning-of-line and cannot
> figure out
> why it is not really going to the beginning, and how to influence it
> to do sl.
>
> 3) similarly on the above line "cd /xyzzy;ls -R xyzzy*.x.y.*" pressing
> C-K
> only cuts the part from cd /xyzzy;.  ie. it does not cut to the end of
> the line
> like it did for the past 20 years. kill-line seems to still be bound
> to kill-line
> and in every other mode kill-line really kills the rest of the line.
>
> Can someone please give me some clues about what is going wrong?
> Maybe it is some minor mode i need to disable???
>
> many thanks
> -jim

Hi Jim,

Like you I've used shell mode for years. The problems you see started
a few years ago, showing up in the OS X build; now they are in the
Linux build as well.

This week I'm in Japan and am meeting with one of the maintainers. I
am hoping to demo these bugs to him and get his feedback. It's high
time these were addressed.

~swain


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: emacs shell cursor movement is broken in 22.1
  2008-03-15  2:41 ` wainstead
@ 2008-03-15 15:01   ` jimka
  2008-03-26 20:43     ` wainstead
  0 siblings, 1 reply; 12+ messages in thread
From: jimka @ 2008-03-15 15:01 UTC (permalink / raw)
  To: help-gnu-emacs

great!  that is great news


>
> Hi Jim,
>
> Like you I've used shell mode for years. The problems you see started
> a few years ago, showing up in the OS X build; now they are in the
> Linux build as well.
>
> This week I'm in Japan and am meeting with one of the maintainers. I
> am hoping to demo these bugs to him and get his feedback. It's high
> time these were addressed.
>
> ~swain



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: emacs shell cursor movement is broken in 22.1
  2008-03-13 20:44 emacs shell cursor movement is broken in 22.1 jimka
  2008-03-15  2:41 ` wainstead
@ 2008-03-16  0:42 ` Jason Rumney
  2008-03-16 15:31   ` jimka
  1 sibling, 1 reply; 12+ messages in thread
From: Jason Rumney @ 2008-03-16  0:42 UTC (permalink / raw)
  To: help-gnu-emacs

On 13 Mar, 20:44, jimka <ji...@rdrop.com> wrote:

> 1) if i use the shell command !!:p to print the previous shell
> command.
> In previous versions of emacs i could simply edit that line and press
> return and
> it would enter it as the next input to the shell.  Now, emacs 22.1
> ignores it
> when i press enter on such a line.

I have no idea why that change was made or whether there was a good
reason for it, but is there a reason why you use !!:p rather than M-p
to get the previous command? The latter puts the command at the
prompt, where commands are expected to be input.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: emacs shell cursor movement is broken in 22.1
  2008-03-16  0:42 ` Jason Rumney
@ 2008-03-16 15:31   ` jimka
  2008-03-16 15:49     ` Peter Dyballa
                       ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: jimka @ 2008-03-16 15:31 UTC (permalink / raw)
  To: help-gnu-emacs



> I have no idea why that change was made or whether there was a good
> reason for it, but is there a reason why you use !!:p rather than M-p
> to get the previous command? The latter puts the command at the
> prompt, where commands are expected to be input.

the !!:p example is just a simple example that is easy to explain
in the posting. There is nothing really special about !!:p.

Another example would be if i want to find the last command that
contained a certain word.
If i want to see the history, i type "history",  If i want to see all
the history
which contained /tmp, i use "history | grep /tmp", and i expect emacs
to be
able to edit that result with its normal full screen editing.  During
that
editing C-e and C-a should work as they do in any other full screen
editing mode.


About M-p, I think the reason people want the M-p and arrow keys to
display
history, is because shells don't normally enable full screen editing.
One reason i started using the emacs shell in the 80s was because it
did just that.
I don't see M-p and C-up-arrow as very useful substitutes for full-
screen
capability.  (i admit that i'm in the minority. most people do not
want a powerful
shell editing facility, but instead a very klunky one.)



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: emacs shell cursor movement is broken in 22.1
  2008-03-16 15:31   ` jimka
@ 2008-03-16 15:49     ` Peter Dyballa
       [not found]     ` <mailman.8981.1205682606.18990.help-gnu-emacs@gnu.org>
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Peter Dyballa @ 2008-03-16 15:49 UTC (permalink / raw)
  To: jimka; +Cc: help-gnu-emacs


Am 16.03.2008 um 16:31 schrieb jimka:

> If i want to see the history, i type "history",  If i want to see all
> the history
> which contained /tmp, i use "history | grep /tmp",

Why do you use shell mechanisms? GNU Emacs has more efficient ways to  
retrieve an elderly shell command ... (comint-previous-matching-input  
or M-r for example)

--
Greetings

   Pete

We are usually convinced more easily by reasons we have found  
ourselves than by those which have occurred to others.
				– Blaise Pascal







^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: emacs shell cursor movement is broken in 22.1
       [not found]     ` <mailman.8981.1205682606.18990.help-gnu-emacs@gnu.org>
@ 2008-03-16 16:03       ` jimka
  0 siblings, 0 replies; 12+ messages in thread
From: jimka @ 2008-03-16 16:03 UTC (permalink / raw)
  To: help-gnu-emacs

On Mar 16, 4:49 pm, Peter Dyballa <Peter_Dyba...@Web.DE> wrote:

>
> Why do you useshellmechanisms? GNU Emacs has more efficient ways to
> retrieve an elderlyshellcommand ... (comint-previous-matching-input
> or M-r for example)
>
>
>    Pete
>



yes it is always the case with emacs that there is a more
efficient way in terms of fewer keystokes.  but i think the
question of how to most efficiently do a job-X in emacs
is an independent question from why did the full-screen-editing
features of the emacs shell regress.  Don't you agree?

By the way i do often use C-r to find the previous comand which
matches some pattern and either press enter twice to
execute it again, or press enter to leave the search mode,
then edit the command and enter it again.  C-r has a great advantage
over M-r because it lets me see the context in which something
happened
and also lets me match things that were not shell commands
at all but might look like shell commands.

-jim


^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: emacs shell cursor movement is broken in 22.1
  2008-03-16 15:31   ` jimka
  2008-03-16 15:49     ` Peter Dyballa
       [not found]     ` <mailman.8981.1205682606.18990.help-gnu-emacs@gnu.org>
@ 2008-03-16 16:59     ` Drew Adams
       [not found]     ` <mailman.8984.1205686774.18990.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 12+ messages in thread
From: Drew Adams @ 2008-03-16 16:59 UTC (permalink / raw)
  To: 'jimka', help-gnu-emacs

> Another example would be if i want to find the last command that
> contained a certain word.

I haven't followed this thread, but you might be interested in trying
Icicles' comint (shell) mode enhancements. They let you easily complete
against past shell inputs in various ways, to reuse them.

http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Other_Search_Commands#toc7





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: emacs shell cursor movement is broken in 22.1
       [not found]     ` <mailman.8984.1205686774.18990.help-gnu-emacs@gnu.org>
@ 2008-03-16 17:51       ` jimka
  2008-03-16 19:16         ` Drew Adams
  0 siblings, 1 reply; 12+ messages in thread
From: jimka @ 2008-03-16 17:51 UTC (permalink / raw)
  To: help-gnu-emacs

On Mar 16, 5:59 pm, "Drew Adams" <drew.ad...@oracle.com> wrote:
> > Another example would be if i want to find the last command that
> > contained a certain word.
>
> I haven't followed this thread, but you might be interested in trying
> Icicles' comint (shell) mode enhancements. They let you easily complete
> against pastshellinputs in various ways, to reuse them.
>
> http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Other_Search_Commands...

yes there are lots and lots of interesting modes.  But what i want
is to  search in the buffer, with normal buffer search commands such
as
C-r and C-s, edit the command like a normal buffer, inserting,
deleting and overwriting, then
press ENTER to re-execute the command at the next shell prompt.

fancy completion modes are well and good, but they should not prevent
basic navigation and editing.

-jim


^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: emacs shell cursor movement is broken in 22.1
  2008-03-16 17:51       ` jimka
@ 2008-03-16 19:16         ` Drew Adams
  0 siblings, 0 replies; 12+ messages in thread
From: Drew Adams @ 2008-03-16 19:16 UTC (permalink / raw)
  To: 'jimka', help-gnu-emacs

> > > Another example would be if i want to find the last command that
> > > contained a certain word.
> >
> > I haven't followed this thread, but you might be interested 
> > in trying Icicles' comint (shell) mode enhancements. They let
> > you easily complete against pastshellinputs in various ways,
> > to reuse them.
> >
> http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Other_Search_C
> ommands...
> 
> yes there are lots and lots of interesting modes.  But what i want
> is to search in the buffer, with normal buffer search commands such
> as C-r and C-s, edit the command like a normal buffer, inserting,
> deleting and overwriting, then
> press ENTER to re-execute the command at the next shell prompt.
> 
> fancy completion modes are well and good, but they should not prevent
> basic navigation and editing.

Nothing in Icicles prevents basic navigation and editing.

It sounds like you can already do just what you want, based on your
description, above. What prevents you now from searching with C-r, editing,
and re-executing?

But as I said, I didn't follow the thread (sorry), so it's not clear to me
what you might want beyond what you say above. That's my fault. Just trying
to help. 

FWIW, 'icicle-comint-search' does what you describe above: it searches the
buffer. (But it doesn't use "normal buffer search commands such as C-r and
C-s - it gives you better search features.) When you choose the past command
that you want, you can certainly edit it and then hit ENTER to re-execute.

It's OK if I don't get it - I don't really need to understand your problem
better. If the info I gave helps, great. If not, ignore it. HTH.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: emacs shell cursor movement is broken in 22.1
  2008-03-15 15:01   ` jimka
@ 2008-03-26 20:43     ` wainstead
  2008-03-26 20:45       ` wainstead
  0 siblings, 1 reply; 12+ messages in thread
From: wainstead @ 2008-03-26 20:43 UTC (permalink / raw)
  To: help-gnu-emacs

On Mar 15, 11:01 am, jimka <ji...@rdrop.com> wrote:
> great! that is great news

Hey jimka!

Well, I met with Miles Bader who, it turns out, wrote major portions
of shell-mode. I didn't know this beforehand so it was a pleasant
surprise.

I demo'd the problems for him; he had a bit of trouble though because
of some of the oddities of running Emacs on OS X; he first thought it
might have something to do with the text.

He thinks it's definitely a Lisp problem, not something wonky with the
terminal or anything. (This didn't surprise me much). shell-mode
inherits stuff from comint-mode, and he thinks the problem lies in
somebody doing a fix/kludge/improvement somewhere else which has
introduced this bug to shell-mode.

I'm going to point him to this thread and see if I can nudge him to
diagnose the bug... it seems like about thirty minutes of poking
around and he'll know what's wrong and how to fix it.

~swain


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: emacs shell cursor movement is broken in 22.1
  2008-03-26 20:43     ` wainstead
@ 2008-03-26 20:45       ` wainstead
  0 siblings, 0 replies; 12+ messages in thread
From: wainstead @ 2008-03-26 20:45 UTC (permalink / raw)
  To: help-gnu-emacs

On Mar 26, 4:43 pm, wainst...@gmail.com wrote:

> He thinks it's definitely a Lisp problem, not something wonky with the
> terminal or anything.

Oh, I just remembered he mentioned something about text having "sticky
properties" that adjoining text picks up, or does not. This was way
over my head, but it kinda makes sense given the behavior I see.

~swain



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-03-26 20:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-13 20:44 emacs shell cursor movement is broken in 22.1 jimka
2008-03-15  2:41 ` wainstead
2008-03-15 15:01   ` jimka
2008-03-26 20:43     ` wainstead
2008-03-26 20:45       ` wainstead
2008-03-16  0:42 ` Jason Rumney
2008-03-16 15:31   ` jimka
2008-03-16 15:49     ` Peter Dyballa
     [not found]     ` <mailman.8981.1205682606.18990.help-gnu-emacs@gnu.org>
2008-03-16 16:03       ` jimka
2008-03-16 16:59     ` Drew Adams
     [not found]     ` <mailman.8984.1205686774.18990.help-gnu-emacs@gnu.org>
2008-03-16 17:51       ` jimka
2008-03-16 19:16         ` Drew Adams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).