<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&nbsp;is&nbsp;what I am searching for.&nbsp;<BR>
&nbsp;<BR>
Frank<BR><BR>&gt; To: fperez.net@gmail.com<BR>&gt; CC: fw3@hotmail.co.jp; ipython-user@scipy.net<BR>&gt; Subject: Re: [IPython-user] ipython in emacs<BR>&gt; From: a.schmolck@gmx.net<BR>&gt; Date: Thu, 6 Dec 2007 10:06:46 +0000<BR>&gt; <BR>&gt; "Fernando Perez" &lt;fperez.net@gmail.com&gt; writes:<BR>&gt; <BR>&gt; &gt; On Dec 5, 2007 11:11 PM, wang frank &lt;fw3@hotmail.co.jp&gt; wrote:<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; Hi,<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; Even though I could not make ipython work with emacs 23.2 in window xp. It<BR>&gt; &gt;&gt; is very easy to make it work in Linux. However, the most important feature<BR>&gt; &gt;&gt; of ipython is missing inside emacs. That is retreiving the previouse command<BR>&gt; &gt;&gt; from command history.<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; In ipython running from normal shell, press up and down arrow key will<BR>&gt; &gt;&gt; bring back the previouse or next command. If you type some character of<BR>&gt; &gt;&gt; previous command and press the up and down arrow key, ipython will automatic<BR>&gt; &gt;&gt; search backward for the command starting with the character. If it is not<BR>&gt; &gt;&gt; the command you want, you can press the up arrow key again. However, inside<BR>&gt; &gt;&gt; emacs, the up and down arrow keys will more the cursor up and down. It<BR>&gt; &gt;&gt; cannot retrieve the previous command. If you type the character of the<BR>&gt; &gt;&gt; previouse command, up arrow key will not search the command. The tab key<BR>&gt; &gt;&gt; will not complete the command inside emacs.<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; Does anyone know how to fix this?<BR>&gt; &gt;<BR>&gt; &gt; C-up instead of just up. Since Emacs implements its own cursor<BR>&gt; &gt; functionality, it overrides readline. So the keystrokes aren't quite<BR>&gt; &gt; the same, but you can get pretty much the same functionality (at some<BR>&gt; &gt; cost in muscle memory).<BR>&gt; <BR>&gt; No need to strain your poor muscles' limited mental ressources :) <BR>&gt; <BR>&gt; I think the following should do (added somehwere at the front of your .emacs),<BR>&gt; either without prefix matching:<BR>&gt; <BR>&gt; (define-key comint-mode-map (kbd "&lt;up&gt;")<BR>&gt; 'comint-previous-input)<BR>&gt; (define-key comint-mode-map (kbd "&lt;down&gt;")<BR>&gt; 'comint-next-input)<BR>&gt; <BR>&gt; or, I think handier, with:<BR>&gt; <BR>&gt; (define-key comint-mode-map (kbd "&lt;up&gt;") ; (I bind that to M-p)<BR>&gt; 'comint-previous-matching-input-from-input)<BR>&gt; <BR>&gt; (define-key comint-mode-map (kbd "&lt;next&gt;")<BR>&gt; 'comint-next-matching-input-from-input)<BR>&gt; <BR>&gt; cheers,<BR>&gt; <BR>&gt; '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>