From andreas.roehler at online.de Mon Aug 1 07:51:52 2011 From: andreas.roehler at online.de (=?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?=) Date: Mon, 01 Aug 2011 07:51:52 +0200 Subject: [Python-mode] [Bug 818665] Re: colon causes error In-Reply-To: <20110731212231.1956.11987.malone@gac.canonical.com> References: <20110730221054.12141.25730.malonedeb@chaenomeles.canonical.com> <20110731212231.1956.11987.malone@gac.canonical.com> Message-ID: <4E363EF8.8020007@online.de> Am 31.07.2011 23:22, schrieb Glenn Linderman: > Thanks for the quick response, Andreas. I haven't figured out how to do > checkouts here, Hi Glenn, will make a bug-fix release pretty soon, as typing ":" should work :) BTW getting the trunk is quite easy Make sure you have bazaar installed at your system. Then at a shell prompt type bzr branch lp:python-mode Should you see no files in your directory then, they are in the local tree still. bzr checkout should deliver a working copy then. Once you have a local branch bzr pull lp:python-mode updates it with the trunk (only needed if further commits have been done). but commenting out that line does stop the beep.... > but.... it seems that py-electric-colon must be responsible for > outdenting the else: that one might consider typing afterwards: > > if x: > abc > else: > > is no longer outdented when the : is typed. > So I have a usecase for keeping py-electric-colon... BTW at http://bazaar.launchpad.net/~python-mode-devs/python-mode/python-mode/revision/474 you get a button "download diff" you may look at how the bug is fixed in the trunk - and maybe repair your py-eletric-colon already Thanks again, Andreas From andreas.roehler at online.de Tue Aug 2 11:38:00 2011 From: andreas.roehler at online.de (=?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?=) Date: Tue, 02 Aug 2011 11:38:00 +0200 Subject: [Python-mode] py-execute-buffer and swap buffers In-Reply-To: <4E33D843.6020307@gmail.com> References: <4E31C39F.7050005@gmail.com> <4E3276F9.5030504@online.de> <4E33D843.6020307@gmail.com> Message-ID: <4E37C578.8020909@online.de> Am 30.07.2011 12:09, schrieb Andrea Crotti: > On Fri 29 Jul 2011 11:01:45 AM CEST, Andreas R?hler wrote: >> >> Hi Andrea. >> >> could you make an entry into the bug tracker? >> >> That helps maintenance a lot, for example as usually tests will be >> written after fixing it, which should address the bug number. >> > Done: > https://bugs.launchpad.net/python-mode/+bug/818437 > Thanks > fix commited. could you check out the trunk again? Thanks, Andreas From andreas.roehler at online.de Fri Aug 5 10:59:59 2011 From: andreas.roehler at online.de (=?ISO-8859-15?Q?Andreas_R=F6hler?=) Date: Fri, 05 Aug 2011 10:59:59 +0200 Subject: [Python-mode] python-mode.el-6.0.1 released Message-ID: <4E3BB10F.40102@online.de> Hi, gladly announce release of python-mode.el-6.0.1 New group of commands `py-expression' addresses parts of a statement, for example which would be concatenated by "."-operator. See py-copy-expression py-mark-expression py-beginning-of-expression py-end-of-expression py-kill-expression Comment: Whilst operators are Python expressions syntactically, editing command `py-expression' ignores them, as it's dealt with easier by common `symbol'-commands already. Also several bugfixes are done. Enjoy, Andreas -- https://launchpad.net/python-mode https://launchpad.net/s-x-emacs-werkstatt/ From esj at harvee.org Sat Aug 6 02:22:40 2011 From: esj at harvee.org (Eric S. Johansson) Date: Fri, 05 Aug 2011 20:22:40 -0400 Subject: [Python-mode] 6.0.1 errors Message-ID: <4E3C8950.50108@harvee.org> running 6.0.1 on xemacs 21.4.22 (cygwin) I get these two warnings (1) (warning/warning) Unknown req `min-colors' with options `(88)' (2) (warning/warning) Unknown req `min-colors' with options `(88)' ideas? From andreas.roehler at online.de Sat Aug 6 08:12:25 2011 From: andreas.roehler at online.de (=?ISO-8859-1?Q?Andreas_R=F6hler?=) Date: Sat, 06 Aug 2011 08:12:25 +0200 Subject: [Python-mode] 6.0.1 errors In-Reply-To: <4E3C8950.50108@harvee.org> References: <4E3C8950.50108@harvee.org> Message-ID: <4E3CDB49.8020409@online.de> Am 06.08.2011 02:22, schrieb Eric S. Johansson: > running 6.0.1 on xemacs 21.4.22 (cygwin) > > I get these two warnings > > (1) (warning/warning) Unknown req `min-colors' with options `(88)' > > (2) (warning/warning) Unknown req `min-colors' with options `(88)' > > ideas? > > Hi Eric, AFAIS your version of XEmacs has difficulties with highlight-indentation mode. Looks like errors come from `defface' there. That mode is not crucial. Ask at XEmacs-devel if they may make it work. For the moment you may savely comment out (require 'highlight-indentation) to get rid of the warning. BTW I'll make a bug report for this, thanks, Andreas From esj at harvee.org Sat Aug 6 09:19:04 2011 From: esj at harvee.org (Eric S. Johansson) Date: Sat, 06 Aug 2011 03:19:04 -0400 Subject: [Python-mode] 6.0.1 errors In-Reply-To: <4E3CDB49.8020409@online.de> References: <4E3C8950.50108@harvee.org> <4E3CDB49.8020409@online.de> Message-ID: <4E3CEAE8.4030202@harvee.org> On 8/6/2011 2:12 AM, Andreas R?hler wrote: > Am 06.08.2011 02:22, schrieb Eric S. Johansson: >> running 6.0.1 on xemacs 21.4.22 (cygwin) >> >> I get these two warnings >> >> (1) (warning/warning) Unknown req `min-colors' with options `(88)' >> >> (2) (warning/warning) Unknown req `min-colors' with options `(88)' >> >> ideas? >> >> > > Hi Eric, > > AFAIS your version of XEmacs has difficulties with highlight-indentation mode. > Looks like errors come from `defface' there. sounds like I better just upgrade to the latest and greatest From esj at harvee.org Tue Aug 9 02:43:53 2011 From: esj at harvee.org (Eric S. Johansson) Date: Mon, 08 Aug 2011 20:43:53 -0400 Subject: [Python-mode] xemacs Potential problem Message-ID: <4E4082C9.8040108@harvee.org> I'm experimenting with the latest beta and try to figure out what's the right set of options for configure for production version and I got this error. Any ideas? (1) (file-mode-spec/warning) Error in File mode specification: Malformed list: :background Backtrace follows: backtrace(nil t) # bind (standard-output standard-output handler-arg-name) backtrace-in-condition-handler-eliminating-handler(call-trapping-errors-Ldc9FC5Hr) # bind (errstr call-trapping-errors-Ldc9FC5Hr) #((malformed-list :background)) apply(face-custom-attributes-set highlight-indent-face nil (custom) :background) # bind (display atts tags frame spec face) face-display-set(highlight-indent-face ((((class color) (min-colors 88) (background dark)) :background "grey22") (((class color) (min-colors 88) (background light)) :background "grey88")) nil (custom)) # bind (value frames frame args doc spec face) custom-declare-face(highlight-indent-face ((((class color) (min-colors 88) (background dark)) :background "grey22") (((class color) (min-colors 88) (background light)) :background "grey88")) "Basic face for highlighting indentation guides." :group basic-faces) (defface highlight-indent-face (quote ((((class color) (min-colors 88) (background dark)) :background "grey22") (((class color) (min-colors 88) (background light)) :background "grey88"))) "Basic face for highlighting indentation guides." :group (quote basic-faces)) # (unwind-protect ...) # (unwind-protect ...) # (unwind-protect ...) # (unwind-protect ...) # (unwind-protect ...) # (unwind-protect ...) # (unwind-protect ...) # (unwind-protect ...) (load-internal "[internal]") load-internal("highlight-indentation" nil require nil undecided) # bind (handler path nosuffix nomessage noerror filename) load("highlight-indentation" nil require nil) # (unwind-protect ...) require(highlight-indentation) # (unwind-protect ...) # (unwind-protect ...) # (unwind-protect ...) # (unwind-protect ...) # (unwind-protect ...) # (unwind-protect ...) # (unwind-protect ...) # (unwind-protect ...) (load-internal "[internal]") load-internal("python-mode" nil nil nil undecided) # bind (handler path nosuffix nomessage noerror filename) load("python-mode" nil nil nil) # (unwind-protect ...) python-mode() # bind (alist mode name keep-going) # (unwind-protect ...) # bind (just-from-file-name) set-auto-mode() #() # (unwind-protect ...) call-with-condition-handler(# #) # (condition-case ... . ((error))) # bind (find-file) normal-mode(t) # bind (nomodes after-find-file-from-revert-buffer noauto warn error) after-find-file(nil t) # (unwind-protect ...) # bind (inhibit-read-only error number truename rawfile nowarn filename buf) find-file-noselect-1(# "/home/esj/food/food_calc.py" nil nil "c:/cygwin/home/esj/food/food_calc.py" (361450 -22488999)) byte-code("..." [number truename rawfile nowarn filename buf set-buffer-major-mode find-file-noselect-1] 7) # (condition-case ... . ((t (byte-code "?!?? @ A\"?" [buf data kill-buffer signal] 3)))) # bind (number truename buf wildcards rawfile nowarn filename) find-file-noselect("~/food/food_calc.py" nil nil t) # bind (coding-system-for-read wildcards codesys filename) # mapcar] 5 1247230 (list (read-file-name "Find file: ") (and current-prefix-arg (read-coding-system "Coding system: ")) t) 0x67c>("~/food/food_calc.py" nil t) call-interactively(find-file) (dispatch-event "[internal]") # (condition-case ... . error) # (catch top-level ...) From andreas.roehler at online.de Tue Aug 9 07:35:07 2011 From: andreas.roehler at online.de (=?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?=) Date: Tue, 09 Aug 2011 07:35:07 +0200 Subject: [Python-mode] xemacs Potential problem In-Reply-To: <4E4082C9.8040108@harvee.org> References: <4E4082C9.8040108@harvee.org> Message-ID: <4E40C70B.2010805@online.de> Am 09.08.2011 02:43, schrieb Eric S. Johansson: > I'm experimenting with the latest beta and try to figure out what's the > right set of options for configure for production version and I got this > error. Any ideas? > Hi Eric, think that's related to XEmacs compatibility problem you reported already with https://bugs.launchpad.net/python-mode/+bug/821824 Please ask at XEmacs devel what to do. For the moment put a semicolon before (require 'highlight-indentation) in python-mode.el, that's all. highlight-indentation is an add-on mode, displaying what (current-indention) also is saying. You are not missing any crucial without that display. Nonetheless I'll make it not loaded for XEmacs, so you will not get that error anymore with upcoming version. HTH, Andreas From andreas.roehler at online.de Tue Aug 9 07:59:56 2011 From: andreas.roehler at online.de (=?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?=) Date: Tue, 09 Aug 2011 07:59:56 +0200 Subject: [Python-mode] script with indentation problems - Bug 818669 In-Reply-To: <4E403D1B.3000406@g.nevcal.com> References: <4E403D1B.3000406@g.nevcal.com> Message-ID: <4E40CCDC.7070901@online.de> Hi, > > 3) Line 1266 (authlist = None). Point in column 1. Hit TAB. > ... Hit TAB again, and it gets indented 8 spaces > instead 4. at my machine it stays at current-indentation with TAB, which is a new behavior For me that cycling was bad, as if you hit it once too much, you have to cycle again the whole distance. Now TAB should get the outmost reasonable indent, while dedent is a task of backspace. If you want the old behavior back, please make an entry in the tracker. We may discuss this with the other folks, CC to python-mode list, as we may collect some opinions already, cheers, Andreas From v+python at g.nevcal.com Tue Aug 9 10:18:15 2011 From: v+python at g.nevcal.com (Glenn Linderman) Date: Tue, 09 Aug 2011 01:18:15 -0700 Subject: [Python-mode] script with indentation problems - Bug 818669 In-Reply-To: <4E40CCDC.7070901@online.de> References: <4E403D1B.3000406@g.nevcal.com> <4E40CCDC.7070901@online.de> Message-ID: <4E40ED47.4030409@g.nevcal.com> On 8/8/2011 10:59 PM, Andreas R?hler wrote: > Hi, > > >> >> 3) Line 1266 (authlist = None). Point in column 1. Hit TAB. > >> ... Hit TAB again, and it gets indented 8 spaces >> instead 4. > > at my machine it stays at current-indentation with TAB, which is > a new behavior Are you saying you are testing with a newer version than this morning's? I still see this behavior.... except that it sometimes happens with the second TAB, and sometimes with the third. What I don't understand is why TAB would ever move text more than one indent at a time (8 character positions instead of 4). -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.roehler at online.de Wed Aug 10 10:11:17 2011 From: andreas.roehler at online.de (=?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?=) Date: Wed, 10 Aug 2011 10:11:17 +0200 Subject: [Python-mode] script with indentation problems - Bug 818669 In-Reply-To: <4E40ED47.4030409@g.nevcal.com> References: <4E403D1B.3000406@g.nevcal.com> <4E40CCDC.7070901@online.de> <4E40ED47.4030409@g.nevcal.com> Message-ID: <4E423D25.6040300@online.de> Am 09.08.2011 10:18, schrieb Glenn Linderman: > On 8/8/2011 10:59 PM, Andreas R?hler wrote: >> Hi, >> >> >>> >>> 3) Line 1266 (authlist = None). Point in column 1. Hit TAB. >> >>> ... Hit TAB again, and it gets indented 8 spaces >>> instead 4. >> >> at my machine it stays at current-indentation with TAB, which is >> a new behavior > > Are you saying you are testing with a newer version than this morning's? > I still see this behavior.... except that it sometimes happens with the > second TAB, and sometimes with the third. > > What I don't understand is why TAB would ever move text more than one > indent at a time (8 character positions instead of 4). > Hi Glenn, restored the good old cycling behavior. New design remains available as py-indent-line-new. Please make a bug entry should something still don't work as expected. Also known indent bugs should be gone now. Thanks again for the reports, Andreas From v+python at g.nevcal.com Wed Aug 10 10:52:26 2011 From: v+python at g.nevcal.com (Glenn Linderman) Date: Wed, 10 Aug 2011 01:52:26 -0700 Subject: [Python-mode] script with indentation problems - Bug 818669 In-Reply-To: <4E423D25.6040300@online.de> References: <4E403D1B.3000406@g.nevcal.com> <4E40CCDC.7070901@online.de> <4E40ED47.4030409@g.nevcal.com> <4E423D25.6040300@online.de> Message-ID: <4E4246CA.4030302@g.nevcal.com> On 8/10/2011 1:11 AM, Andreas R?hler wrote: > restored the good old cycling behavior. > New design remains available as py-indent-line-new. I'm not sure what "cycling behavior" means? Is that documented somewhere? What I would expect, is that if point arrives at a line, and the text starts somewhere other than the appropriate default position on the line, and point is before the text starts, that the first TAB would move the text to the appropriate default position on the line. Subsequent TAB should move the text one indent to the right. What I was seeing was that the second TAB would move text two indents to the right. Or sometimes the second TAB would do nothing, and then the third TAB would move text two indents to the right. Is there ever a situation where a TAB should move text more than one indent to the right? I'll grab your latest branch after some sleep and test again... thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.roehler at online.de Wed Aug 10 18:09:47 2011 From: andreas.roehler at online.de (=?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?=) Date: Wed, 10 Aug 2011 18:09:47 +0200 Subject: [Python-mode] script with indentation problems - Bug 818669 In-Reply-To: <4E4246CA.4030302@g.nevcal.com> References: <4E403D1B.3000406@g.nevcal.com> <4E40CCDC.7070901@online.de> <4E40ED47.4030409@g.nevcal.com> <4E423D25.6040300@online.de> <4E4246CA.4030302@g.nevcal.com> Message-ID: <4E42AD4B.3060602@online.de> Am 10.08.2011 10:52, schrieb Glenn Linderman: > On 8/10/2011 1:11 AM, Andreas R?hler wrote: >> restored the good old cycling behavior. >> New design remains available as py-indent-line-new. > > I'm not sure what "cycling behavior" means? Is that documented somewhere? > Now, and presumely earlier also, it's the following: when called at the outermost permitted indent it jumps back to column 0. From there it steps every py-indent-offset until outermost is reached again. py-indent-line-new in contrast always jumps to the outermost. Backspace is needed then jumping py-indent-offset steps back every hit. What about restricting RET to newline and _not_ indent BTW? In contrast to C-j - newline and indent. Andreas From barry at python.org Thu Aug 11 01:23:12 2011 From: barry at python.org (Barry Warsaw) Date: Wed, 10 Aug 2011 19:23:12 -0400 Subject: [Python-mode] script with indentation problems - Bug 818669 In-Reply-To: <4E42AD4B.3060602@online.de> References: <4E403D1B.3000406@g.nevcal.com> <4E40CCDC.7070901@online.de> <4E40ED47.4030409@g.nevcal.com> <4E423D25.6040300@online.de> <4E4246CA.4030302@g.nevcal.com> <4E42AD4B.3060602@online.de> Message-ID: <20110810192312.20a0cdde@resist.wooz.org> On Aug 10, 2011, at 06:09 PM, Andreas R?hler wrote: >What about restricting RET to newline and _not_ indent BTW? Please no! You will physically hurt all of us dinosaurs. :) -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: From andreas.roehler at online.de Mon Aug 15 08:49:14 2011 From: andreas.roehler at online.de (=?ISO-8859-15?Q?Andreas_R=F6hler?=) Date: Mon, 15 Aug 2011 08:49:14 +0200 Subject: [Python-mode] Welcome Gennady N. Uraltsev Message-ID: <4E48C16A.1030005@online.de> Dear Gennady, being very pleased you joined the team. As your hints already turned out helpful chasing bugs, I'm looking forward. Think that place at the crossing of Emacs and Python is right to get some suspense, to perform some nice things. A remark concerning future developing at the occasion: basically let's focus on fixing remaining bugs. Afterwards let's have and deliver an integration of assisting packages as Pymacs, Pydb, Rope etc. There is some stuff of my own speeding up editing which I want to integrate too. Will make a Blueprint for more detailed discussion of that. Welcome again, Andreas From danimal at agriroots.com Tue Aug 16 00:09:40 2011 From: danimal at agriroots.com (Daniel Flesner) Date: Mon, 15 Aug 2011 18:09:40 -0400 Subject: [Python-mode] void variable py-buffer? Message-ID: when i'm editing a python .py file in a buffer and pull down the Edit/Paste menu i get the following error: Debugger entered--Lisp error: (void-variable py-buffer) (buffer-live-p py-buffer) i'm running GNU Emacs 23.2.1, is this a bug or a configuration error on my part somewhere? thanks, daniel From cavesnow at gmail.com Tue Aug 16 23:07:03 2011 From: cavesnow at gmail.com (Cavesnow) Date: Tue, 16 Aug 2011 23:07:03 +0200 Subject: [Python-mode] python-mode modifies load-path emacs-wide. Message-ID: <4E4ADBF7.6020606@gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello Everyone, I am talking about the bug https://bugs.launchpad.net/python-mode/+bug/827341 I will try to explain my idea a bit better. Removing part with the direct modification of load-path I think is clear: a library shouldn't interfer with global settings. If I understand correctly pycomplete would probably be loaded from inside python-mode and it is not meant to be a stand-alone library. Correct me if I am wrong. Anyway, since I have not found any place in the python-mode.el file where pycomplete.el nor did I find any auto-load instructions I thought of this solution. Let's say that at a certain point python-mode wanted to use functions provided in pycomplete and thus had to load it as a library. My idea was that in that case the loading was to be made this way: (let ((load-path (add-to-list 'load-path (concat py-library-path "completion")))) (load-library "pycomplete") ) I have tested such a solution and theoretically it seams it works. The idea was to avoid changing the load-path but!! having a library-wide variable that contained the package path. Please correct me if I am wrong about this. In any case, it is absolutely not a problem for me if my proposal is not accepted. Actually I would like to excuse myself if some of my submissions lack in professionality and that it may take some of your time to look at them, but I hope that some of my contributions will be of use. In any case I found the load-path problem because I noticed specifically that the package modified my path settings while I was beginning to set up my python development environment. The other bugs I have found occurred in a similar occasion. I was beginning to write a python program and found out that some things didn't work. Let's get back to the load-path bug: Do you have any idea how to eliminate this? Or do you think it is a minor problem? Can you tell me, if you think so, why is my approach inapplicable or maybe there is some better solution? And finally, can you please clarify at the current state how should pycomplete.el work? How is it integrated with python-mode. I have seen some strange behavior: for example the last item in the menu calls the function: py-find-imports that is nowhere defined. From the documentation it seams that it has some relation to completion. In pycomplete.el there is no such function but there is a very similar one: py-find-global-imports. This may be a mistake? In any case pycomplete is not loaded anywhere.. Maybe it would make sense to do a check if pycomplete is loaded/loadable or not and modify the menu accordingly? In any case I will soon (tomorrow, maybe) file a bug report about py-find-imports. Gennady. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJOStv2AAoJEGWa0uAesZr4ZkcQAId4zYAaTBY+506bN3XjtYm/ ux50HNU5EFgIxAK3Dz5jzqZ0h4rwYjxKI19xMrek3bHt+MsfYVLpfKRyinUA18U4 y9wMuFqGvAr3tvUaOG6Z281mC5lNSzs4KOQrAVw7lhgGwMIlEnWm+9QzgD+i8OJA N44rvogIYolx63Db99S9Q+FPGCohdGmwDeEuHBJsdfGmwFvwSGg4CZRz5SdZW+mB P5NfERQNPdEQEqM+sCIM11EsL/xcTsKkSXkvO5O1FUVaJ4JDfjC9Ie5J1ttun3N+ 6y3MiZSXB6W1z0lektEcay7uyFWrqjvdcII0MAzU83BBX+7sI6+5nlBFyNWWH+Q+ M+WObB+8JoxftWs84ns41uvz2UHkseKJ+GY+tvKk+Zd2C8ET1OVMj7s8uaftBjoP 4BZVA80XlRg3PrvXwzRDTMhxsGfhvkRMIebgFedgunCtTUQYLFsulsL0uUSYbf81 COoA5xGttd847XAZVABgey6/NrL48x/U8PFzZQPcG7Mgx7u2O9B/cAPgvvVN8kaF gXqVnZQ30Omd5o0jVih/GkczbXg1Ot60jGH0zKvxFaeCUPIof1yFwwsXVLHelkWI QyEsV6LV62yiTlJJE4KmP1Sw5LS1gxVnVuUURx0H6iLcO6HVESaCcszkiA2Y+Ha7 J6ehF4poHKmJ4Dhn2gOm =At1C -----END PGP SIGNATURE----- From barry at python.org Tue Aug 16 23:58:36 2011 From: barry at python.org (Barry Warsaw) Date: Tue, 16 Aug 2011 17:58:36 -0400 Subject: [Python-mode] python-mode modifies load-path emacs-wide. In-Reply-To: <4E4ADBF7.6020606@gmail.com> References: <4E4ADBF7.6020606@gmail.com> Message-ID: <20110816175836.3e21ead8@resist.wooz.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On Aug 16, 2011, at 11:07 PM, Cavesnow wrote: >I will try to explain my idea a bit better. Removing part with the >direct modification of load-path I think is clear: a library shouldn't >interfer with global settings. Agreed. >If I understand correctly pycomplete would probably be loaded from inside >python-mode and it is not meant to be a stand-alone library. Correct me if I >am wrong. Andreas can answer that, but I can say that python-mode.el should be loadable standalone. It can use optional additional tools, but loading python-mode.el should not break if it can't find them, and basic editing, syntax highlighting, etc. should just continue to work. >Anyway, since I have not found any place in the python-mode.el file >where pycomplete.el nor did I find any auto-load instructions I thought of >this solution. Let's say that at a certain point python-mode wanted to use >functions provided in pycomplete and thus had to load it as a library. My >idea was that in that case the loading was to be made this way: > >(let ((load-path (add-to-list 'load-path (concat py-library-path >"completion")))) > (load-library "pycomplete") > ) Rather, I think the right way to do this is to leave load-path hackery up to the user, but python-mode.el should have something like: (condition-case nil (require 'pycomplete) (error)) to just ignore it if it can't be found (or *maybe* echo a warning). Cheers, - -Barry -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBCAAGBQJOSugMAAoJEBJutWOnSwa/QUwP/0XYgRKYZB8GflhSAuSug41J 9GHHqePMjA0VyZK+VgRtqtEdyIJmCMKAST26BdgobJwBcjPtEQj9RRnbAkbToA2+ BAnndi8ToKgdMFBdLI6n7p854mP44/Y7EJQLKCFw08EqQmoWY8duPSnY6JLFVIXz NkPS9MbEst96ZNqSu7U7wTUGfm0fsa/9nd8P6R6Z0tYLlftz/vla2z1quDxG0fSI B+ZEKHE6zl8N9F8JptIyGBc293yBsqQ27nl1J0bhRh7CVkZq1/FltiLiqeSEd30w FfcKJavhrCQUQvuqIbzvJB/doZi6adi1f3wUiExtlvcnMXTBvSnH6dK8b2Pie/LR KvOoMMWR7t7Amo56W5xMDGON+FmmOK33mKiN6/pyl3hy/nFoWvp3qdQwI7u7xSt4 58XXxpS71yXBIKb2ZeLF4XOSNEP5EaL9g6vHbHXKx1VD5a2k3VvyowNXGa74CTIH 9pWC6zUV0ta5JD7721UOIwimxdQXBKOfh411X5Wdx/N+oiiAEVlFTT/TvORUrpt9 3Ml73gItH7h9qkRUu4Y5egPZinfq84CMEm0mc99TPf4kKJzl2X56vQignnhTBUTw XXDKlwO2aauhG2WbaK8P941w1k7LpQ54Xfku2Waivb3l+Kt+snqHTbHHLsHKfPh2 a6ZDtEGUrCANUFCvZjTD =XAWo -----END PGP SIGNATURE----- From cavesnow at gmail.com Wed Aug 17 11:46:41 2011 From: cavesnow at gmail.com (Cavesnow) Date: Wed, 17 Aug 2011 11:46:41 +0200 Subject: [Python-mode] python-mode modifies load-path emacs-wide. In-Reply-To: <20110816175836.3e21ead8@resist.wooz.org> References: <4E4ADBF7.6020606@gmail.com> <20110816175836.3e21ead8@resist.wooz.org> Message-ID: <4E4B8E01.4090904@gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > Andreas can answer that, but I can say that python-mode.el should be > loadable > standalone. It can use optional additional tools, but loading > python-mode.el > should not break if it can't find them, and basic editing, syntax > highlighting, etc. should just continue to work. This is certainly true. > Rather, I think the right way to do this is to leave load-path hackery > up to > the user, but python-mode.el should have something like: > > (condition-case nil > (require 'pycomplete) > (error)) > As you say this will not break the python-mode functionality if pycomplete should not be present. However I think there is a decision to make: if pycomplete is an additional part of python-mode then it is logical that the user should not have to worry too much about load-path hackery and a fallback should be provided. Something like: (or (require 'pycomplete nil t) (let ((load-path (add-to-list 'load-path (concat py-library-path "completion")))) (if (locate-library "pycomplete") (load-library "pycomplete") nil ) ) ) That returns nil if pycomplete is not available. On the other hand if pycomplete should be able to exist alone from python this is not necessary. However I cannot imagine why this should be the case: pycomplete requires python-mode and cannot exist separately... There is also a blueprint to deliver a ready to use pymacs. In the perspective of this tighter integration I think this fallback options should be provided. For example pycomplete has a line that says (pymacs-load "pycomplete") that tries to load the pycomplete.py python part of the code that normally sits in the same dir as pycomplete.el A user wanting to use this functionality has to copy the pycomplete.py to a location searched by pymacs-load-path (the variable pymacs uses for searching for its scripts) or modify the pymacs-load-path itself. This actually means that providing a working python environment requires a lot of hassle from the user. On the other hand if these checks were implemented we could be sure that 1) If the user specifies the needed paths, user preference would always be honored 2) However if the packages are not found in the user dirs then python-mode could search inside it's own dirs. What do you think of this? On 08/16/2011 11:58 PM, Barry Warsaw wrote: > On Aug 16, 2011, at 11:07 PM, Cavesnow wrote: > >> I will try to explain my idea a bit better. Removing part with the >> direct modification of load-path I think is clear: a library shouldn't >> interfer with global settings. > > Agreed. > >> If I understand correctly pycomplete would probably be loaded from inside >> python-mode and it is not meant to be a stand-alone library. Correct me if I >> am wrong. > > Andreas can answer that, but I can say that python-mode.el should be loadable > standalone. It can use optional additional tools, but loading python-mode.el > should not break if it can't find them, and basic editing, syntax > highlighting, etc. should just continue to work. > >> Anyway, since I have not found any place in the python-mode.el file >> where pycomplete.el nor did I find any auto-load instructions I thought of >> this solution. Let's say that at a certain point python-mode wanted to use >> functions provided in pycomplete and thus had to load it as a library. My >> idea was that in that case the loading was to be made this way: > >> (let ((load-path (add-to-list 'load-path (concat py-library-path >> "completion")))) >> (load-library "pycomplete") >> ) > > Rather, I think the right way to do this is to leave load-path hackery up to > the user, but python-mode.el should have something like: > > (condition-case nil > (require 'pycomplete) > (error)) > > to just ignore it if it can't be found (or *maybe* echo a warning). > > Cheers, > -Barry _______________________________________________ Python-mode mailing list Python-mode at python.org http://mail.python.org/mailman/listinfo/python-mode -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJOS436AAoJEGWa0uAesZr4cscP/0Q89cN3pIMUtQ05Igg0WGBE Vpiqjl0eIXiMv7z5b+aHn7Saffn8MHM5xLAC7CFt9OGLJQG9nLHtId67zLm7Pyxo pIbToBZlswkxh0MOir3mkdJ7H2uHc5h7vsZBzfAUguAtw+MRXDsbs9wDiHifr441 V5T78IDbkgibwz6NkaBC+jSqCKzLFuYmDbmmB/Pe8ovoWF4QPQ7aqYhVsPP05OJP ZCkUx9t2wGZ99b5kRAlG0z6VPQqV9uI7lHDtIRKoUz6LTo3AIRciD3HZEVofANgq fMC4nP8obXol0C9v+Jaropmk7E9MOcVR2AZwLGr6pvkS2UYurV6Qp0fO9vWNmop7 asKnplHnpUWjnRp+IVLGWGtlheZalB86TWZyBkWg3vO7dWfvL++jkVEbnueJ8lPk Vk2z+xzOzZLy3ITasZ65xPa/4meuHwcVHRuyngNkGxFNz3SvatWlx5XrB/EoLdxN RibzY+YrqE23j4x/l9HtVfWeppSHxzeHp2kEdPCZYqXKOIwmVq4iIkLszmVru6ID hfgLl8GznS8ReDgvIiIlPyG8va4zKNivpg+psz7WNUzmmDRM5uCg705OCLKCzfMP ciN9C53p42qd9H1NMiOa3XfI0NhQRDnrMxjiCI+/tRFwnNvGmJSyALUidl75E7XD K6ZYEf0+0Vlxlr2reffN =sptR -----END PGP SIGNATURE----- From andreas.roehler at online.de Wed Aug 17 12:24:53 2011 From: andreas.roehler at online.de (=?ISO-8859-1?Q?Andreas_R=F6hler?=) Date: Wed, 17 Aug 2011 12:24:53 +0200 Subject: [Python-mode] python-mode modifies load-path emacs-wide. In-Reply-To: <4E4B8E01.4090904@gmail.com> References: <4E4ADBF7.6020606@gmail.com> <20110816175836.3e21ead8@resist.wooz.org> <4E4B8E01.4090904@gmail.com> Message-ID: <4E4B96F5.5060004@online.de> [ ... ] > On the other hand if pycomplete should be able to exist alone from > python this is not necessary. However I cannot imagine why this should > be the case: pycomplete requires python-mode and cannot exist separately... > > There is also a blueprint to deliver a ready to use pymacs. In the > perspective of this tighter integration I think this fallback options > should be provided. For example pycomplete has a line that says > > (pymacs-load "pycomplete") > > that tries to load the pycomplete.py python part of the code that > normally sits in the same dir as pycomplete.el > > A user wanting to use this functionality has to copy the pycomplete.py > to a location searched by pymacs-load-path (the variable pymacs uses for > searching for its scripts) or modify the pymacs-load-path itself. This > actually means that providing a working python environment requires a > lot of hassle from the user. so you are close to the reasons why the path to directories has been set. BTW some times ago some more things have been broken. Decided to fix hierarchically: indent stuff first, then editing and execution issues. The later still needs some invest. auto-completion remains to be done still, as better pydb integration and some more interesting things. Andreas From barry at python.org Wed Aug 17 17:45:26 2011 From: barry at python.org (Barry Warsaw) Date: Wed, 17 Aug 2011 11:45:26 -0400 Subject: [Python-mode] python-mode modifies load-path emacs-wide. In-Reply-To: <4E4B8E01.4090904@gmail.com> References: <4E4ADBF7.6020606@gmail.com> <20110816175836.3e21ead8@resist.wooz.org> <4E4B8E01.4090904@gmail.com> Message-ID: <20110817114526.55480a37@resist.wooz.org> I wrote a follow up rebuttal in the bug. Cheers, -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: From esj at harvee.org Fri Aug 19 09:18:52 2011 From: esj at harvee.org (Eric S. Johansson) Date: Fri, 19 Aug 2011 03:18:52 -0400 Subject: [Python-mode] xemacs Potential problem In-Reply-To: <4E40C70B.2010805@online.de> References: <4E4082C9.8040108@harvee.org> <4E40C70B.2010805@online.de> Message-ID: <4E4E0E5C.9010202@harvee.org> On 8/9/2011 1:35 AM, Andreas R?hler wrote: > > For the moment put a semicolon before > > (require 'highlight-indentation) > > in python-mode.el, that's all. ;; (when (featurep 'xemacs) ;; (require 'highlight-indentation)) yields (1) (file-mode-spec/warning) Error in File mode specification: menu keyword must be :config, :included, :accelerator or :filter: :help Backtrace follows: backtrace(nil t) # bind (standard-output standard-output handler-arg-name) backtrace-in-condition-handler-eliminating-handler(call-trapping-errors-Ldc9FC5Hr) # bind (errstr call-trapping-errors-Ldc9FC5Hr) #((error "menu keyword must be :config, :included, :accelerator or :filter" :help)) signal(error ("menu keyword must be :config, :included, :accelerator or :filter" :help)) # bind (menuitem item menubar-p menu) check-menu-syntax(("Python" :help "Python-specific Features" ["Shift region left" py-shift-left :active mark-active :help "Shift by a single indentation step"] ["Shift region right" py-shift-right :active mark-active :help "Shift by a single indentation step"] "-" ["Mark block" py-mark-block :help "Mark innermost block at point"] ["Mark def/class" mark-defun :help "Mark innermost definition at point"] "-" ["Start of block" py-beginning-of-block :help "Go to start of innermost definition at point"] ["End of block" py-end-of-block :help "Go to end of innermost definition at point"] ["Start of def/class" beginning-of-defun :help "Go to start of innermost definition at point"] ["End of def/class" end-of-defun :help "Go to end of innermost definition at point"] "-" ("Templates..." :help "Expand templates for compound statements" :filter (lambda (&rest junk) (abbrev-table-menu python-mode-abbrev-table))) "-" ["Import/reload file" py-execute-import-or-reload :help "Load into inferior Python session"] ["Eval buffer" py-execute-buffer :help "Evaluate buffer en bloc in inferior Python session"] ["Eval region" py-execute-region :active mark-active :help "Evaluate region en bloc in inferior Python session"] ["Eval def/class" py-execute-defun :help "Evaluate current definition in inferior Python session"] ["Switch to interpreter" py-shell :help "Switch to `inferior' Python in separate buffer"] ["Set default process" py-set-proc :help "Make buffer's inferior process the default" :active (buffer-live-p py-buffer)] ["Check file" py-check :help "Run pychecker"] ["Debugger" pdb :help "Run pdb under GUD"] "-" ["Help on symbol" py-describe-symbol :help "Use pydoc on symbol at point"] ["Complete symbol" completion-at-point :help "Complete (qualified) symbol before point"] ["Find function" py-find-function :help "Try to find source definition of function at point"] ["Update imports" py-find-imports :help "Update list of top-level imports for completion"]) nil) # bind (in-menu before submenu menu-path) add-submenu(nil ("Python" :help "Python-specific Features" ["Shift region left" py-shift-left :active mark-active :help "Shift by a single indentation step"] ["Shift region right" py-shift-right :active mark-active :help "Shift by a single indentation step"] "-" ["Mark block" py-mark-block :help "Mark innermost block at point"] ["Mark def/class" mark-defun :help "Mark innermost definition at point"] "-" ["Start of block" py-beginning-of-block :help "Go to start of innermost definition at point"] ["End of block" py-end-of-block :help "Go to end of innermost definition at point"] ["Start of def/class" beginning-of-defun :help "Go to start of innermost definition at point"] ["End of def/class" end-of-defun :help "Go to end of innermost definition at point"] "-" ("Templates..." :help "Expand templates for compound statements" :filter (lambda (&rest junk) (abbrev-table-menu python-mode-abbrev-table))) "-" ["Import/reload file" py-execute-import-or-reload :help "Load into inferior Python session"] ["Eval buffer" py-execute-buffer :help "Evaluate buffer en bloc in inferior Python session"] ["Eval region" py-execute-region :active mark-active :help "Evaluate region en bloc in inferior Python session"] ["Eval def/class" py-execute-defun :help "Evaluate current definition in inferior Python session"] ["Switch to interpreter" py-shell :help "Switch to `inferior' Python in separate buffer"] ["Set default process" py-set-proc :help "Make buffer's inferior process the default" :active (buffer-live-p py-buffer)] ["Check file" py-check :help "Run pychecker"] ["Debugger" pdb :help "Run pdb under GUD"] "-" ["Help on symbol" py-describe-symbol :help "Use pydoc on symbol at point"] ["Complete symbol" completion-at-point :help "Complete (qualified) symbol before point"] ["Find function" py-find-function :help "Try to find source definition of function at point"] ["Update imports" py-find-imports :help "Update list of top-level imports for completion"]) nil) # bind (before menu-items menu-name menu-path) add-menu(nil "Python" (:help "Python-specific Features" ["Shift region left" py-shift-left :active mark-active :help "Shift by a single indentation step"] ["Shift region right" py-shift-right :active mark-active :help "Shift by a single indentation step"] "-" ["Mark block" py-mark-block :help "Mark innermost block at point"] ["Mark def/class" mark-defun :help "Mark innermost definition at point"] "-" ["Start of block" py-beginning-of-block :help "Go to start of innermost definition at point"] ["End of block" py-end-of-block :help "Go to end of innermost definition at point"] ["Start of def/class" beginning-of-defun :help "Go to start of innermost definition at point"] ["End of def/class" end-of-defun :help "Go to end of innermost definition at point"] "-" ("Templates..." :help "Expand templates for compound statements" :filter (lambda (&rest junk) (abbrev-table-menu python-mode-abbrev-table))) "-" ["Import/reload file" py-execute-import-or-reload :help "Load into inferior Python session"] ["Eval buffer" py-execute-buffer :help "Evaluate buffer en bloc in inferior Python session"] ["Eval region" py-execute-region :active mark-active :help "Evaluate region en bloc in inferior Python session"] ["Eval def/class" py-execute-defun :help "Evaluate current definition in inferior Python session"] ["Switch to interpreter" py-shell :help "Switch to `inferior' Python in separate buffer"] ["Set default process" py-set-proc :help "Make buffer's inferior process the default" :active (buffer-live-p py-buffer)] ["Check file" py-check :help "Run pychecker"] ["Debugger" pdb :help "Run pdb under GUD"] "-" ["Help on symbol" py-describe-symbol :help "Use pydoc on symbol at point"] ["Complete symbol" completion-at-point :help "Complete (qualified) symbol before point"] ["Find function" py-find-function :help "Try to find source definition of function at point"] ["Update imports" py-find-imports :help "Update list of top-level imports for completion"])) # bind (map menu) easy-menu-add(("Python" :help "Python-specific Features" ["Shift region left" py-shift-left :active mark-active :help "Shift by a single indentation step"] ["Shift region right" py-shift-right :active mark-active :help "Shift by a single indentation step"] "-" ["Mark block" py-mark-block :help "Mark innermost block at point"] ["Mark def/class" mark-defun :help "Mark innermost definition at point"] "-" ["Start of block" py-beginning-of-block :help "Go to start of innermost definition at point"] ["End of block" py-end-of-block :help "Go to end of innermost definition at point"] ["Start of def/class" beginning-of-defun :help "Go to start of innermost definition at point"] ["End of def/class" end-of-defun :help "Go to end of innermost definition at point"] "-" ("Templates..." :help "Expand templates for compound statements" :filter (lambda (&rest junk) (abbrev-table-menu python-mode-abbrev-table))) "-" ["Import/reload file" py-execute-import-or-reload :help "Load into inferior Python session"] ["Eval buffer" py-execute-buffer :help "Evaluate buffer en bloc in inferior Python session"] ["Eval region" py-execute-region :active mark-active :help "Evaluate region en bloc in inferior Python session"] ["Eval def/class" py-execute-defun :help "Evaluate current definition in inferior Python session"] ["Switch to interpreter" py-shell :help "Switch to `inferior' Python in separate buffer"] ["Set default process" py-set-proc :help "Make buffer's inferior process the default" :active (buffer-live-p py-buffer)] ["Check file" py-check :help "Run pychecker"] ["Debugger" pdb :help "Run pdb under GUD"] "-" ["Help on symbol" py-describe-symbol :help "Use pydoc on symbol at point"] ["Complete symbol" completion-at-point :help "Complete (qualified) symbol before point"] ["Find function" py-find-function :help "Try to find source definition of function at point"] ["Update imports" py-find-imports :help "Update list of top-level imports for completion"])) (if py-menu (easy-menu-add py-menu)) python-mode() # bind (alist mode name keep-going) # (unwind-protect ...) # bind (just-from-file-name) set-auto-mode() #() # (unwind-protect ...) call-with-condition-handler(# #) # (condition-case ... . ((error))) # bind (find-file) normal-mode(t) # bind (nomodes after-find-file-from-revert-buffer noauto warn error) after-find-file(nil t) # (unwind-protect ...) # bind (inhibit-read-only error number truename rawfile nowarn filename buf) find-file-noselect-1(# "/home/esj/food/food_calc.py" nil nil "c:/cygwin/home/esj/food/food_calc.py" (361450 -22488999)) byte-code("..." [number truename rawfile nowarn filename buf set-buffer-major-mode find-file-noselect-1] 7) # (condition-case ... . ((t (byte-code "?!?? @ A\"?" [buf data kill-buffer signal] 3)))) # bind (number truename buf wildcards rawfile nowarn filename) find-file-noselect("/home/esj/food/food_calc.py" nil nil nil) # bind (coding-system-for-read wildcards codesys filename) find-file("/home/esj/food/food_calc.py") # bind (dir file-count line end-of-options file-p arg tem) command-line-1() # bind (command-line-args-left) command-line() # (condition-case ... . ((t (byte-code " ??" [error-data data nil] 1)))) # bind (error-data) normal-top-level() # (condition-case ... . error) # (catch top-level ...) From andreas.roehler at online.de Fri Aug 19 14:12:47 2011 From: andreas.roehler at online.de (=?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?=) Date: Fri, 19 Aug 2011 14:12:47 +0200 Subject: [Python-mode] xemacs Potential problem In-Reply-To: <4E4E0E5C.9010202@harvee.org> References: <4E4082C9.8040108@harvee.org> <4E40C70B.2010805@online.de> <4E4E0E5C.9010202@harvee.org> Message-ID: <4E4E533F.5040804@online.de> Am 19.08.2011 09:18, schrieb Eric S. Johansson: > On 8/9/2011 1:35 AM, Andreas R?hler wrote: >> >> For the moment put a semicolon before >> >> (require 'highlight-indentation) >> >> in python-mode.el, that's all. > > ;; (when (featurep 'xemacs) > ;; (require 'highlight-indentation)) > > yields > > (1) (file-mode-spec/warning) Error in File mode specification: menu > keyword must be :config, :included, :accelerator or :filter: :help > > Backtrace follows: > > backtrace(nil t) > # bind (standard-output standard-output handler-arg-name) > backtrace-in-condition-handler-eliminating-handler(call-trapping-errors-Ldc9FC5Hr) > > # bind (errstr call-trapping-errors-Ldc9FC5Hr) > # (call-trapping-errors-Ldc9FC5Hr) "...(17)" > [call-trapping-errors-Ldc9FC5Hr errstr error-message-string lwarn > file-mode-spec warning "Error in %s: %s\n\nBacktrace follows:\n\n%s" > "File mode specification" > backtrace-in-condition-handler-eliminating-handler] 8 0x694>((error > "menu keyword must be :config, :included, :accelerator or :filter" :help)) > signal(error ("menu keyword must be :config, :included, :accelerator or > :filter" :help)) > # bind (menuitem item menubar-p menu) > check-menu-syntax(("Python" :help "Python-specific Features" ["Shift > region left" py-shift-left :active mark-active :help "Shift by a single > indentation step"] ["Shift region right" py-shift-right :active > mark-active :help "Shift by a single indentation step"] "-" ["Mark > block" py-mark-block :help "Mark innermost block at point"] ["Mark > def/class" mark-defun :help "Mark innermost definition at point"] "-" > ["Start of block" py-beginning-of-block :help "Go to start of innermost > definition at point"] ["End of block" py-end-of-block :help "Go to end > of innermost definition at point"] ["Start of def/class" > beginning-of-defun :help "Go to start of innermost definition at point"] > ["End of def/class" end-of-defun :help "Go to end of innermost > definition at point"] "-" ("Templates..." :help "Expand templates for > compound statements" :filter (lambda (&rest junk) (abbrev-table-menu > python-mode-abbrev-table))) "-" ["Import/reload file" > py-execute-import-or-reload :help "Load into inferior Python session"] > ["Eval buffer" py-execute-buffer :help "Evaluate buffer en bloc in > inferior Python session"] ["Eval region" py-execute-region :active > mark-active :help "Evaluate region en bloc in inferior Python session"] > ["Eval def/class" py-execute-defun :help "Evaluate current definition in > inferior Python session"] ["Switch to interpreter" py-shell :help > "Switch to `inferior' Python in separate buffer"] ["Set default process" > py-set-proc :help "Make buffer's inferior process the default" :active > (buffer-live-p py-buffer)] ["Check file" py-check :help "Run pychecker"] > ["Debugger" pdb :help "Run pdb under GUD"] "-" ["Help on symbol" > py-describe-symbol :help "Use pydoc on symbol at point"] ["Complete > symbol" completion-at-point :help "Complete (qualified) symbol before > point"] ["Find function" py-find-function :help "Try to find source > definition of function at point"] ["Update imports" py-find-imports > :help "Update list of top-level imports for completion"]) nil) > # bind (in-menu before submenu menu-path) > add-submenu(nil ("Python" :help "Python-specific Features" ["Shift > region left" py-shift-left :active mark-active :help "Shift by a single > indentation step"] ["Shift region right" py-shift-right :active > mark-active :help "Shift by a single indentation step"] "-" ["Mark > block" py-mark-block :help "Mark innermost block at point"] ["Mark > def/class" mark-defun :help "Mark innermost definition at point"] "-" > ["Start of block" py-beginning-of-block :help "Go to start of innermost > definition at point"] ["End of block" py-end-of-block :help "Go to end > of innermost definition at point"] ["Start of def/class" > beginning-of-defun :help "Go to start of innermost definition at point"] > ["End of def/class" end-of-defun :help "Go to end of innermost > definition at point"] "-" ("Templates..." :help "Expand templates for > compound statements" :filter (lambda (&rest junk) (abbrev-table-menu > python-mode-abbrev-table))) "-" ["Import/reload file" > py-execute-import-or-reload :help "Load into inferior Python session"] > ["Eval buffer" py-execute-buffer :help "Evaluate buffer en bloc in > inferior Python session"] ["Eval region" py-execute-region :active > mark-active :help "Evaluate region en bloc in inferior Python session"] > ["Eval def/class" py-execute-defun :help "Evaluate current definition in > inferior Python session"] ["Switch to interpreter" py-shell :help > "Switch to `inferior' Python in separate buffer"] ["Set default process" > py-set-proc :help "Make buffer's inferior process the default" :active > (buffer-live-p py-buffer)] ["Check file" py-check :help "Run pychecker"] > ["Debugger" pdb :help "Run pdb under GUD"] "-" ["Help on symbol" > py-describe-symbol :help "Use pydoc on symbol at point"] ["Complete > symbol" completion-at-point :help "Complete (qualified) symbol before > point"] ["Find function" py-find-function :help "Try to find source > definition of function at point"] ["Update imports" py-find-imports > :help "Update list of top-level imports for completion"]) nil) > # bind (before menu-items menu-name menu-path) > add-menu(nil "Python" (:help "Python-specific Features" ["Shift region > left" py-shift-left :active mark-active :help "Shift by a single > indentation step"] ["Shift region right" py-shift-right :active > mark-active :help "Shift by a single indentation step"] "-" ["Mark > block" py-mark-block :help "Mark innermost block at point"] ["Mark > def/class" mark-defun :help "Mark innermost definition at point"] "-" > ["Start of block" py-beginning-of-block :help "Go to start of innermost > definition at point"] ["End of block" py-end-of-block :help "Go to end > of innermost definition at point"] ["Start of def/class" > beginning-of-defun :help "Go to start of innermost definition at point"] > ["End of def/class" end-of-defun :help "Go to end of innermost > definition at point"] "-" ("Templates..." :help "Expand templates for > compound statements" :filter (lambda (&rest junk) (abbrev-table-menu > python-mode-abbrev-table))) "-" ["Import/reload file" > py-execute-import-or-reload :help "Load into inferior Python session"] > ["Eval buffer" py-execute-buffer :help "Evaluate buffer en bloc in > inferior Python session"] ["Eval region" py-execute-region :active > mark-active :help "Evaluate region en bloc in inferior Python session"] > ["Eval def/class" py-execute-defun :help "Evaluate current definition in > inferior Python session"] ["Switch to interpreter" py-shell :help > "Switch to `inferior' Python in separate buffer"] ["Set default process" > py-set-proc :help "Make buffer's inferior process the default" :active > (buffer-live-p py-buffer)] ["Check file" py-check :help "Run pychecker"] > ["Debugger" pdb :help "Run pdb under GUD"] "-" ["Help on symbol" > py-describe-symbol :help "Use pydoc on symbol at point"] ["Complete > symbol" completion-at-point :help "Complete (qualified) symbol before > point"] ["Find function" py-find-function :help "Try to find source > definition of function at point"] ["Update imports" py-find-imports > :help "Update list of top-level imports for completion"])) > # bind (map menu) > easy-menu-add(("Python" :help "Python-specific Features" ["Shift region > left" py-shift-left :active mark-active :help "Shift by a single > indentation step"] ["Shift region right" py-shift-right :active > mark-active :help "Shift by a single indentation step"] "-" ["Mark > block" py-mark-block :help "Mark innermost block at point"] ["Mark > def/class" mark-defun :help "Mark innermost definition at point"] "-" > ["Start of block" py-beginning-of-block :help "Go to start of innermost > definition at point"] ["End of block" py-end-of-block :help "Go to end > of innermost definition at point"] ["Start of def/class" > beginning-of-defun :help "Go to start of innermost definition at point"] > ["End of def/class" end-of-defun :help "Go to end of innermost > definition at point"] "-" ("Templates..." :help "Expand templates for > compound statements" :filter (lambda (&rest junk) (abbrev-table-menu > python-mode-abbrev-table))) "-" ["Import/reload file" > py-execute-import-or-reload :help "Load into inferior Python session"] > ["Eval buffer" py-execute-buffer :help "Evaluate buffer en bloc in > inferior Python session"] ["Eval region" py-execute-region :active > mark-active :help "Evaluate region en bloc in inferior Python session"] > ["Eval def/class" py-execute-defun :help "Evaluate current definition in > inferior Python session"] ["Switch to interpreter" py-shell :help > "Switch to `inferior' Python in separate buffer"] ["Set default process" > py-set-proc :help "Make buffer's inferior process the default" :active > (buffer-live-p py-buffer)] ["Check file" py-check :help "Run pychecker"] > ["Debugger" pdb :help "Run pdb under GUD"] "-" ["Help on symbol" > py-describe-symbol :help "Use pydoc on symbol at point"] ["Complete > symbol" completion-at-point :help "Complete (qualified) symbol before > point"] ["Find function" py-find-function :help "Try to find source > definition of function at point"] ["Update imports" py-find-imports > :help "Update list of top-level imports for completion"])) > (if py-menu (easy-menu-add py-menu)) > python-mode() > # bind (alist mode name keep-going) > # (unwind-protect ...) > # bind (just-from-file-name) > set-auto-mode() > # "...(5)" [set-auto-mode t] 1 0x695>() > # (unwind-protect ...) > call-with-condition-handler(# "/home/esj/xemacs-beta/lisp/files.elc") (call-trapping-errors-Ldc9FC5Hr) > "...(17)" [call-trapping-errors-Ldc9FC5Hr errstr error-message-string > lwarn file-mode-spec warning "Error in %s: %s\n\nBacktrace > follows:\n\n%s" "File mode specification" > backtrace-in-condition-handler-eliminating-handler] 8 0x694> > # "...(5)" [set-auto-mode t] 1 0x695>) > # (condition-case ... . ((error))) > # bind (find-file) > normal-mode(t) > # bind (nomodes after-find-file-from-revert-buffer noauto warn error) > after-find-file(nil t) > # (unwind-protect ...) > # bind (inhibit-read-only error number truename rawfile nowarn filename > buf) > find-file-noselect-1(# > "/home/esj/food/food_calc.py" nil nil > "c:/cygwin/home/esj/food/food_calc.py" (361450 -22488999)) > byte-code("..." [number truename rawfile nowarn filename buf > set-buffer-major-mode find-file-noselect-1] 7) > # (condition-case ... . ((t (byte-code "?!?? @ A\"?" [buf data > kill-buffer signal] 3)))) > # bind (number truename buf wildcards rawfile nowarn filename) > find-file-noselect("/home/esj/food/food_calc.py" nil nil nil) > # bind (coding-system-for-read wildcards codesys filename) > find-file("/home/esj/food/food_calc.py") > # bind (dir file-count line end-of-options file-p arg tem) > command-line-1() > # bind (command-line-args-left) > command-line() > # (condition-case ... . ((t (byte-code " ??" [error-data data nil] 1)))) > # bind (error-data) > normal-top-level() > # (condition-case ... . error) > # (catch top-level ...) > > Hi Eric, exists a bug tracker at https://bugs.launchpad.net/python-mode for that kind of problems. Please make an entry there, thanks, Andreas From andreas.roehler at online.de Tue Aug 23 09:43:14 2011 From: andreas.roehler at online.de (=?ISO-8859-15?Q?Andreas_R=F6hler?=) Date: Tue, 23 Aug 2011 09:43:14 +0200 Subject: [Python-mode] python-mode.el-6.0.2 released Message-ID: <4E535A12.3060806@online.de> Hi folks, with the help of Glenn and Gennady a couple of bugs could be fixed. Thanks Barry constantly assisting. Get the new tarball at http://launchpad.net/python-mode/trunk/6.0.2/+download/python-mode.el-6.0.2.tar.gz Also some new features resp. commands are available: - `py-electric-comment' When inserting a comment, if starting a comment, indent accordingly. If a numeric argument ARG is provided, that many colons are inserted non-electrically. With universal-prefix-key C-u \"#\" Electric behavior is inhibited inside a string or comment. - New commands `py-partial-expression': "." operators delimit a partial-expression on it's level. Given the function below, `py-partial-expression' called at pipe symbol would copy and return: def usage(): print """Usage: %s ....""" % ( os.path.basename(sys.argv[0])) ------------|------------------------- ==> path os.path.basename(sys.argv[0])) ------------------|------------------- ==> basename(sys.argv[0])) os.path.basename(sys.argv[0])) --------------------------|----------- ==> sys os.path.basename(sys.argv[0])) ------------------------------|------- ==> argv[0] while `py-expression' would copy and return ( os.path.basename(sys.argv[0])) ;;;;; Also for commands a shorthand is defined: (defalias 'py-statement 'py-copy-statement) which will mark, copy and return. - Commands implementing a behavior which customizing of `py-shell-switch-buffers-on-execute' would do: py-execute-buffer-no-switch py-execute-buffer-switch py-execute-region-no-switch py-execute-region-switch Enjoy, Andreas From andreas.roehler at online.de Mon Aug 29 07:33:38 2011 From: andreas.roehler at online.de (=?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?=) Date: Mon, 29 Aug 2011 07:33:38 +0200 Subject: [Python-mode] [Bug 821986] Re: feature request: byte-compile from commandline In-Reply-To: <87sjolto3x.fsf@pobox.com> References: <20110806161621.14593.40463.malonedeb@gac.canonical.com> <20110828010826.17299.60394.malone@wampee.canonical.com> <4E59ECB4.6010401@online.de> <87sjolto3x.fsf@pobox.com> Message-ID: <4E5B24B2.8080501@online.de> > 2 Working with ESS makes me wish Emacs provided the same level of > support (and unified level of support) for Python as it does for R. Definitely. If you could list the features missed, that would help. Listing together with a short description still more. All this into a Blueprint starts being perfect. :) > (Or for that matter, as JDEE does for Java--or did, since I haven't > worked with that for years> 6.) another point of interest > > HTH, Tom Roche > it did, thanks, Andreas