Thank you very much for the solution. It is what I am searching for.
Frank
> To: fperez.net <at> gmail.com
> CC: fw3 <at> hotmail.co.jp; ipython-user <at> scipy.net
> Subject: Re: [IPython-user] ipython in emacs
> From: a.schmolck <at> gmx.net
> Date: Thu, 6 Dec 2007 10:06:46 +0000
>
> "Fernando Perez" <fperez.net <at> gmail.com> writes:
>
> > On Dec 5, 2007 11:11 PM, wang frank <fw3 <at> hotmail.co.jp> wrote:
> >>
> >> Hi,
> >>
> >> Even though I could not make ipython work with emacs 23.2 in window xp. It
> >> is very easy to make it work in Linux. However, the most important feature
> >> of ipython is missing inside emacs. That is retreiving the previouse command
> >> from command history.
> >>
> >> In i
python running from normal shell, press up and down arrow key will
> >> bring back the previouse or next command. If you type some character of
> >> previous command
and press the up and down arrow key, ipython will automatic
> >> search backward for the command starting with the character. If it is not
> >> the command you want, you can press the up arrow key again. However, inside
> >> emacs, the up and down arrow keys will more the cursor up and down. It
> >> cannot retrieve the previous command. If you type the character of the
> >> previouse command, up arrow key will not search the command. The tab key
> >> will not complete the command inside emacs.
> >>
> >> Does anyone know how to fix this?
> >
> > C-up instead of just up. Since Emacs implements its own cursor
> > functionality, it overrides readline. So the keystrokes ar
en't quite
> > the same, but you can get pretty much the same functionality (at some
> > cost in muscle memory).
>
> No need to strain your poor muscles' limit
ed mental ressources :)
>
> I think the following should do (added somehwere at the front of your .emacs),
> either without prefix matching:
>
> (define-key comint-mode-map (kbd "<up>")
> 'comint-previous-input)
> (define-key comint-mode-map (kbd "<down>")
> 'comint-next-input)
>
> or, I think handier, with:
>
> (define-key comint-mode-map (kbd "<up>") ; (I bind that to M-p)
> 'comint-previous-matching-input-from-input)
>
> (define-key comint-mode-map (kbd "<next>")
> 'comint-next-matching-input-from-input)
>
> cheers,
>
> 'as
Hotmailがお届けする、幸せになるためのメールマガジン「ビジネス幸福論」実施中
http://go.windowslive.jp/