From andreas.roehler at online.de Wed Oct 5 19:59:14 2011 From: andreas.roehler at online.de (=?ISO-8859-15?Q?Andreas_R=F6hler?=) Date: Wed, 05 Oct 2011 19:59:14 +0200 Subject: [Python-mode] column-marker.el Message-ID: <4E8C9AF2.50008@online.de> Hi, thanks writing resp. maintaining column-marker.el http://www.emacswiki.org/emacs/column-marker.el Find it useful when editing Python code. Considering to ship it with upcoming release. Just to drop you a note so far, best regards Andreas -- https://launchpad.net/python-mode https://launchpad.net/s-x-emacs-werkstatt/ From andreas.roehler at online.de Thu Oct 6 21:00:14 2011 From: andreas.roehler at online.de (=?ISO-8859-15?Q?Andreas_R=F6hler?=) Date: Thu, 06 Oct 2011 21:00:14 +0200 Subject: [Python-mode] python-mode.el-6.0.3 released Message-ID: <4E8DFABE.4060602@online.de> Hi all, gladly announcing the release of python-mode.el-6.0.3. Thanks Barry, Georg and all people assisting with reports. Special thanks to Thomas Caswell and Tavis Rudd, whose branches have been merged. New in version 6.0.3: - commands `ipython', `python2', `python3', `jython', `python' opening a respective python shell - ipython integration started - py-shift-block-left, py-shift-block-right etc. Implemented forms that way are "paragraph" "block" "clause" "def" "class" "line" "statement" - py-dedent Dedent line according to `py-indent-offset'. With arg, do it that many times. If point is between indent levels, dedent to next level. Stops at BOL. Returns column reached, if dedent done, nil otherwise. - py-indent-forward-line Indent line and move one line forward. If `py-kill-empty-line' is non-nil, delete an empty line. When closing a form, use py-close-block et al, which will move and indent likewise. Returns position. - py-down-block Go to the beginning of next block below current level. Returns position if block inside found, nil otherwise. - py-close-block, -clause, -def, class Set indent level to that of beginning of definition. If final line isn't empty and `py-close-block-provides-newline' non-nil, insert a newline. Returns column. - new commands specifying the shell override `py-shell-name' for execution implemented shells are "python" "python2" "python2.7" "python3" "python3.2" "jython" available with default, -switch and -no-switch option, i.e. py-execute-region-python3.2 py-execute-region-python3.2-switch py-execute-region-python3.2-no-switch etc. Docstring of py-execute-region-python3.2-switch for example: "Send the region to a common shell calling the python3.2 interpreter. Ignores setting of `py-shell-switch-buffers-on-execute', output-buffer will being switched to." - Declarations Deal with assignments resp. statements in current level which don't open blocks. Provides common edit functions as copy, mark, kill, go to beg/end. Functions will be used typically to grasp initialisations resp. assignments of variables between the definition of a class or method and it's body, likewise global stuff at the head of a file. - column-marker.el added Commands `column-marker-1', `column-marker-2', and `column-marker-3' each highlight a given column (using different background colors by default). Source: http://launchpad.net/python-mode/trunk/6.0.3/+download/python-mode.el-6.0.3.tar.gz Andreas -- https://launchpad.net/python-mode https://launchpad.net/s-x-emacs-werkstatt/ From Tom_Roche at pobox.com Fri Oct 7 16:52:45 2011 From: Tom_Roche at pobox.com (Tom Roche) Date: Fri, 07 Oct 2011 10:52:45 -0400 Subject: [Python-mode] python-mode.el-6.0.3 released In-Reply-To: <4E8DFABE.4060602@online.de> References: <4E8DFABE.4060602@online.de> Message-ID: <87sjn4dfb6.fsf@pobox.com> Andreas R?hler Thu, 06 Oct 2011 21:00:14 +0200 > http://launchpad.net/python-mode/trunk/6.0.3/+download/python-mode.el-6.0.3.tar.gz Install looks good. I was able to VERSION="6.0.3" PKG_URI="http://launchpad.net/python-mode/trunk/${VERSION}/+download/python-mode.el-${VERSION}.tar.gz" ROOT_DIR="${HOME}/.emacs.d/site-lisp/python" VERSION_DIR="${ROOT_DIR}/python-mode.el-${VERSION}" BCD_RFP="tools/byte-compile-directory.sh" # path relative to ${VERSION_DIR} for CMD in \ "pushd ${ROOT_DIR}" \ "wget -O - ${PKG_URI} | tar xfz -" \ "popd" \ "pushd ${VERSION_DIR}" \ "find ./ -name '*.el' | wc -l" \ "find ./ -name '*.elc' | wc -l" \ "chmod a+x ${BCD_RFP}" \ "${BCD_RFP}" \ "find ./ -name '*.el' | wc -l" \ "find ./ -name '*.elc' | wc -l" \ "popd" \ ; do echo -e "${CMD}" eval "${CMD}" done and the only error I got was > test/python-mode-test.el:27:1:Error: Cannot open load file: py-bug-numbered-tests The scriptlet above finished with > find ./ -name '*.el' | wc -l > 10 > find ./ -name '*.elc' | wc -l > 9 After I make my init.el call python-mode.el-6.0.3 and restart emacs: no errors, and `M-x ipython` and `M-x python3` both work appropriately. From Tom_Roche at pobox.com Fri Oct 7 17:57:37 2011 From: Tom_Roche at pobox.com (Tom Roche) Date: Fri, 07 Oct 2011 11:57:37 -0400 Subject: [Python-mode] what to (not) use with python-mode? Message-ID: <87y5ww94lq.fsf@pobox.com> python-mode now * contains pymacs * does what helpers like the 'ipython' package did (i.e., run `ipython` in an emacs buffer) and probably more of which I'm not aware. So it's time to clean up my emacs-python configuration, i.e., the file I load from my init.el containing python-related instructions. It now has tlrPython.el > (defconst LOCAL-PYTHON-LISP-DIR (concat LOCAL-EMACS-LISP-DIR "/python")) > (defconst PYTHON-MODE-DIR (concat LOCAL-PYTHON-LISP-DIR "/python-mode")) > (setq load-path > (append > (list > LOCAL-PYTHON-LISP-DIR > PYTHON-MODE-DIR > ; no longer needed with python-mode >= 6.0.3 > ; (concat LOCAL-PYTHON-LISP-DIR "/pymacs") > (concat LOCAL-PYTHON-LISP-DIR "/pylookup") > ) > load-path) > ) ; end (setq load-path > ;;; python-mode: https://launchpad.net/python-mode > (require 'python-mode) > (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode)) > ; no longer needed with python-mode >= 6.0.3 > ; (require 'ipython) > ; no longer needed with python-mode >= 6.0.3 > ; ;; pymacs > ; (autoload 'pymacs-apply "pymacs") > ; (autoload 'pymacs-call "pymacs") > ; (autoload 'pymacs-eval "pymacs" nil t) > ; (autoload 'pymacs-exec "pymacs" nil t) > ; (autoload 'pymacs-load "pymacs" nil t) > ; ;; (pymacs-load "ropemacs" "rope-") > ; ;; (setq ropemacs-enable-autoimport t) > (require 'comint) > (define-key comint-mode-map (kbd "M-") 'comint-next-input) > (define-key comint-mode-map (kbd "M-") 'comint-previous-input) > (define-key comint-mode-map [down] 'comint-next-matching-input-from-input) > (define-key comint-mode-map [up] 'comint-previous-matching-input-from-input) > ;;; pylookup: http://taesoo.org/Opensource/Pylookup > ;;; following from pylookup-dir/README > (setq pylookup-dir (concat LOCAL-PYTHON-LISP-DIR "/pylookup")) > ; (add-to-list 'load-path pylookup-dir) ; done above > ;; load pylookup @ compile time > (eval-when-compile (require 'pylookup)) > ;; set executable file and db file > (setq pylookup-program (concat pylookup-dir "/pylookup.py")) > (setq pylookup-db-file (concat pylookup-dir "/pylookup.db")) > ;; to speedup, just load it on demand > (autoload 'pylookup-lookup "pylookup" > "Lookup SEARCH-TERM in the Python HTML indexes." t) > (autoload 'pylookup-update "pylookup" > "Run pylookup-update and create the database at `pylookup-db-file'." t) > (global-set-key "\C-ch" 'pylookup-lookup) > ;;; to update offline, see pylookup-dir/README) > ;;; autopair: http://code.google.com/p/autopair/ > (autoload 'autopair-global-mode "autopair" nil t) > (autopair-global-mode) > (add-hook 'lisp-mode-hook > #'(lambda () (setq autopair-dont-activate t))) > (add-hook 'python-mode-hook > #'(lambda () > (push '(?' . ?') > (getf autopair-extra-pairs :code)) > (setq autopair-handle-action-fns > (list #'autopair-default-handle-action > #'autopair-python-triple-quote-action)))) > ;; $ sudo aptitude install pylint pep8 > ;; The following NEW packages will be installed: > ;; blt{a} pep8 pylint python-logilab-astng{a} python-logilab-common{a} python-tk{a} tcl8.5{a} tk8.5{a} > ;; 0 packages upgraded, 8 newly installed, 0 to remove and 0 not upgraded. > ;; Need to get 5,797kB of archives. After unpacking 28.0MB will be used. > (require 'python-pep8) > (require 'python-pylint) > ;;; yasnippet: http://code.google.com/p/yasnippet/ > (require 'yasnippet-bundle) > (yas/initialize) > (yas/load-directory (concat LOCAL-PYTHON-LISP-DIR "/my-snippets/")) > ;;; nose support (for testing): see > ;;; LOCAL-PYTHON-LISP-DIR/nose.el > ;;; from > ;;; https://bitbucket.org/jpellerin/nosemacs/src/0192bf439dc9/nose.el > (require 'nose) > ;;; to enable searching for test cases in current directory, `touch setup.py` there (e.g. with `M-x eshell`) > ;;; following fails as of 29 Jul 11 01:17:03 PM: see > ;;; https://bitbucket.org/jpellerin/nosemacs/issue/2/adding-py-to-nose-project-root-files-fails > ;(add-to-list 'nose-project-root-files ".py") > ;;; default keybindings from nose.el > (add-hook 'python-mode-hook > (lambda () > (local-set-key "\C-ca" 'nosetests-all) > (local-set-key "\C-cm" 'nosetests-module) > (local-set-key "\C-c." 'nosetests-one) > (local-set-key "\C-cpa" 'nosetests-pdb-all) > (local-set-key "\C-cpm" 'nosetests-pdb-module) > (local-set-key "\C-cp." 'nosetests-pdb-one))) Has python-mode made any of the above superfluous? Are there better settings for any of the above? Also, if there's anything you currently use with emacs when writing python that you'd care to recommend, please do. TIA, Tom Roche From andreas.roehler at online.de Fri Oct 7 19:53:00 2011 From: andreas.roehler at online.de (=?ISO-8859-1?Q?Andreas_R=F6hler?=) Date: Fri, 07 Oct 2011 19:53:00 +0200 Subject: [Python-mode] what to (not) use with python-mode? In-Reply-To: <87y5ww94lq.fsf@pobox.com> References: <87y5ww94lq.fsf@pobox.com> Message-ID: <4E8F3C7C.2040606@online.de> [ ... ] Hi Tom, pasted your questions onto the Blueprint https://blueprints.launchpad.net/python-mode/+spec/python-mode-pymacs so it don't get lost. BTW we just started delivering Pymacs. It might help if you check one by one how far the requirements are served already resp. not - please send bug-reports in the latter case. Thanks, Andreas From Tom_Roche at pobox.com Sun Oct 9 05:27:52 2011 From: Tom_Roche at pobox.com (Tom Roche) Date: Sat, 08 Oct 2011 23:27:52 -0400 Subject: [Python-mode] what to (not) use with python-mode? In-Reply-To: <4E8F3C7C.2040606@online.de> References: <4E8F3C7C.2040606@online.de> <87y5ww94lq.fsf@pobox.com> Message-ID: <87vcryalon.fsf@pobox.com> Andreas R?hler Fri, 07 Oct 2011 19:53:00 +0200 > BTW we just started delivering Pymacs. This is good. (Hoffentlich :-) > It might help if you check one by one how far the requirements are > served already Perhaps I should know this, but, since I don't: where are the requirements listed? From andreas.roehler at online.de Sun Oct 9 08:23:07 2011 From: andreas.roehler at online.de (=?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?=) Date: Sun, 09 Oct 2011 08:23:07 +0200 Subject: [Python-mode] what to (not) use with python-mode? In-Reply-To: <87vcryalon.fsf@pobox.com> References: <4E8F3C7C.2040606@online.de> <87y5ww94lq.fsf@pobox.com> <87vcryalon.fsf@pobox.com> Message-ID: <4E913DCB.8080404@online.de> Am 09.10.2011 05:27, schrieb Tom Roche: > > Andreas R?hler Fri, 07 Oct 2011 19:53:00 +0200 >> BTW we just started delivering Pymacs. > > This is good. (Hoffentlich :-) > >> It might help if you check one by one how far the requirements are >> served already > > Perhaps I should know this, but, since I don't: where are the requirements listed? > _______________________________________________ meant: if you remove your init done so far, will Pymacs work still? Andreas From Tom_Roche at pobox.com Sun Oct 9 23:21:33 2011 From: Tom_Roche at pobox.com (Tom Roche) Date: Sun, 09 Oct 2011 17:21:33 -0400 Subject: [Python-mode] bug with shipped pymacs? was: what to (not) use with python-mode? In-Reply-To: <4E913DCB.8080404@online.de> References: <4E913DCB.8080404@online.de> <4E8F3C7C.2040606@online.de> <87y5ww94lq.fsf@pobox.com> <87vcryalon.fsf@pobox.com> Message-ID: <87vcrxeu8y.fsf@pobox.com> summary: something is wrong with the pymacs I installed with python-mode=6.0.3, or with my installation or use of it. Let me know if I need to do something different, or file a bug, or both, or neither. details: Andreas R?hler Sun, 09 Oct 2011 08:23:07 +0200 > [does] Pymacs work still? Doh! Obviously I should have tested that. For instructions in testing pymacs, I went to http://pymacs.progiciels-bpi.ca/pymacs.html#installation >> 2.5 Prepare your .emacs file >> The .emacs file [needs] these lines: >> (autoload 'pymacs-apply "pymacs") >> (autoload 'pymacs-call "pymacs") >> (autoload 'pymacs-eval "pymacs" nil t) >> (autoload 'pymacs-exec "pymacs" nil t) >> (autoload 'pymacs-load "pymacs" nil t) >> ;;(eval-after-load "pymacs" >> ;; '(add-to-list 'pymacs-load-path YOUR-PYMACS-DIRECTORY")) >> If you plan to use a special directory to hold your own Pymacs code >> in Python, which should be searched prior to the usual Python >> import search path, then uncomment the last two lines (by removing >> the semi-colons) and replace YOUR-PYMACS-DIRECTORY by the name of >> your special directory. [...] >> To check [your install], start a fresh Emacs session, and type >> M-x pymacs-eval >> Emacs should prompt you for a Python expression. It did not. So I restored some lines to my tlrPython.el (which is loaded by my init.el), producing tlrPython.el > (defconst LOCAL-PYTHON-LISP-DIR (concat LOCAL-EMACS-LISP-DIR "/python")) > (defconst PYTHON-MODE-DIR (concat LOCAL-PYTHON-LISP-DIR "/python-mode")) > (defconst PYMACS-DIR (concat PYTHON-MODE-DIR "/pymacs")) > (defconst PYLOOKUP-DIR (concat LOCAL-PYTHON-LISP-DIR "/pylookup")) > (setq load-path > (append > (list > LOCAL-PYTHON-LISP-DIR > PYTHON-MODE-DIR > PYMACS-DIR > PYLOOKUP-DIR > ) > load-path) > ) ; end (setq load-path > > ;;; python-mode: https://launchpad.net/python-mode > (require 'python-mode) > (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode)) > > ; no longer needed with python-mode >= 6.0.3 > ; (require 'ipython) > > ;; pymacs > (autoload 'pymacs-apply "pymacs") > (autoload 'pymacs-call "pymacs") > (autoload 'pymacs-eval "pymacs" nil t) > (autoload 'pymacs-exec "pymacs" nil t) > (autoload 'pymacs-load "pymacs" nil t) > ;; (pymacs-load "ropemacs" "rope-") > ;; (setq ropemacs-enable-autoimport t) > > (require 'comint) > (define-key comint-mode-map (kbd "M-") 'comint-next-input) > (define-key comint-mode-map (kbd "M-") 'comint-previous-input) > (define-key comint-mode-map [down] 'comint-next-matching-input-from-input) > (define-key comint-mode-map [up] 'comint-previous-matching-input-from-input) > > ;;; pylookup: http://taesoo.org/Opensource/Pylookup > ;;; following from pylookup-dir/README > (setq pylookup-dir (concat LOCAL-PYTHON-LISP-DIR "/pylookup")) > ; (add-to-list 'load-path pylookup-dir) ; done above > ;; load pylookup @ compile time > (eval-when-compile (require 'pylookup)) > ;; set executable file and db file > (setq pylookup-program (concat pylookup-dir "/pylookup.py")) > (setq pylookup-db-file (concat pylookup-dir "/pylookup.db")) > ;; to speedup, just load it on demand > (autoload 'pylookup-lookup "pylookup" > "Lookup SEARCH-TERM in the Python HTML indexes." t) > (autoload 'pylookup-update "pylookup" > "Run pylookup-update and create the database at `pylookup-db-file'." t) > (global-set-key "\C-ch" 'pylookup-lookup) > ;;; to update offline, see pylookup-dir/README) > > ;;; autopair: http://code.google.com/p/autopair/ > (autoload 'autopair-global-mode "autopair" nil t) > (autopair-global-mode) > (add-hook 'lisp-mode-hook > #'(lambda () (setq autopair-dont-activate t))) > (add-hook 'python-mode-hook > #'(lambda () > (push '(?' . ?') > (getf autopair-extra-pairs :code)) > (setq autopair-handle-action-fns > (list #'autopair-default-handle-action > #'autopair-python-triple-quote-action)))) > > ;; $ sudo aptitude install pylint pep8 > (require 'python-pep8) > (require 'python-pylint) > > ;;; yasnippet: http://code.google.com/p/yasnippet/ > (require 'yasnippet-bundle) > (yas/initialize) > (yas/load-directory (concat LOCAL-PYTHON-LISP-DIR "/my-snippets/")) > > ;;; nose support (for testing): see > ;;; LOCAL-PYTHON-LISP-DIR/nose.el > ;;; from > ;;; https://bitbucket.org/jpellerin/nosemacs/src/0192bf439dc9/nose.el > (require 'nose) > ;;; to enable searching for test cases in current directory, `touch setup.py` there (e.g. with `M-x eshell`) > ;;; following fails as of 29 Jul 11 01:17:03 PM: see > ;;; https://bitbucket.org/jpellerin/nosemacs/issue/2/adding-py-to-nose-project-root-files-fails > ;(add-to-list 'nose-project-root-files ".py") > ;;; default keybindings from nose.el > (add-hook 'python-mode-hook > (lambda () > (local-set-key "\C-ca" 'nosetests-all) > (local-set-key "\C-cm" 'nosetests-module) > (local-set-key "\C-c." 'nosetests-one) > (local-set-key "\C-cpa" 'nosetests-pdb-all) > (local-set-key "\C-cpm" 'nosetests-pdb-module) > (local-set-key "\C-cp." 'nosetests-pdb-one))) byte-compile-file, and restarted emacs. I then was able to do M-x pymacs-eval and got prompt="Python expression?" at which I tried >> repr(2L**111) RET ([or] repr(2**111) RET if you are using Python 3). >> The mini buffer should display >> "2596148429267413814265248164610048L" >> ([or 2596148429267413814265248164610048] in Python 3). It did not. Instead I got *Backtrace* > Debugger entered--Lisp error: (error "Pymacs Lisp version is @VERSION@, Python is 0.24-beta2") > signal(error ("Pymacs Lisp version is @VERSION@, Python is 0.24-beta2")) > pymacs-report-error("Pymacs Lisp version is @VERSION@, Python is %s" "0.24-beta2") > pymacs-start-services() > pymacs-serve-until-reply("eval" (princ "repr(2L**111)")) > pymacs-eval("repr(2L**111)") > call-interactively(pymacs-eval t nil) > execute-extended-command(nil) > call-interactively(execute-extended-command nil nil) Note that error message is broken in at least 2 ways, since $ python --version Python 2.7.2 -- EPD 7.1-2 (64-bit) and it is pymacs that has version=0.24-beta2. Fortunately I still have a previously-installed working pymacs, so I changed one line in my tlrPython.el to point to that - (defconst PYMACS-DIR (concat PYTHON-MODE-DIR "/pymacs")) + (defconst PYMACS-DIR (concat LOCAL-PYTHON-LISP-DIR "/pymacs")) byte-compile-file, and restarted emacs. I then was able to do M-x pymacs-eval and got prompt="Python expression?" at which I entered repr(2L**111) and got the expected result "2596148429267413814265248164610048L" in the minibuffer. So ISTM something is wrong; please advise. HTH, Tom Roche From andreas.roehler at online.de Mon Oct 10 13:29:59 2011 From: andreas.roehler at online.de (=?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?=) Date: Mon, 10 Oct 2011 13:29:59 +0200 Subject: [Python-mode] [Bug 869854] Re: Comment indentation level isn't factored into next line's indendation level In-Reply-To: <20111010104430.18199.26280.malone@wampee.canonical.com> References: <20111007093128.25751.67086.malonedeb@chaenomeles.canonical.com> <20111010104430.18199.26280.malone@wampee.canonical.com> Message-ID: <4E92D737.2060109@online.de> Am 10.10.2011 12:44, schrieb Ryan Kaskel: > By the way... I know this isn't the right place to ask but CC to python-mode at python.org as other may have that question too how do I > update my bzr branch to track trunk? > > I've tried: > > $ bzr update lp:python-mode > bzr: ERROR: No WorkingTree exists for "bzr+ssh://bazaar.launchpad.net/%2Bbranch/python-mode/". > first do bzr branch lp:python-mode afterwards from inside the directory bzr pull lp:python-mode should work From andrea.crotti.0 at gmail.com Mon Oct 10 14:00:29 2011 From: andrea.crotti.0 at gmail.com (Andrea Crotti) Date: Mon, 10 Oct 2011 13:00:29 +0100 Subject: [Python-mode] problem with byte-code Message-ID: <4E92DE5D.2090609@gmail.com> I pulled revision 633 and byte-compiled it, but if I call python-mode I get: "byte-code: Don't know how to make a localized variable an alias" and no stacktrace even if I set debug-on-error to true. Any idea of what it could be? Another thing which I think would be nice is to get rid of this python-mode.el:1351:91:Warning: `interactive-p' is an obsolete function (as of Emacs 23.2); use `called-interactively-p' instead. Are you interested in a fix for that? Just a wrapper function that the new one if emacs version is > 23.2 should be fine, right? From andreas.roehler at online.de Mon Oct 10 14:31:06 2011 From: andreas.roehler at online.de (=?ISO-8859-1?Q?Andreas_R=F6hler?=) Date: Mon, 10 Oct 2011 14:31:06 +0200 Subject: [Python-mode] problem with byte-code In-Reply-To: <4E92DE5D.2090609@gmail.com> References: <4E92DE5D.2090609@gmail.com> Message-ID: <4E92E58A.3000405@online.de> Am 10.10.2011 14:00, schrieb Andrea Crotti: > I pulled revision 633 and byte-compiled it, but if I call python-mode I > get: > > "byte-code: Don't know how to make a localized variable an alias" > > and no stacktrace even if I set debug-on-error to true. > > Any idea of what it could be? > just asked at emacs-help myself. Only occurs with Emacs24 here. Workaround: comment the following section ;; backward compatibility (define-obsolete-variable-alias 'py-python-command 'py-shell-name "version 6.0.4") (define-obsolete-variable-alias 'py-jpython-command 'py-shell-name "version 6.0.4") (define-obsolete-variable-alias 'py-jython-command 'py-shell-name "version 6.0.4") (define-obsolete-variable-alias 'py-default-interpreter 'py-shell-name "version 6.0.4") (define-obsolete-variable-alias 'python-command 'py-shell-name "version 6.0.4") ;;;;;;;;;;;; Should py-python-command other aliased var now be missed, replace the relevant code with py-shell-name or do bzr branch -r626 lp:python-mode as patch of r627 caused this > Another thing which I think would be nice is to get rid of this > python-mode.el:1351:91:Warning: `interactive-p' is an obsolete function > (as of > Emacs 23.2); use `called-interactively-p' instead. > > Are you interested in a fix for that? Just a wrapper function that the > new one if > emacs version is > 23.2 should be fine, right? > See here http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00329.html Stefan promised to keep that function. Remains to switch off the warning when compile, as it messes up the buffer and makes relevant messages not noticed maybe. Cheers, Andreas From andreas.roehler at online.de Thu Oct 13 18:41:52 2011 From: andreas.roehler at online.de (=?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?=) Date: Thu, 13 Oct 2011 18:41:52 +0200 Subject: [Python-mode] [Bug 873372] [NEW] Comment indented incorrectly after inline comment In-Reply-To: <20111013103731.785d7851@limelight.wooz.org> References: <20111013141847.30566.88434.malonedeb@soybean.canonical.com> <20111013103731.785d7851@limelight.wooz.org> Message-ID: <4E9714D0.8070003@online.de> Am 13.10.2011 16:37, schrieb Barry Warsaw: > On Oct 13, 2011, at 02:18 PM, Ryan Kaskel wrote: > >> Another little comment bug: >> >> --------------------- >> foo = True # the next line is indented incorrectly >> # to here >> ---------------------- >> >> I think it should line up with 'f' in 'foo'. > > I'm not sure I agree entirely. I tend to avoid these types of comments, but I > think this one is worth a discussion on the mailing list. > so cc to it. I'm in favor of the present behavior BTW. However agree, there are two reasonable positions of a following indent. Would support a request that way: when cursor is at the indented comment in second line, a dedent should reach the column 0. Agreed? From barry at python.org Thu Oct 13 19:32:15 2011 From: barry at python.org (Barry Warsaw) Date: Thu, 13 Oct 2011 13:32:15 -0400 Subject: [Python-mode] [Bug 873372] [NEW] Comment indented incorrectly after inline comment In-Reply-To: <4E9714D0.8070003@online.de> References: <20111013141847.30566.88434.malonedeb@soybean.canonical.com> <20111013103731.785d7851@limelight.wooz.org> <4E9714D0.8070003@online.de> Message-ID: <20111013133215.778d3337@limelight.wooz.org> On Oct 13, 2011, at 06:41 PM, Andreas R?hler wrote: >Am 13.10.2011 16:37, schrieb Barry Warsaw: >> On Oct 13, 2011, at 02:18 PM, Ryan Kaskel wrote: >> >>> Another little comment bug: >>> >>> --------------------- >>> foo = True # the next line is indented incorrectly >>> # to here >>> ---------------------- >>> >>> I think it should line up with 'f' in 'foo'. >> >> I'm not sure I agree entirely. I tend to avoid these types of comments, but I >> think this one is worth a discussion on the mailing list. >> > >so cc to it. > >I'm in favor of the present behavior BTW. > >However agree, there are two reasonable positions of a following indent. > >Would support a request that way: > >when cursor is at the indented comment in second line, a dedent should reach >the column 0. In this case, but in cases where there is leading indentation, a dedent would reach that column. Right? >Agreed? Seems reasonable to me. -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 Thu Oct 13 19:58:35 2011 From: andreas.roehler at online.de (=?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?=) Date: Thu, 13 Oct 2011 19:58:35 +0200 Subject: [Python-mode] [Bug 873372] [NEW] Comment indented incorrectly after inline comment In-Reply-To: <20111013133215.778d3337@limelight.wooz.org> References: <20111013141847.30566.88434.malonedeb@soybean.canonical.com> <20111013103731.785d7851@limelight.wooz.org> <4E9714D0.8070003@online.de> <20111013133215.778d3337@limelight.wooz.org> Message-ID: <4E9726CB.4030902@online.de> Am 13.10.2011 19:32, schrieb Barry Warsaw: > On Oct 13, 2011, at 06:41 PM, Andreas R?hler wrote: > >> Am 13.10.2011 16:37, schrieb Barry Warsaw: >>> On Oct 13, 2011, at 02:18 PM, Ryan Kaskel wrote: >>> >>>> Another little comment bug: >>>> >>>> --------------------- >>>> foo = True # the next line is indented incorrectly >>>> # to here >>>> ---------------------- >>>> >>>> I think it should line up with 'f' in 'foo'. >>> >>> I'm not sure I agree entirely. I tend to avoid these types of comments, but I >>> think this one is worth a discussion on the mailing list. >>> >> >> so cc to it. >> >> I'm in favor of the present behavior BTW. >> >> However agree, there are two reasonable positions of a following indent. >> >> Would support a request that way: >> >> when cursor is at the indented comment in second line, a dedent should reach >> the column 0. > > In this case, but in cases where there is leading indentation, a dedent would > reach that column. Right? OK, that might line up that way possibly call_this_function( foo=bar).another_function( # some comment # some more comment foo=bar) > >> Agreed? > > Seems reasonable to me. > > -Barry > From drew.adams at oracle.com Wed Oct 5 20:08:18 2011 From: drew.adams at oracle.com (Drew Adams) Date: Wed, 5 Oct 2011 11:08:18 -0700 Subject: [Python-mode] column-marker.el References: <4E8C9AF2.50008@online.de> Message-ID: <61CC1DCDC3B04EB08FDC0AEDBAA38058@us.oracle.com> Sorry, I didn't mean to hit Reply All (bad habit), and I didn't realize the mail from Andreas was not sent only to me. From drew.adams at oracle.com Wed Oct 5 20:06:21 2011 From: drew.adams at oracle.com (Drew Adams) Date: Wed, 5 Oct 2011 11:06:21 -0700 Subject: [Python-mode] column-marker.el In-Reply-To: <4E8C9AF2.50008@online.de> References: <4E8C9AF2.50008@online.de> Message-ID: <2FA2DB737D174D35AF3E558A6326E8BA@us.oracle.com> You're welcome, but I didn't write it. I just posted it to the wiki and made a few tweaks (with the original author's permission). Enjoy - Drew > thanks writing resp. maintaining column-marker.el > http://www.emacswiki.org/emacs/column-marker.el > Find it useful when editing Python code. > Considering to ship it with upcoming release. From bouchez at cerege.fr Tue Oct 18 17:08:08 2011 From: bouchez at cerege.fr (Camille Bouchez) Date: Tue, 18 Oct 2011 17:08:08 +0200 Subject: [Python-mode] help on python mode Message-ID: <273E1806-0FA9-4E38-A37A-87E4F64F4C98@cerege.fr> Hello, I am currently using emacs and python mode. But when I modify my files and save them and then try to compile it with (C-C !), the changes are not taken into account. I have to exit python and then do C-C ! again so that changes are taken into account. Can you help me find a way not to have to exit python each time I make a change ? Thank you very much ! Camille -- Camille Bouchez PhD student CEREGE, UMR 6635 Europ?le M?diterran?en de l'Arbois - BP 80 13545 Aix en Provence, Cedex 04, FRANCE From geneh at shaw.ca Fri Oct 21 15:21:02 2011 From: geneh at shaw.ca (Gene Horodecki) Date: Fri, 21 Oct 2011 08:21:02 -0500 Subject: [Python-mode] New to python mode, help! Message-ID: <4EA171BE.4010402@shaw.ca> Hi there. I was using emacs before without python-mode but I am new to xemacs. I'd like to use python-mode and I think I've installed it properly but nothing noticeable seems to be happening when I open a python script. I put the python mode code in: ~/.xemacs.d/plugins/python-mode.el-6.0.3 I put the following in my .xemacs/init.el file: (add-to-list 'load-path "~/.xemacs.d/plugins/python-mode.el-6.0.3") (require 'python-mode) (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist)) (setq interpreter-mode-alist (cons '("python" . python-mode) interpreter-mode-alist)) (autoload 'python-mode "python-mode" "Python editing mode." t) (global-font-lock-mode t) (setq font-lock-maximum-decoration t) When I open a .py file I get no syntax highlighting, no menu item.. nothing. Could someone please help? Thanks. From Tom_Roche at pobox.com Fri Oct 21 15:43:49 2011 From: Tom_Roche at pobox.com (Tom Roche) Date: Fri, 21 Oct 2011 09:43:49 -0400 Subject: [Python-mode] New to python mode, help! In-Reply-To: <4EA171BE.4010402@shaw.ca> References: <4EA171BE.4010402@shaw.ca> Message-ID: <87ty72qx2i.fsf@pobox.com> Gene Horodecki Fri, 21 Oct 2011 08:21:02 -0500 > I am new to xemacs. I'm GNU, but perhaps can be of assistance. > nothing noticeable seems to be happening when I open a python > script[:] no syntax highlighting, no menu item.. nothing. Do you at least get "Python" in the mode line? Do you see anything python-related in buffer="*Messages*"? FWIW, Tom Roche From geneh at shaw.ca Fri Oct 21 17:21:04 2011 From: geneh at shaw.ca (Gene Horodecki) Date: Fri, 21 Oct 2011 10:21:04 -0500 Subject: [Python-mode] New to python mode, help! In-Reply-To: <87ty72qx2i.fsf@pobox.com> References: <4EA171BE.4010402@shaw.ca> <87ty72qx2i.fsf@pobox.com> Message-ID: <4EA18DE0.3050106@shaw.ca> On 10/21/2011 8:43 AM, Tom Roche wrote: > Gene Horodecki Fri, 21 Oct 2011 08:21:02 -0500 >> I am new to xemacs. > I'm GNU, but perhaps can be of assistance. > >> nothing noticeable seems to be happening when I open a python >> script[:] no syntax highlighting, no menu item.. nothing. > Do you at least get "Python" in the mode line? > > Do you see anything python-related in buffer="*Messages*"?re > > FWIW, Tom Roche > _______________________________________________ > Python-mode mailing list > Python-mode at python.org > http://mail.python.org/mailman/listinfo/python-mode > > > ----- > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1411 / Virus Database: 1522/3963 - Release Date: 10/20/11 IN the messages buffer, I did see a complaint about the (global-font-lock-mode t) which I removed and then no errors except for usual X11 font complaints. According to python-mode.el the line is not required for xemacs anyway. Nothing python related. Yes I do get 'Python' in the mode line. From andreas.roehler at online.de Fri Oct 21 18:40:51 2011 From: andreas.roehler at online.de (=?ISO-8859-1?Q?Andreas_R=F6hler?=) Date: Fri, 21 Oct 2011 18:40:51 +0200 Subject: [Python-mode] New to python mode, help! In-Reply-To: <4EA18DE0.3050106@shaw.ca> References: <4EA171BE.4010402@shaw.ca> <87ty72qx2i.fsf@pobox.com> <4EA18DE0.3050106@shaw.ca> Message-ID: <4EA1A093.40008@online.de> Am 21.10.2011 17:21, schrieb Gene Horodecki: > On 10/21/2011 8:43 AM, Tom Roche wrote: >> Gene Horodecki Fri, 21 Oct 2011 08:21:02 -0500 [ ... ] > IN the messages buffer, I did see a complaint about the > (global-font-lock-mode t) which I removed and then no errors except for > usual X11 font complaints. According to python-mode.el the line is not > required for xemacs anyway. Nothing python related. Yes I do get > 'Python' in the mode line. Hi, as current release has some compatibility issues with XEmacs, we maintain a separate branch for it - no release so far. Get it with your browser from http://bazaar.launchpad.net/~a-roehler/python-mode/XEmacs-compat-test/files better still with bazaar installed: bzr branch lp:~a-roehler/python-mode/XEmacs-compat-test Interested to learn how it works, thanks, Andreas From andreas.roehler at online.de Fri Oct 21 19:05:55 2011 From: andreas.roehler at online.de (=?ISO-8859-15?Q?Andreas_R=F6hler?=) Date: Fri, 21 Oct 2011 19:05:55 +0200 Subject: [Python-mode] XEmacs branch Message-ID: <4EA1A673.40904@online.de> Hi Barry, hi all, as XEmacs branch resolves an incompatibility - should we create a serie from it and make a separate XEmacs release next time? Mentioned the branch at the entry page for the moment, cheers, Andreas -- https://launchpad.net/python-mode https://launchpad.net/s-x-emacs-werkstatt/ From barry at python.org Fri Oct 21 19:47:48 2011 From: barry at python.org (Barry Warsaw) Date: Fri, 21 Oct 2011 13:47:48 -0400 Subject: [Python-mode] XEmacs branch In-Reply-To: <4EA1A673.40904@online.de> References: <4EA1A673.40904@online.de> Message-ID: <20111021134748.58e61014@resist.wooz.org> On Oct 21, 2011, at 07:05 PM, Andreas R?hler wrote: >as XEmacs branch resolves an incompatibility - should we create a serie from >it and make a separate XEmacs release next time? Is it not possible to support both in one version of python-mode.el? -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: From geneh at shaw.ca Sat Oct 22 02:34:29 2011 From: geneh at shaw.ca (Gene Horodecki) Date: Fri, 21 Oct 2011 19:34:29 -0500 Subject: [Python-mode] New to python mode, help! In-Reply-To: <4EA1A093.40008@online.de> References: <4EA171BE.4010402@shaw.ca> <87ty72qx2i.fsf@pobox.com> <4EA18DE0.3050106@shaw.ca> <4EA1A093.40008@online.de> Message-ID: <4EA20F95.1020708@shaw.ca> On 10/21/2011 11:40 AM, Andreas R?hler wrote: > Am 21.10.2011 17:21, schrieb Gene Horodecki: >> On 10/21/2011 8:43 AM, Tom Roche wrote: >>> Gene Horodecki Fri, 21 Oct 2011 08:21:02 -0500 > > [ ... ] >> IN the messages buffer, I did see a complaint about the >> (global-font-lock-mode t) which I removed and then no errors except for >> usual X11 font complaints. According to python-mode.el the line is not >> required for xemacs anyway. Nothing python related. Yes I do get >> 'Python' in the mode line. > > Hi, > > as current release has some compatibility issues with XEmacs, we > maintain a separate branch for it - no release so far. > > Get it with your browser from > > http://bazaar.launchpad.net/~a-roehler/python-mode/XEmacs-compat-test/files > > > better still with bazaar installed: > > bzr branch lp:~a-roehler/python-mode/XEmacs-compat-test > > > Interested to learn how it works, > > thanks, > > Andreas > _______________________________________________ > Python-mode mailing list > Python-mode at python.org > http://mail.python.org/mailman/listinfo/python-mode > > > ----- > No virus found in this message. > Checked by AVG - www.avg.com > Version: 10.0.1411 / Virus Database: 1522/3965 - Release Date: 10/21/11 Ok first of all that did not seem to make a difference. A bit of a funny story though. I was using GNU emacs in terminal mode and I did not realize it had a GUI. I typed emacs instead of xemacs just now with my X11 tunnel open and x-server running and I like it a lot better then xemacs! So needless to say I will sojourn on with GNU emacs. Question: I'm not really clear on exactly what python-mode includes. Does it include all the ropemacs type stuff or do I need to load that as well? Thanks. From geneh at shaw.ca Sat Oct 22 04:03:14 2011 From: geneh at shaw.ca (Gene Horodecki) Date: Fri, 21 Oct 2011 21:03:14 -0500 Subject: [Python-mode] New to python mode, help! In-Reply-To: <4EA20F95.1020708@shaw.ca> References: <4EA171BE.4010402@shaw.ca> <87ty72qx2i.fsf@pobox.com> <4EA18DE0.3050106@shaw.ca> <4EA1A093.40008@online.de> <4EA20F95.1020708@shaw.ca> Message-ID: <4EA22462.2000406@shaw.ca> At the risk of being a pest, I thought I would explain how far I have gotten and what doesn't work for me. Basically the code-completion doesn't seem to be working. For example: import time mytime = time.cl and I get nothing. Also, I have read I should be able to do something like, myfile = open( , and get a signature for the open function? Not working either. I switched to GNU emacs, and I am using the .el for GNU emacs. I copied the .el files into ~/.emacs.d/site-lisp. Here is the contents of the directory: #~/.emacs.d/site-lisp$ ls highlight-indentation.el ido.el pycomplete.el python-mode.el Here is the contents of my .emacs file: :~$ cat .emacs (add-to-list 'load-path "~/.emacs.d/site-lisp") ;; python-mode settings (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist)) (setq interpreter-mode-alist(cons '("python" . python-mode) interpreter-mode-alist)) ;; path to the python interpreter, e.g.: ~rw/python27/bin/python2.7 (setq py-python-command "/usr/bin/python2.6") (autoload 'python-mode "python-mode" "Python editing mode." t) ;; pymacs settings (setq pymacs-python-command py-python-command) (autoload 'pymacs-load "pymacs" nil t) (autoload 'pymacs-eval "pymacs" nil t) (autoload 'pymacs-apply "pymacs") (autoload 'pymacs-call "pymacs") (require 'pycomplete) (require 'ido) (ido-mode t) Can anyone help me? Thanks. From andreas.roehler at online.de Sat Oct 22 08:25:09 2011 From: andreas.roehler at online.de (=?ISO-8859-1?Q?Andreas_R=F6hler?=) Date: Sat, 22 Oct 2011 08:25:09 +0200 Subject: [Python-mode] New to python mode, help! In-Reply-To: <4EA20F95.1020708@shaw.ca> References: <4EA171BE.4010402@shaw.ca> <87ty72qx2i.fsf@pobox.com> <4EA18DE0.3050106@shaw.ca> <4EA1A093.40008@online.de> <4EA20F95.1020708@shaw.ca> Message-ID: <4EA261C5.1060802@online.de> [ ... ] > Question: I'm not really clear on exactly what python-mode includes. Writing an info is a task to be done still - an entry in the bug tracker exists already. > Does it include all the ropemacs type stuff or do I need to load that as > well? > Yes. BTW, think rope-integration should be delivered in future. > Thanks. From andreas.roehler at online.de Sat Oct 22 08:35:15 2011 From: andreas.roehler at online.de (=?ISO-8859-1?Q?Andreas_R=F6hler?=) Date: Sat, 22 Oct 2011 08:35:15 +0200 Subject: [Python-mode] New to python mode, help! In-Reply-To: <4EA22462.2000406@shaw.ca> References: <4EA171BE.4010402@shaw.ca> <87ty72qx2i.fsf@pobox.com> <4EA18DE0.3050106@shaw.ca> <4EA1A093.40008@online.de> <4EA20F95.1020708@shaw.ca> <4EA22462.2000406@shaw.ca> Message-ID: <4EA26423.5060307@online.de> Am 22.10.2011 04:03, schrieb Gene Horodecki: > > At the risk of being a pest, I thought I would explain how far I have > gotten and what doesn't work for me. Basically the code-completion > doesn't seem to be working. For example: > > import time > mytime = time.cl > > and I get nothing. > > Also, I have read I should be able to do something like, > myfile = open( , > > and get a signature for the open function? Not working either. > > I switched to GNU emacs, and I am using the .el for GNU emacs. I copied > the .el files into ~/.emacs.d/site-lisp. Here is the contents of the > directory: > > #~/.emacs.d/site-lisp$ ls > highlight-indentation.el ido.el pycomplete.el python-mode.el > > Here is the contents of my .emacs file: > > :~$ cat .emacs > (add-to-list 'load-path "~/.emacs.d/site-lisp") > ;; python-mode settings > (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist)) > (setq interpreter-mode-alist(cons '("python" . python-mode) > interpreter-mode-alist)) > ;; path to the python interpreter, e.g.: ~rw/python27/bin/python2.7 > (setq py-python-command "/usr/bin/python2.6") > (autoload 'python-mode "python-mode" "Python editing mode." t) > > ;; pymacs settings > (setq pymacs-python-command py-python-command) > (autoload 'pymacs-load "pymacs" nil t) > (autoload 'pymacs-eval "pymacs" nil t) > (autoload 'pymacs-apply "pymacs") > (autoload 'pymacs-call "pymacs") > > (require 'pycomplete) > > (require 'ido) > (ido-mode t) > > Can anyone help me? Thanks. See https://bugs.launchpad.net/python-mode/+bug/858621 Workaround: make a tags table, open it and use M-x dabbrev-expand resp. its key if you dont have a tags table ready yet, just opening some files with related code delivers a reasonable completion. Cheers From catphive at catphive.net Sat Oct 22 22:24:13 2011 From: catphive at catphive.net (Brendan Miller) Date: Sat, 22 Oct 2011 13:24:13 -0700 Subject: [Python-mode] python.el (from gnu emacs) vs python-mode.el Message-ID: What features does python-mode.el have above the version of python.el that is included in GNU emacs? How do they compare? I recently tried to get ipython.el working, and found it had a dependency on python-mode.el... This has prompted me to wonder what the real differences between these modes are. Does ropemacs work with python-mode.el? From andreas.roehler at online.de Sun Oct 23 09:19:16 2011 From: andreas.roehler at online.de (=?ISO-8859-1?Q?Andreas_R=F6hler?=) Date: Sun, 23 Oct 2011 09:19:16 +0200 Subject: [Python-mode] python.el (from gnu emacs) vs python-mode.el In-Reply-To: References: Message-ID: <4EA3BFF4.3050604@online.de> Am 22.10.2011 22:24, schrieb Brendan Miller: > What features does python-mode.el have above the version of python.el > that is included in GNU emacs? How do they compare? > "M-x py- TAB" displays a buffer with commands implemented by python-mode.el resp. "M-x python-" TAB for python.el As command names are self-explaining, you should get a kind of review that way. as for features provided lately, have a look at the "Announcements"-section at https://launchpad.net/python-mode > I recently tried to get ipython.el working, and found it had a > dependency on python-mode.el... stuff from ipython.el has been merged into python-mode.el Just do M-x ipython This has prompted me to wonder what > the real differences between these modes are. > > Does ropemacs work with python-mode.el? Please put this question in https://answers.launchpad.net/python-mode As other people might have that question too, that will be helpful. Thanks, Andreas -- https://launchpad.net/python-mode https://launchpad.net/s-x-emacs-werkstatt/ > _______________________________________________ > Python-mode mailing list > Python-mode at python.org > http://mail.python.org/mailman/listinfo/python-mode > From Tom_Roche at pobox.com Mon Oct 24 00:15:52 2011 From: Tom_Roche at pobox.com (Tom Roche) Date: Sun, 23 Oct 2011 18:15:52 -0400 Subject: [Python-mode] python.el (from gnu emacs) vs python-mode.el In-Reply-To: References: Message-ID: <87zkgrtkvb.fsf@pobox.com> Brendan Miller Sat, 22 Oct 2011 13:24:13 -0700 > How do [python-mode.el and python.el] compare? This may be irrelevant to you, and may be wrong, but my impression is that 1 the difference between the two that I find most significant is, python-mode.el is under much more active development than python.el. 2 as you note, currently (hopefully not much longer), python.el is officially supported by GNU and python-mode.el is not. My impression regarding that (which again could be horribly wrong) is, this is a remnant of the "Emacs Schism" (see the Emacs wiki for more info), and the fact that python-mode.el originally developed on XEmacs. HTH, Tom Roche , using python-mode.el on GNU Emacs From rinu.matrix at gmail.com Fri Oct 28 04:25:51 2011 From: rinu.matrix at gmail.com (Rinu Boney) Date: Fri, 28 Oct 2011 07:55:51 +0530 Subject: [Python-mode] emacs Message-ID: I Would Love to Know How To Set Up Emacs As A Python Code Editing Environment Using python-mode.el. I Have No Experience in Emacs. Can U Help or Point Out Something That Can Help Me ? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: