From skip at pobox.com Thu Oct 21 23:36:20 2004 From: skip at pobox.com (Skip Montanaro) Date: Thu Oct 21 23:36:35 2004 Subject: [Python-mode] Recent python-mode updates Message-ID: <16760.11220.529395.363981@montanaro.dyndns.org> For those who don't monitor python-mode checkins (does anyone? I doubt it), I checked in a couple changes to the python-mode package in the past few days which may be of interest. I thought I would post a note so interested parties can beat on things. * TAB key cycling - When you type a newline or hit the TAB key the cursor moves to the mode-specific idea of the correct tab stop. Hit TAB again and it will back out a stop. You can keep hitting TAB until the cursor is in column 1, at which point hitting TAB one more time will reindent to the "correct" tab stop. * Completion using Pymacs - If you (require 'pycomplete) and have Pymacs installed, as much of the dot expression preceding (point) will be completed as possible. For example, with import time at the top of the file, if you enter time.cl into the current buffer and press M-TAB it will complete "time.clock" for you. Global import statements are taken into account, though the code for this is fragile. All of it could use improvement. I have no idea how to hook into Emacs's builtin completion facility. I created a 1.0alpha release (tar.gz), which is available on SourceForge: http://sourceforge.net/project/showfiles.php?group_id=86916 If you have any questions, please direct them to python-mode@python.org. If you find bugs or have enhancements, please submit a ticket on the python-mode project at SourceForge. Thanks, Skip From barry at python.org Thu Oct 21 23:52:22 2004 From: barry at python.org (Barry Warsaw) Date: Thu Oct 21 23:52:28 2004 Subject: [Python-mode] Recent python-mode updates In-Reply-To: <16760.11220.529395.363981@montanaro.dyndns.org> References: <16760.11220.529395.363981@montanaro.dyndns.org> Message-ID: <1098395542.8515.63.camel@geddy.wooz.org> On Thu, 2004-10-21 at 17:36, Skip Montanaro wrote: > For those who don't monitor python-mode checkins (does anyone? I doubt it), You're probably right, since AFAICT, python-mode checkin messages don't actually go anywhere. Should I hook it up to syncmail and direct the checkin messages to python-mode@python.org (I really don't want to create Yet Another Mailing List for such expected low traffic). > * TAB key cycling - When you type a newline or hit the TAB key the cursor > moves to the mode-specific idea of the correct tab stop. Hit TAB again > and it will back out a stop. You can keep hitting TAB until the cursor is > in column 1, at which point hitting TAB one more time will reindent to the > "correct" tab stop. Neat. > * Completion using Pymacs Very cool. I'm definitely going to have to play with Pymacs one of these days. > If you have any questions, please direct them to python-mode@python.org. If > you find bugs or have enhancements, please submit a ticket on the > python-mode project at SourceForge. We should plan on a few things with python-mode, related to the Python 2.4 release. We need to merge a stable copy back into Python's Misc directory. Right now its got 4.41 while the current version in the python-mode project is 4.63. We should also let upstream providers (the FSF and XEmacs folks) know when we've got a stable release for them to sync to. Any thoughts on that? -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 307 bytes Desc: This is a digitally signed message part Url : http://mail.python.org/pipermail/python-mode/attachments/20041021/4d5e662d/attachment.pgp From skip at pobox.com Fri Oct 22 19:29:59 2004 From: skip at pobox.com (Skip Montanaro) Date: Fri Oct 22 19:30:02 2004 Subject: [Python-mode] Recent python-mode updates In-Reply-To: <1098395542.8515.63.camel@geddy.wooz.org> References: <16760.11220.529395.363981@montanaro.dyndns.org> <1098395542.8515.63.camel@geddy.wooz.org> Message-ID: <16761.17303.153606.92171@montanaro.dyndns.org> >> For those who don't monitor python-mode checkins (does anyone? I >> doubt it), Barry> You're probably right, since AFAICT, python-mode checkin messages Barry> don't actually go anywhere. Should I hook it up to syncmail and Barry> direct the checkin messages to python-mode@python.org (I really Barry> don't want to create Yet Another Mailing List for such expected Barry> low traffic). I think that would be a good idea (+ syncmail, not another list). >> If you have any questions, please direct them to >> python-mode@python.org. If you find bugs or have enhancements, >> please submit a ticket on the python-mode project at SourceForge. Barry> We should plan on a few things with python-mode, related to the Barry> Python 2.4 release. We need to merge a stable copy back into Barry> Python's Misc directory. Right now its got 4.41 while the Barry> current version in the python-mode project is 4.63. We should Barry> also let upstream providers (the FSF and XEmacs folks) know when Barry> we've got a stable release for them to sync to. Any thoughts on Barry> that? The next XEmacs beta (21.5.18?) was just released, so we missed that train. I imagine the xemacs-packages are released on their own schedule though. I have a patch that's been given to me a few times I need to apply to python-mode.el. I'll try to take care of that over the weekend. As for distributing with Python or XEmacs, now that we have multiple files and both Emacs Lisp as well as Python files perhaps we need to write a (shudder) install script. Also, some short user docs, probably in ReST format, would be a good idea. I have no idea how to use Ken's pdbtrack stuff, and things like the new TAB cycling, while not all that magical, should still be documented. Skip From hv at tbz-pariv.de Fri Oct 22 12:47:27 2004 From: hv at tbz-pariv.de (Thomas =?iso-8859-1?q?G=FCttler?=) Date: Sat Oct 23 06:13:35 2004 Subject: [Python-mode] Display current method and class in modeline Message-ID: <200410221247.28368.hv@tbz-pariv.de> Hi, If you isearch in a python file, you don't know the method and class of your current line. It would be very good, if the current method and class are displayed in the mode line (I hope the line at the bottom is called like this). If the current line is in the method bar of the class Foo, something like "myfile.py Foo/bar" would be nice. Does someone know how to implement this? I don't know emacs lisp very well. Thomas Please CC to me, I am not on the list -- Thomas G?ttler, TBZ-PARIV GmbH, Bernsdorfer Str. 210-212, 09126 Chemnitz Tel.: 0371/5221217 Fax: 0371/5221216 From noreply at sourceforge.net Sat Oct 23 06:54:35 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Oct 23 06:54:39 2004 Subject: [Python-mode] [ python-mode-Bugs-1028073 ] Use Jython, not JPython Message-ID: Bugs item #1028073, was opened at 2004-09-14 12:44 Message generated for change (Comment added) made by montanaro You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581349&aid=1028073&group_id=86916 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Mike Hostetler (thehaas) >Assigned to: Skip Montanaro (montanaro) Summary: Use Jython, not JPython Initial Comment: The python-mode.el file still uses JPython. Does anyone else use it anymore? It should be switched to Jython. ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2004-10-22 23:54 Message: Logged In: YES user_id=44345 Changed in v 4.64. I don't use Jython and have never used (make-obsolete) or (make-obsolete-variable). Please give it a whirl. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581349&aid=1028073&group_id=86916 From skip at pobox.com Sat Oct 23 07:02:35 2004 From: skip at pobox.com (Skip Montanaro) Date: Sat Oct 23 07:02:52 2004 Subject: [Python-mode] py-complete.el In-Reply-To: <3FBBF202.1090201@slog.dk> References: <3FBBF202.1090201@slog.dk> Message-ID: <16761.58859.184181.605009@montanaro.dyndns.org> Helge> I have written a python-completion thingy for python-mode, and Helge> annouced that some time ago. My apologies for taking so long to get to this. There's no way I could understand your python completion stuff. Long after forgetting about your submission I rolled my own much simpler version which uses Pymacs. There are pycomplete.el and pycomplete.py files as part of the python-mode distribution now. -- Skip Montanaro skip@mojam.com http://www.mojam.com/ From noreply at sourceforge.net Sat Oct 23 19:24:26 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Oct 23 19:24:30 2004 Subject: [Python-mode] [ python-mode-Bugs-918263 ] "fore:#00007F" breaks indentation Message-ID: Bugs item #918263, was opened at 2004-03-17 14:01 Message generated for change (Comment added) made by montanaro You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581349&aid=918263&group_id=86916 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Chris Green (chrisgreen) Assigned to: Nobody/Anonymous (nobody) Summary: "fore:#00007F" breaks indentation Initial Comment: class a: def __init__(self): self.StyleSetSpec(self.STYLE_FIELD, "fore:#00007F" ) self.StyleSetSpec(self.STYLE_FIELD, "fore:#00007F" ) self.StyleSetSpec(self.STYLE_FIELD, "fore:#00007F" ) self.StyleSetSpec(self.STYLE_FIELD, "fore:#00007F" ) ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2004-10-23 12:24 Message: Logged In: YES user_id=44345 Sorry it's taken me so long to look into this. I believe I found the problem but don't know how to fix it, so I'll describe what I found so that maybe someone with more lisp-fu than me can solve the problem. Basically, too much reliance is placed on regular expressions to determine the end of the first line of a compound statement. In (py-statement-opens-block-p) it searches "for a colon with nothing after it except whitespace, and maybe a comment". Unfortunately, once it gets there, it's smack dab in the middle of a string. There is a check for being in a comment, but not one for being in a string. I somehow think the proper solution might involve calling (py-in-literal), but I'm having trouble making it work. If we're in a string we need to keep searching. ---------------------------------------------------------------------- Comment By: Chris Green (chrisgreen) Date: 2004-03-17 14:02 Message: Logged In: YES user_id=429629 Aiee! Didn't realize there was no formatting in these boxes ( too used to wiki ) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581349&aid=918263&group_id=86916 From noreply at sourceforge.net Sat Oct 23 19:37:47 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Oct 23 19:37:52 2004 Subject: [Python-mode] [ python-mode-Patches-1021881 ] Include the name of a module's package in its buffer name. Message-ID: Patches item #1021881, was opened at 2004-09-03 10:18 Message generated for change (Comment added) made by montanaro You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581351&aid=1021881&group_id=86916 Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: Edward Loper (edloper) Assigned to: Nobody/Anonymous (nobody) Summary: Include the name of a module's package in its buffer name. Initial Comment: Add an option to include a module's package name in its buffer name. E.g. if module `module.py' is contained in a package whose dotted name is `a.b.c', then its buffer will be named "module.py (a.b.c)" instead of just "module.py". When using complex package hierarchies, this can be useful for keeping track of where a module is in the hierarchy. It's especially useful for keeping track of __init__.py files. In the patch, the option is turned on by default; but that could be changed. See the docs for the custom variable py-name-buffers-with-packages. For more info about file-name-handler-alist (which is used to implement the change), see ("Making Certain File Names 'Magic'"). It should work under both emacs and xemacs. ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2004-10-23 12:37 Message: Logged In: YES user_id=44345 Looks good. Checked in as v 4.65. ---------------------------------------------------------------------- Comment By: Edward Loper (edloper) Date: 2004-09-12 16:26 Message: Logged In: YES user_id=195958 Fixed a bug in the patch where the rename would fail if two buffers with the same name were opened. (Also, used context diff instead of unified diff.) ---------------------------------------------------------------------- Comment By: Edward Loper (edloper) Date: 2004-09-06 21:20 Message: Logged In: YES user_id=195958 Attatching file, take 2. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581351&aid=1021881&group_id=86916 From skip at pobox.com Sat Oct 23 19:38:30 2004 From: skip at pobox.com (Skip Montanaro) Date: Sat Oct 23 19:38:35 2004 Subject: [Python-mode] Display current method and class in modeline In-Reply-To: <200410221247.28368.hv@tbz-pariv.de> References: <200410221247.28368.hv@tbz-pariv.de> Message-ID: <16762.38678.428532.480139@montanaro.dyndns.org> Thomas> If you isearch in a python file, you don't know the method and Thomas> class of your current line. Thomas> It would be very good, if the current method and class are Thomas> displayed in the mode line (I hope the line at the bottom is Thomas> called like this). Thomas> If the current line is in the method bar of the class Foo, Thomas> something like "myfile.py Foo/bar" would be nice. Thomas> Does someone know how to implement this? I don't know emacs lisp Thomas> very well. The mode line is getting pretty busy. I'm sure there's a way to do what you ask, but my lisp smarts are pretty limited as well. I just checked in a patch from Ed Loper (python-mode.el v 4.65) to append the package name to the filename. I suspect that check is only performed when the file is first read in though. I doubt it's updated continuously. Skip From noreply at sourceforge.net Sat Oct 23 19:39:33 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Oct 23 19:39:36 2004 Subject: [Python-mode] [ python-mode-Patches-912205 ] PEP 318 Quixote style decorators Message-ID: Patches item #912205, was opened at 2004-03-08 13:36 Message generated for change (Comment added) made by montanaro You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581351&aid=912205&group_id=86916 Category: None Group: None >Status: Closed >Resolution: Out of Date Priority: 5 Submitted By: Barry A. Warsaw (bwarsaw) Assigned to: Nobody/Anonymous (nobody) Summary: PEP 318 Quixote style decorators Initial Comment: Quick hack that supports font-locking Quixote style PEP 318 decorators. Only simple identifiers are supported inside the square brackets, and class decorators aren't supported. ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2004-10-23 12:39 Message: Logged In: YES user_id=44345 Closing this item. We now need @-style decorator support... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581351&aid=912205&group_id=86916 From noreply at sourceforge.net Sat Oct 23 19:46:08 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Oct 23 19:46:12 2004 Subject: [Python-mode] [ python-mode-Patches-783262 ] python-mode py-execute-buffer bug Message-ID: Patches item #783262, was opened at 2003-08-04 22:35 Message generated for change (Comment added) made by montanaro You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581351&aid=783262&group_id=86916 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: Nobody/Anonymous (nobody) Summary: python-mode py-execute-buffer bug Initial Comment: migrated #779839 from python project. Original Submission: The rest of this report is a quote from Skip's message in c.l.py. Attached is Skip's tentative patch (which is likely incorrect for Jython). --------------------------------- John> 1. Why do I get this in my minibuffer when I do John> C-c C-c in a python-mode buffer containing the John> following valid Python code? John> Wrong type argument: sequencep, cpython It looks like a bug in py-execute-region. It sets the shell variable like so: (setq shell (or (py-choose-shell-by-shebang) (py-choose-shell-by-import) py-which-shell)))) which gives it the value (quote cpython). Later on it tries to concatenate it: (let ((cmd (concat shell (if (string-equal py-which-bufname "JPython") " -" "")))) which fails because shell is not a string (strictly speaking, a sequence) at that point. I'm not sure what the correct fix is. ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2004-10-23 12:46 Message: Logged In: YES user_id=44345 Applied Ted Whalen's patch (v 4.66 of python-mode.el). I can't test - Jythoneers, here's your chance... ---------------------------------------------------------------------- Comment By: ted whalen (tew) Date: 2004-09-13 16:33 Message: Logged In: YES user_id=52548 I think what we want here is: --- /usr/share/emacs/site-lisp/python-mode/python-mode.el 2004-03-06 01:16:19.000000000 -0600 +++ lib/elisp/python-mode.el 2004-09-13 16:25:17.000000000 -0500 @@ -1686,7 +1686,7 @@ (setq py-exception-buffer (cons file (current-buffer)))) (t ;; TBD: a horrible hack, but why create new Custom variables? - (let ((cmd (concat shell (if (string-equal py-which-bufname "JPython") + (let ((cmd (concat py-which-shell (if (string-equal py-which-bufname "JPython") " -" "")))) ;; otherwise either run it synchronously in a subprocess (save-excursion ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581351&aid=783262&group_id=86916 From noreply at sourceforge.net Sat Oct 23 19:48:25 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Oct 23 19:48:30 2004 Subject: [Python-mode] [ python-mode-Patches-783248 ] Make python-mode.el use " jython" interp Message-ID: Patches item #783248, was opened at 2003-08-04 22:22 Message generated for change (Comment added) made by montanaro You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581351&aid=783248&group_id=86916 Category: None Group: None >Status: Closed >Resolution: Out of Date Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: Nobody/Anonymous (nobody) Summary: Make python-mode.el use "jython" interp Initial Comment: migrating #574750 from python project. Original submission: I believe it is time to start using the "jython" interpreter by default, rather than the "jpython" interpreter. This patch does it in a minimal way, just changing the command and acknowledging the two names. (I still prefer the JPython name, but...) Followup comments: Date: 2002-07-28 11:00 Sender: loewis Logged In: YES user_id=21627 Please use context or unified diffs for patches; I'm attaching your change as a diff. ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2004-10-23 12:48 Message: Logged In: YES user_id=44345 Checked in a similar change in the past day or two ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581351&aid=783248&group_id=86916 From noreply at sourceforge.net Sat Oct 23 19:54:26 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sat Oct 23 19:55:28 2004 Subject: [Python-mode] [ python-mode-Patches-783260 ] python-mode.el: make C-c - work correctly after C-c | Message-ID: Patches item #783260, was opened at 2003-08-04 22:32 Message generated for change (Comment added) made by montanaro You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581351&aid=783260&group_id=86916 Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: Nobody/Anonymous (nobody) Summary: python-mode.el: make C-c - work correctly after C-c | Initial Comment: migrating #677838 from python project. Original Submission: If you are using python-mode in [X]Emacs and do py-execute-region and get an exception, py-up- exception (C-c -) will go to the wrong line, because the line number reported by Python is only relative to the start of the region. Followup comments: Date: 2003-08-01 12:24 Sender: cgw Logged In: YES user_id=7151 updated patch Date: 2003-07-31 23:55 Sender: montanaro Logged In: YES user_id=44345 Charles, Any chance you can generate your diff against the newest version of python-mode.el (something like 4.38)? I'm having trouble applying the patch you submitted originally, and my feeble manual attempts have so far not demonstrated that the patch (as I applied it) fixes the problem. Thx, Skip Date: 2003-01-31 10:37 Sender: cgw Logged In: YES user_id=7151 I tried uploading the patch again, and seem to have succeeded this time around. It's probably not fair to blane SF, as I think this was a case of pilot error. Date: 2003-01-31 07:16 Sender: mwh Logged In: YES user_id=6656 There's no patch attached... I think SF is subliminally trying to push us into getting roundup ready to use. ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2004-10-23 12:54 Message: Logged In: YES user_id=44345 Thanks Charles... Patch applied to v. 4.67. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581351&aid=783260&group_id=86916 From noreply at sourceforge.net Sun Oct 24 19:10:32 2004 From: noreply at sourceforge.net (SourceForge.net) Date: Sun Oct 24 19:10:35 2004 Subject: [Python-mode] [ python-mode-Patches-912205 ] PEP 318 Quixote style decorators Message-ID: Patches item #912205, was opened at 2004-03-08 14:36 Message generated for change (Comment added) made by bwarsaw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581351&aid=912205&group_id=86916 Category: None Group: None Status: Closed Resolution: Out of Date Priority: 5 Submitted By: Barry A. Warsaw (bwarsaw) Assigned to: Nobody/Anonymous (nobody) Summary: PEP 318 Quixote style decorators Initial Comment: Quick hack that supports font-locking Quixote style PEP 318 decorators. Only simple identifiers are supported inside the square brackets, and class decorators aren't supported. ---------------------------------------------------------------------- >Comment By: Barry A. Warsaw (bwarsaw) Date: 2004-10-24 13:10 Message: Logged In: YES user_id=12800 pie-decorators are supported already. :) ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2004-10-23 13:39 Message: Logged In: YES user_id=44345 Closing this item. We now need @-style decorator support... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=581351&aid=912205&group_id=86916