xwem-devel
[Top] [All Lists]

Re: macro help please -- `with-xwem-frame'

From: Steve Youngs <steve@xxxxxxxx>
Subject: Re: macro help please -- `with-xwem-frame'
Date: Tue, 04 Oct 2005 08:33:51 +1000
Organization: The XWEM Project
User-agent: Gnus/5.110004 (No Gnus v0.4) SXEmacs/22.1.3 (BMW, linux)
* Zajcev Evgeny <lg@xxxxxxxx> writes:

  > Steve Youngs <steve@xxxxxxxx> writes:

  >> This is close to what I'm looking for, but not quite there...
  >> 
  >> (defmacro with-xwem-frame (frame &rest body)

[...]

  > It should look like:

  >   (defmacro xwem-with-current-frame (frame &rest body)
  >     `(let ((sv-frame (xwem-frame-selected)))
  >        (xwem-unwind-protect
  >            (progn
  >              (xwem-select-frame ,frame)
  >              ,@body)
  >          (xwem-select-frame sv-frame))))

Looks nice.  I couldn't get it to work.  Admittedly it was _very_ late
last night when I tried.  I _think_ it beeped at me and said something
about a bad something or other.  And another attempt ended in a core
dump. :-(

  > However take a note that if you will do something like:

  >   (xwem-with-current-frame my-cool-frame
  >      (xwem-execute-program "xterm")  ; or (make-frame) for example
  >     )

  > it won't do the job you are expecting it to do, 

Yes, that's what I was figuring.

  > however, there is absolutely cool(hehe) function exists -
  > `xwem-execute-program-expecting' which will do the job if you dont
  > pass non-nil NON-BLOCK parameter.

  > I recommend you to use next construction in order to run client in
  > current window of particular xwem frame:

  >   (xwem-execute-program-expecting "xterm" nil
  >     (list 'expect-win (xwem-win-id (xwem-frame-selwin my-cool-frame))) t)

  > However, of course you can use

  >   (xwem-with-current-frame my-cool-frame
  >     (xwem-execute-program-expecting "xterm"))

This is the one that core dumped on me (I think).

I was hoping I could take advantage of the optional 2nd arg to
`xwem-launch-program', but it didn't work either...

,----[ C-h f xwem-launch-program RET ]
| `xwem-launch-program' is an interactive compiled Lisp function
|   -- loaded from "xwem-launcher"
| (xwem-launch-program CMD &optional ARG)
| 
| Documentation:
| Run CMD program in background.
| If used with prefix ARG (H-u), installs
| expectance on selected window (i.e. when client window performe
| MapWindow, it will be managed to window where expectance setuped
| regardless selected window at map moment.  It is usefull to do so when
| you start application with large start time, such as Mozilla or
| AcrobatReader, and you want continue doing things not wainting untill
| application window maps.
| If used with numeric prefix ARG, then that number specifies how many
| programs to run.
`----

From that, I would expect this to do _exactly_ what Iwant...

(xwem-with-current-frame (xwem-frame-find 'name "somename")
  (xwem-launch-program "xterm" t))

Then there's the problem of, not only making that work, but how the
hell do I do the same for (make-frame)?


-- 
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
|                        In space,                         |
|             No one can hear you rip a stinky             |
|---------------------------------------<steve@xxxxxxxx>---|

Attachment: pgpSyXoC8dg4y.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>