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