help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some frameworks smartness


From: Andrea Crotti
Subject: Re: Some frameworks smartness
Date: Mon, 02 Aug 2010 20:02:24 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (darwin)

Andrea Crotti <andrea.crotti.0@gmail.com> writes:

> I'm working with turbogears and thinking that it could be much more
> simple.
>
> I tend to forget after a while I don't use the various commands I have
> to give (python setup.py update-catalog... etc) so I really think that
> emacs could come into help.
>
> I didn't find any useful packages about this or any framework in
> general, but I can do it myself maybe.
>
> Before I do maybe you have some advices or some hints on something
> already done...
> Thanks

Reading this nice article [fn:1] I started to write something.
First we have to activate the correct python executable, so

--8<---------------cut here---------------start------------->8---
(require 'python-mode)

(defun virtual-set-interpreter ()
  (interactive)
  (let
      ((interpreter (expand-file-name "bin/python")))
    (if 
        (file-exists-p "bin/python")
        (progn
          (message "setting the local interpreter")
          (setq py-python-command interpreter))
      (message "not found"))))

(defun virtual-deactivate ()
  (interactive)
  (message "deactivate the environment")
  (py-toggle-shells 1))

(provide 'virtual)
--8<---------------cut here---------------end--------------->8---

Even though I'm not sure is a good idea to change globally the python
interpreter.
On other buffers I still maybe would like to use the default cython, how
can it be done in a less intrusive way?

Then maybe I have to setup the exec path also and some commands which
are shortcuts for the various operations normally done...

Footnotes:

[fn:1] 
http://jesselegg.com/archives/2010/03/14/emacs-python-programmers-2-virtualenv-ipython-daemon-mode/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]