Re: [Python-mode] py-execute-buffer and CWD

2011-11-02 Thread Andreas Röhler

Am 01.11.2011 22:51, schrieb Georg Brandl:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Am 01.11.2011 22:50, schrieb Andrea Crotti:

On 11/01/2011 08:53 PM, Andreas Röhler wrote:

cd is a shell command

you can't mix that into Emacs Lisp.

BTW ipython shell would understand cd it, but that's another item.

Maybe give a example, what you trying to do, so we can look how to solve
that task.

BTW answered here, as you are not indicating a bug as thought at first
glance. My mistake...


Mm I don't think so: cd is an interactive compiled Lisp function in
`files.el'.

And anyway, I think is quite a bug, because if I run a python script I
should expect that it runs in the same current directory...


I quite agree.

Georg


so follows up here:

https://bugs.launchpad.net/python-mode/+bug/884739
___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode


Re: [Python-mode] py-execute-buffer and CWD

2011-11-02 Thread Andreas Röhler

Am 01.11.2011 23:33, schrieb Andrea Crotti:
[ ... ]

Another partially unrelated thing, I noticed the two following:

(defun py-execute-buffer-no-switch (optional async)
Like `py-execute-buffer', but ignores setting of
`py-shell-switch-buffers-on-execute', output-buffer will being switched
to.

(defun py-execute-buffer-switch (optional async)
Like `py-execute-buffer', but ignores setting of
`py-shell-switch-buffers-on-execute', output-buffer will being switched
to. 

Which
- are different functions but with the same docstring
- are never called from anywhere and not bound to any keys..
So are they useful at all maybe?



The first has a docu bug: must read will _not_ being switched to

maybe change that into: sending buffer remains current.

BTW better keep items apart, if you can...
___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode


[Python-mode] emacs

2011-11-02 Thread Rinu Boney
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.
___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode


Re: [Python-mode] py-execute-buffer and CWD

2011-11-02 Thread Georg Brandl
Am 01.11.2011 21:53, schrieb Andreas Röhler:
 Am 01.11.2011 12:33, schrieb Andrea Crotti:
 While trying to run a script and there is already another *Python*
 buffer open
 for another directory, running the script normally fails if there are some
 relative file paths.

 Apparently the CWD in the *Python* buffer remains the old one, and thus it
 makes sense that Python can't resolve relative paths.

 I tried to add this line in py-execute-buffer but without success,
 any help?

 (cd (file-name-directory (buffer-file-name py-master-file)))
 
 cd is a shell command
 
 you can't mix that into Emacs Lisp.

It's also an elisp function.

(I agree that it's named a bit out-of-consistency with the usual
wordy elisp function names...)

Georg



signature.asc
Description: OpenPGP digital signature
___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode


Re: [Python-mode] emacs

2011-11-02 Thread Andrea Crotti

On 10/28/2011 03:25 AM, Rinu Boney wrote:
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.



I've never seem someone capitalising every word :D
In German they capitalise every noun, that I thought was the maximum,
or maybe is your current editor?

To start
- download emacs
- fire up and follow the tutorial
___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode


Re: [Python-mode] emacs

2011-11-02 Thread Jeff Bauer
Rinu,

Just follow the instructions in python-mode.el:

To install, just drop this file into a directory on your load-path
and byte-compile it.  To set up Emacs to automatically edit files
ending in .py using python-mode, add to your emacs init file
(~/.emacs, ~/.emacs.el, or ~/.emacs.d/init.el) the following code:

(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)

Alternatively, if you want an out-of-the box emacs python
experience, you can try:

  http://gabrielelanaro.github.com/emacs-for-python/

But it's using a home brew python.el version rather than
python-mode.el:

  https://github.com/fgallina/python.el

Jeff Bauer
Rubicon, Inc.


On Fri, Oct 28, 2011 at 07:55:51AM +0530, Rinu Boney wrote:
 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.

___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode


Re: [Python-mode] emacs

2011-11-02 Thread akira

On 10/28/2011 06:25 AM, Rinu Boney wrote:
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 ?


See https://github.com/eschulte/emacs24-starter-kit/


--
akira.
___
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode