* Problems with built-in Python mode of Emacs22 on w32 @ 2006-04-08 13:54 Anton V. Belyaev 2006-04-08 15:57 ` Eli Zaretskii ` (3 more replies) 0 siblings, 4 replies; 6+ messages in thread From: Anton V. Belyaev @ 2006-04-08 13:54 UTC (permalink / raw) I searched the group, but it seems nobody encountered such a problem. I use Emacs22 (for windows), it has python.el in the distrib. Also I use Python 2.4.3. When I am trying to send a statement to Python from Emacs, *Python* buffer is shown and it says following: Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> Traceback (most recent call last): File "<stdin>", line 1, in ? File "c:\Program Files\Emacs\emacs\etc\emacs.py", line 23, in ? import os, sys, traceback, inspect, rlcompleter, __main__ File "c:\Python24\lib\rlcompleter.py", line 42, in ? import readline ImportError: No module named readline >>> >>> Traceback (most recent call last): File "<stdin>", line 1, in ? NameError: name 'emacs' is not defined >>> >>> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problems with built-in Python mode of Emacs22 on w32 2006-04-08 13:54 Problems with built-in Python mode of Emacs22 on w32 Anton V. Belyaev @ 2006-04-08 15:57 ` Eli Zaretskii [not found] ` <mailman.201.1144511871.9609.help-gnu-emacs@gnu.org> ` (2 subsequent siblings) 3 siblings, 0 replies; 6+ messages in thread From: Eli Zaretskii @ 2006-04-08 15:57 UTC (permalink / raw) > From: "Anton V. Belyaev" <anton.belyaev@gmail.com> > Date: 8 Apr 2006 06:54:10 -0700 > Complaints-To: groups-abuse@google.com > Injection-Info: e56g2000cwe.googlegroups.com; posting-host=195.131.207.90; > posting-account=MJsRpw0AAAB1knIy9XY5Qkoe7pbkNmfZ > > I searched the group, but it seems nobody encountered such a problem. > > I use Emacs22 (for windows), it has python.el in the distrib. Also I > use Python 2.4.3. > > When I am trying to send a statement to Python from Emacs, *Python* > buffer is shown and it says following: Please describe exactly what you do to ``send a statement to Python'', and preferably also show the statement you tried to send. ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <mailman.201.1144511871.9609.help-gnu-emacs@gnu.org>]
* Re: Problems with built-in Python mode of Emacs22 on w32 [not found] ` <mailman.201.1144511871.9609.help-gnu-emacs@gnu.org> @ 2006-04-08 20:01 ` Anton V. Belyaev 0 siblings, 0 replies; 6+ messages in thread From: Anton V. Belyaev @ 2006-04-08 20:01 UTC (permalink / raw) Any statement actually. Send means send buffer, region or line to Python interpreter. This can be done using keys of major mode (I dont remeber which ones exactly). The error message is printed even if I just switch to interactive Python mode inside Emacs (C-c C-z, as I remember). When Emacs starts Python, it executes firstly its own piece of Python code, provided with Emacs itself. It is a kind of initialization, I suppose. This code causes error. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problems with built-in Python mode of Emacs22 on w32 2006-04-08 13:54 Problems with built-in Python mode of Emacs22 on w32 Anton V. Belyaev 2006-04-08 15:57 ` Eli Zaretskii [not found] ` <mailman.201.1144511871.9609.help-gnu-emacs@gnu.org> @ 2006-04-10 5:09 ` Stefan Monnier 2006-04-10 8:30 ` Alan Mackenzie 2006-04-12 11:18 ` Dave Love 3 siblings, 1 reply; 6+ messages in thread From: Stefan Monnier @ 2006-04-10 5:09 UTC (permalink / raw) > I searched the group, but it seems nobody encountered such a problem. > I use Emacs22 (for windows), it has python.el in the distrib. Also I > use Python 2.4.3. Please use M-x report-emas-bug RET when reporting such problems. > When I am trying to send a statement to Python from Emacs, *Python* > buffer is shown and it says following: > Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] > on win32 > Type "help", "copyright", "credits" or "license" for more information. >>>> Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "c:\Program Files\Emacs\emacs\etc\emacs.py", line 23, in ? > import os, sys, traceback, inspect, rlcompleter, __main__ > File "c:\Python24\lib\rlcompleter.py", line 42, in ? > import readline > ImportError: No module named readline >>>> >>> Traceback (most recent call last): > File "<stdin>", line 1, in ? > NameError: name 'emacs' is not defined >>>> >>> Looking at this backtrace, I see that c:\python24\lib\rlcompleter.py imported `readline' but that `readline' was not found. That sounds like an internal problem in this installation of Python. But googling around I see: The rlcompleter module defines a completion function for the readline module by completing valid Python identifiers and keywords. This module is Unix-specific due to its dependence on the readline module. If you look at ...emacs.../etc/emacs.py you'll see that it refers to rlcompleter twice: once to import it, and another time in `complete' to actually use it. So I guess the best workaround (until the completion feature can be made to actually work under w32) is to ignore the error at both places. I've never written Python code so I have no idea if the patch below will work (wrote it while looking at the online Python manual), but please try it out and tell me what happens. Stefan --- emacs.py 07 fév 2006 12:22:26 -0500 1.6 +++ emacs.py 10 avr 2006 01:06:03 -0400 @@ -20,7 +20,10 @@ # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. -import os, sys, traceback, inspect, rlcompleter, __main__ +import os, sys, traceback, inspect, __main__ +# The rlcompleter module seems to only be available in Unix for now. +try: import rlcompleter +except: pass __all__ = ["eexecfile", "args", "complete", "ehelp", "eimport"] @@ -69,8 +72,8 @@ """Complete TEXT in NAMESPACE and print a Lisp list of completions. NAMESPACE is currently not used.""" if namespace is None: namespace = __main__.__dict__ - c = rlcompleter.Completer (namespace) try: + c = rlcompleter.Completer (namespace) if '.' in text: matches = c.attr_matches (text) else: ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problems with built-in Python mode of Emacs22 on w32 2006-04-10 5:09 ` Stefan Monnier @ 2006-04-10 8:30 ` Alan Mackenzie 0 siblings, 0 replies; 6+ messages in thread From: Alan Mackenzie @ 2006-04-10 8:30 UTC (permalink / raw) Stefan Monnier <monnier@iro.umontreal.ca> wrote on Mon, 10 Apr 2006 01:09:31 -0400: > Please use M-x report-emas-bug RET when reporting such problems. Or even M-x report-emacs-bug. :-) ^ > Stefan -- Alan Mackenzie (Munich, Germany) Email: aacm@muuc.dee; to decode, wherever there is a repeated letter (like "aa"), remove half of them (leaving, say, "a"). ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Problems with built-in Python mode of Emacs22 on w32 2006-04-08 13:54 Problems with built-in Python mode of Emacs22 on w32 Anton V. Belyaev ` (2 preceding siblings ...) 2006-04-10 5:09 ` Stefan Monnier @ 2006-04-12 11:18 ` Dave Love 3 siblings, 0 replies; 6+ messages in thread From: Dave Love @ 2006-04-12 11:18 UTC (permalink / raw) "Anton V. Belyaev" <anton.belyaev@gmail.com> writes: > I searched the group, but it seems nobody encountered such a problem. Well it's not the correct place to report such problems, not that reporting them correctly gets Emacs' Python support fixed :-(. The version at <URL:http://www.loveshack.ukfsn.org/emacs/> fixes this and other things. I don't know whether it's possible easily to make completion work under MS Windows. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-04-12 11:18 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-04-08 13:54 Problems with built-in Python mode of Emacs22 on w32 Anton V. Belyaev 2006-04-08 15:57 ` Eli Zaretskii [not found] ` <mailman.201.1144511871.9609.help-gnu-emacs@gnu.org> 2006-04-08 20:01 ` Anton V. Belyaev 2006-04-10 5:09 ` Stefan Monnier 2006-04-10 8:30 ` Alan Mackenzie 2006-04-12 11:18 ` Dave Love
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).