[IPython-user] Please change the ipython.el to fix the tab completion issue of ipython with emac
Wed Jan 9 12:55:47 CST 2008
Since I am not familiar with elisp/emacs/ipython, I really hope the expert can jump in and fix this problem. After I add the forward slash in the ipython.el, it works much better for me since it can complete most cases execpt of the names with space in it.
It seems that you are also using emacs wiht ipython, I wonder what version of the emacs and ipython/pyreadline you are using. The newest version of ipython does not work without the fixe of pyreadline and some other tweak for me.
I will look the hippie expand to see whether it will be better.
Frank> To: email@example.com> From: firstname.lastname@example.org> Date: Wed, 9 Jan 2008 01:32:03 +0000> Subject: Re: [IPython-user] Please change the ipython.el to fix the tab completion issue of ipython with emac> > wang frank <email@example.com> writes:> > > Hi, Alexander,> > > > When I run the ipython in the emacs, I found that the tab completion behaves> > different from the ipython running directly from DOS prompt. When you type,> > for example, win and tab key, the ipython will complete the win to> > > > window/> > > > If you type the tab key again, without the change, ipython.el will display> > something differently since the pattern in ipython.el becomes empty. By> > adding the / in the command, it will skip the / and work normally.> > > > However, if the file name or directory contains empty, such as Program> > Files, this will not fix the problem. I am not emacs and elisp expert and> > could not figout the issue out.> > > Ah, ok it looks like ipython recently might have got smarter in its> emacs-interaction (I wouldn't have noticed since I have bound M-shift-tab to> hippie-expand globally and that will complete filenames (inter alia)).> > The following is all from vague memory so details might be wrong:> > IIRC, the original reason why ipython.el had different completion> functionality from normal ipython, is that ipython delegated some of the> functionality of finding the right completion to readline, which doesn't work> under emacs. So currently ipython.el just tries to find the preceding> expression and passes that to an function that I think I wrote years ago> somewhere in the guts of ipython, that offers some (limited) subset of the> functionality that would otherwise have been provided by readline. But as the> comment suggests:> > ;; XXX currently we go backwards to find the beginning of an> ;; expression part; a more powerful approach in the future might be> ;; to let ipython have the complete line, so that context can be> ;; used> ;; to do things like filename completion etc.> (beg (save-excursion (skip-chars-backward "a-z0-9A-Z_." (point-at-bol))> (point))> > Note that your proposed fix won't work for other types of filename (e.g. w/> hyphens, tildes and backslashes in it) and will break identifier search (e.g.> "13.0/some_number<tab>" will be parsed as a single chunk which might cause> breakage, depnding on what __IP.Completer.all_completions does these days).> > Since I don't use ipython's completion (outside emacs) as I always run ipython> in emacs, I don't know how smart this completion mechanism has become (e.g.> whether it will complete differently on "cd blah<tab>" then on, say> "help(blah<tab>")) and I don't know whether the code is now factored so that> there's some nice function one can call w/ the *whole line* and it will give> some completions. If there is (or someone volunteers to write it) that would> be the way to go (i.e. replace the skip-chars-backward w/ beginning-of-linea> and modify that function so that it calls ipython-completion-command-string)).> > cheers,> > 'as> _______________________________________________> IPython-user mailing list> IPythonfirstname.lastname@example.org> http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
Webメールもプロバイダのメールも、まとめて使えるWindows Live メール
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-user