[IPython-user] ipython in emacs
Thu Dec 6 21:00:04 CST 2007
Thank you very much for the solution. It is what I am searching for.
Frank> To: email@example.com> CC: firstname.lastname@example.org; email@example.com> Subject: Re: [IPython-user] ipython in emacs> From: firstname.lastname@example.org> Date: Thu, 6 Dec 2007 10:06:46 +0000> > "Fernando Perez" <email@example.com> writes:> > > On Dec 5, 2007 11:11 PM, wang frank <firstname.lastname@example.org> 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 ipython 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 aren'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' limited 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-user