[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pymacs
From: |
daniel |
Subject: |
Re: pymacs |
Date: |
Mon, 10 Jun 2013 14:12:13 +0100 |
To put it more simple, the problem is when a python function returns a
elisp symbol back to elisp:
def teste():
symb = lisp.simbolo
OR symb = lisp["simbolo"]
OR symb = lisp("'simbolo")
#str(symb) gives " 'simbolo "
return symb
When the function is invoked from elisp it doesn't return the symbol.
I need this for a python program that creates an emacs menu. And the menu
structure need to have these symbols that are the functions to be called
when an menu item is selected.
2013/6/10 daniel <idnael@gmail.com>
>
>
>
> 2013/6/10 Eric Abrahamsen <eric@ericabrahamsen.net>
>
>>
>> What else do you need to know?
>>
>>
> In Ubuntu it is easy to install Pymacs because it is on the standard
> repository.
>
> The question is about passing values from python and elisp and the
> opposite way.
>
> # A function that receives a elisp variable name and returns it's value:
> from pymacs import lisp
> def tvar(n):
> return lisp[n].value()
>
>
> AND IN ELISP:
>
> (pymacs-load "pymacs_teste")
>
> (setq PTEST "string")
> (pymacs-teste-tvar "PTEST") ;; returns "string" Ok!
>
> (setq PTEST (list 1 2 3))
> (pymacs-teste-tvar "PTEST") ;; returns (lambda (&rest arguments)
> (pymacs-apply (quote (pymacs-python . 4543)) arguments))
>
> When python calls lisp[n].value() it returns a kind of wrapper which works
> well inside python. But if I return it back to elisp, it doesn't work.
>
> If I do instead
> def tvar(n):
> return list( lisp[n].value() )
>
> It works perfectly.
>
> But I don't know what to do if PTEST contains a elisp symbol.
>
>
>
>
>
>
>
- pymacs, daniel, 2013/06/09
- Re: pymacs, andrea crotti, 2013/06/09
- Re: pymacs, daniel, 2013/06/09
- Re: pymacs, Eric Abrahamsen, 2013/06/09
- Re: pymacs, daniel, 2013/06/10
- Re: pymacs,
daniel <=
- Re: pymacs, Eric Abrahamsen, 2013/06/10
- Re: pymacs, daniel, 2013/06/10
- Re: pymacs, Andreas Röhler, 2013/06/10
- Re: pymacs, Kyle Machulis, 2013/06/10
- Re: pymacs, daniel, 2013/06/16
Re: pymacs, Andreas Röhler, 2013/06/10