<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hi, Alexander,<BR>
&nbsp;<BR>
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.<BR>
&nbsp;<BR>
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.<BR>
&nbsp;<BR>
I will look the hippie expand to see whether it will be better.<BR>
&nbsp;<BR>
Thanks<BR>
&nbsp;<BR>
Frank<BR><BR>&gt; To: ipython-user@scipy.org<BR>&gt; From: a.schmolck@gmx.net<BR>&gt; Date: Wed, 9 Jan 2008 01:32:03 +0000<BR>&gt; Subject: Re: [IPython-user] Please change the ipython.el to fix the tab completion issue of ipython with emac<BR>&gt; <BR>&gt; wang frank &lt;fw3@hotmail.co.jp&gt; writes:<BR>&gt; <BR>&gt; &gt; Hi, Alexander,<BR>&gt; &gt; <BR>&gt; &gt; When I run the ipython in the emacs, I found that the tab completion behaves<BR>&gt; &gt; different from the ipython running directly from DOS prompt. When you type,<BR>&gt; &gt; for example, win and tab key, the ipython will complete the win to<BR>&gt; &gt; <BR>&gt; &gt; window/<BR>&gt; &gt; <BR>&gt; &gt; If you type the tab key again, without the change, ipython.el will display<BR>&gt; &gt; something differently since the pattern in ipython.el becomes empty. By<BR>&gt; &gt; adding the / in the command, it will skip the / and work normally.<BR>&gt; &gt; <BR>&gt; &gt; However, if the file name or directory contains empty, such as Program<BR>&gt; &gt; Files, this will not fix the problem. I am not emacs and elisp expert and<BR>&gt; &gt; could not figout the issue out.<BR>&gt; <BR>&gt; <BR>&gt; Ah, ok it looks like ipython recently might have got smarter in its<BR>&gt; emacs-interaction (I wouldn't have noticed since I have bound M-shift-tab to<BR>&gt; hippie-expand globally and that will complete filenames (inter alia)).<BR>&gt; <BR>&gt; The following is all from vague memory so details might be wrong:<BR>&gt; <BR>&gt; IIRC, the original reason why ipython.el had different completion<BR>&gt; functionality from normal ipython, is that ipython delegated some of the<BR>&gt; functionality of finding the right completion to readline, which doesn't work<BR>&gt; under emacs. So currently ipython.el just tries to find the preceding<BR>&gt; expression and passes that to an function that I think I wrote years ago<BR>&gt; somewhere in the guts of ipython, that offers some (limited) subset of the<BR>&gt; functionality that would otherwise have been provided by readline. But as the<BR>&gt; comment suggests:<BR>&gt; <BR>&gt; ;; XXX currently we go backwards to find the beginning of an<BR>&gt; ;; expression part; a more powerful approach in the future might be<BR>&gt; ;; to let ipython have the complete line, so that context can be<BR>&gt; ;; used<BR>&gt; ;; to do things like filename completion etc.<BR>&gt; (beg (save-excursion (skip-chars-backward "a-z0-9A-Z_." (point-at-bol))<BR>&gt; (point))<BR>&gt; <BR>&gt; Note that your proposed fix won't work for other types of filename (e.g. w/<BR>&gt; hyphens, tildes and backslashes in it) and will break identifier search (e.g.<BR>&gt; "13.0/some_number&lt;tab&gt;" will be parsed as a single chunk which might cause<BR>&gt; breakage, depnding on what __IP.Completer.all_completions does these days).<BR>&gt; <BR>&gt; Since I don't use ipython's completion (outside emacs) as I always run ipython<BR>&gt; in emacs, I don't know how smart this completion mechanism has become (e.g.<BR>&gt; whether it will complete differently on "cd blah&lt;tab&gt;" then on, say<BR>&gt; "help(blah&lt;tab&gt;")) and I don't know whether the code is now factored so that<BR>&gt; there's some nice function one can call w/ the *whole line* and it will give<BR>&gt; some completions. If there is (or someone volunteers to write it) that would<BR>&gt; be the way to go (i.e. replace the skip-chars-backward w/ beginning-of-linea<BR>&gt; and modify that function so that it calls ipython-completion-command-string)).<BR>&gt; <BR>&gt; cheers,<BR>&gt; <BR>&gt; 'as<BR>&gt; _______________________________________________<BR>&gt; IPython-user mailing list<BR>&gt; IPython-user@scipy.org<BR>&gt; http://lists.ipython.scipy.org/mailman/listinfo/ipython-user<BR><BR><br /><hr />Web$B%a!<%k$b%W%m%P%$%@$N%a!<%k$b!"$^$H$a$F;H$($k(BWindows Live $B%a!<%k(B <a href='http://clk.atdmt.com/GBL/go/msnjpqjl0040000015gbl/direct/01/' target='_new'>http://go.windowslive.jp/</a></body>
</html>