pymacs! :-)

Paul Winkler slinkp23 at yahoo.com
Sat Sep 8 11:51:47 EDT 2001


Thanks Francois, that gives me a good idea how this should work. I
expect to be using pymacs quite a lot!

On Sat, Sep 08, 2001 at 08:50:56AM -0400, François Pinard wrote:
> Thinking a bit more about this, this is a difficult problem, as Emacs
> functions have the concept of user interaction for completing the
> specification of their arguments while being called.  It would be very
> unnatural to Python, trying to retrofit that facility on the Python side.
> Best might be to write another trampoline, like this:
> 
> 
>      (pymacs-load "manglers")
> 
>      (defun break-on-whitespace ()
>        (interactive)
>        (manglers-break-on-whitespace))
> 
>      (global-set-key [f7] 'break-on-whitespace)
> 
> 
> This is a bit more LISP to write, but I hope not too frightening...

Not too bad... it's a small enough chunk that we can just parrot the
examples without worrying so much about what it all means.

One quibble if you do work out how to do this on the Python side. You
had written:

lisp.global_set_key([lisp.f7], lisp.manglers_break_on_whitespace)

So you want to put all the possible keys in the lisp namespace? Seems
messy. And what about key combinations? How would you say something
like 'C-x w'?

I would suggest simply writing them as strings, and the programmer
will have to know the elisp way of naming them. Example:

lisp.global_set_key(['C-x w'], lisp.manglers_break_on_whitespace)


-- 
...................    paul winkler   ....................
custom calendars & printing: http://www.calendargalaxy.com
       A member of ARMS:   http://www.reacharms.com
            home page:  http://www.slinkp.com




More information about the Python-list mailing list