<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Thank you very much for the solution. It is what I am searching for. <BR>
<BR>
Frank<BR><BR>> To: fperez.net@gmail.com<BR>> CC: fw3@hotmail.co.jp; ipython-user@scipy.net<BR>> Subject: Re: [IPython-user] ipython in emacs<BR>> From: a.schmolck@gmx.net<BR>> Date: Thu, 6 Dec 2007 10:06:46 +0000<BR>> <BR>> "Fernando Perez" <fperez.net@gmail.com> writes:<BR>> <BR>> > On Dec 5, 2007 11:11 PM, wang frank <fw3@hotmail.co.jp> wrote:<BR>> >><BR>> >> Hi,<BR>> >><BR>> >> Even though I could not make ipython work with emacs 23.2 in window xp. It<BR>> >> is very easy to make it work in Linux. However, the most important feature<BR>> >> of ipython is missing inside emacs. That is retreiving the previouse command<BR>> >> from command history.<BR>> >><BR>> >> In ipython running from normal shell, press up and down arrow key will<BR>> >> bring back the previouse or next command. If you type some character of<BR>> >> previous command and press the up and down arrow key, ipython will automatic<BR>> >> search backward for the command starting with the character. If it is not<BR>> >> the command you want, you can press the up arrow key again. However, inside<BR>> >> emacs, the up and down arrow keys will more the cursor up and down. It<BR>> >> cannot retrieve the previous command. If you type the character of the<BR>> >> previouse command, up arrow key will not search the command. The tab key<BR>> >> will not complete the command inside emacs.<BR>> >><BR>> >> Does anyone know how to fix this?<BR>> ><BR>> > C-up instead of just up. Since Emacs implements its own cursor<BR>> > functionality, it overrides readline. So the keystrokes aren't quite<BR>> > the same, but you can get pretty much the same functionality (at some<BR>> > cost in muscle memory).<BR>> <BR>> No need to strain your poor muscles' limited mental ressources :) <BR>> <BR>> I think the following should do (added somehwere at the front of your .emacs),<BR>> either without prefix matching:<BR>> <BR>> (define-key comint-mode-map (kbd "<up>")<BR>> 'comint-previous-input)<BR>> (define-key comint-mode-map (kbd "<down>")<BR>> 'comint-next-input)<BR>> <BR>> or, I think handier, with:<BR>> <BR>> (define-key comint-mode-map (kbd "<up>") ; (I bind that to M-p)<BR>> 'comint-previous-matching-input-from-input)<BR>> <BR>> (define-key comint-mode-map (kbd "<next>")<BR>> 'comint-next-matching-input-from-input)<BR>> <BR>> cheers,<BR>> <BR>> 'as<BR><BR><br /><hr />Hotmail$B$,$*FO$1$9$k!"9,$;$K$J$k$?$a$N%a!<%k%^%,%8%s!V%S%8%M%99,J!O@!W<B;\Cf(B <a href='http://clk.atdmt.com/GBL/go/msnjpqjl0040000015gbl/direct/01/' target='_new'>http://go.windowslive.jp/</a></body>
</html>