[9fans] Mac p9p snarf buffer - Plan9

This is a discussion on [9fans] Mac p9p snarf buffer - Plan9 ; snarf'ed content is not passed between mac apps and p9p apps. is it a xdarwin problem?...

+ Reply to Thread
Results 1 to 10 of 10

Thread: [9fans] Mac p9p snarf buffer

  1. [9fans] Mac p9p snarf buffer

    snarf'ed content is not passed between mac apps and p9p apps. is it a xdarwin
    problem?


  2. Re: [9fans] Mac p9p snarf buffer

    are you running a current p9p? it didn't used to be, but has been for
    quite some time. there's a program called 'snarfer' that used to be
    needed, but it's not running on my system.

    are you using a window manager other than quartz-wm? if so, you'll
    need to run: 'quartz-wm --only-proxy &' before starting your wm to
    bridge the x11/quartz snarf buffers.
    anthony

  3. Re: [9fans] Mac p9p snarf buffer

    On 5/3/07, Skip Tavakkolian <9nut@9netics.com> wrote:
    > snarf'ed content is not passed between mac apps and p9p apps. is it a xdarwin
    > problem?
    >
    >


    It is if you ask it to be. Use the copy command in X to move the data out.
    Or you can do it automatically; rsc has a program somewhere that runs as
    a daemon doing the copy for you.

    -rob

  4. Re: [9fans] Mac p9p snarf buffer

    > snarf'ed content is not passed between mac apps and p9p apps. is it a xdarwin
    > problem?


    yes, but i fixed it (by writing directly to the apple clipboard) last year.
    if you have a program called $PLAN9/bin/devdraw then you
    should not be having this problem.

    russ


  5. Re: [9fans] Mac p9p snarf buffer

    On 5/3/07, Rob Pike wrote:
    > On 5/3/07, Skip Tavakkolian <9nut@9netics.com> wrote:
    > > snarf'ed content is not passed between mac apps and p9p apps. is it a xdarwin
    > > problem?
    > >
    > >

    >
    > It is if you ask it to be. Use the copy command in X to move the data out.
    > Or you can do it automatically; rsc has a program somewhere that runs as
    > a daemon doing the copy for you.
    >
    > -rob
    >


    When I was using acme all the time, so I'd just select the text I need
    and then Edit it out to "pbcopy".

    Then it's in the clipboard for whatever else should need it.

  6. Re: [9fans] Mac p9p snarf buffer

    The snarf issue that bothers me most these days is that the
    plan9port programs, at least on the mac, don't handle UTF-8
    in the snarf buffer correctly. UTF-8 going out turns into junk;
    going in it turns into question marks.

    -rob

  7. Re: [9fans] Mac p9p snarf buffer

    > if you have a program called $PLAN9/bin/devdraw then you
    > should not be having this problem.


    i do, and i am, pradoxically ☺
    i tried snarfer -v, same result. i'm running xdarwin 1.4a1 (xfree86 4.5.0)


  8. Re: [9fans] Mac p9p snarf buffer

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    - -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    The right answer is for someone motivated (it won't be me until late
    summer, I'm afraid) to take the OS X native drawterm back end and
    drop it into p9p. And maybe fix the couple of bugs left in there
    (changing screen resolution confuses it because the window resize
    routine doesn't block to the plan 9 desktop size, and the wnidow-on-
    top code is borked, making drawterm sit on top of the spotlight
    pulldown, for example).

    Paul

    On May 3, 2007, at 10:52 AM, Rob Pike wrote:

    > The snarf issue that bothers me most these days is that the
    > plan9port programs, at least on the mac, don't handle UTF-8
    > in the snarf buffer correctly. UTF-8 going out turns into junk;
    > going in it turns into question marks.
    >
    > -rob


    - -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.3 (Darwin)

    iD8DBQFGOiVEpJeHo/Fbu1wRAvSHAJ0XuMNcxYwW0JQn25UevrZr84gE2wCglTms
    qTDsRzjsxgmgHMLBAHhhV0w=
    =P3Eo
    - -----END PGP SIGNATURE-----
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.3 (Darwin)

    iD8DBQFGOiVNpJeHo/Fbu1wRAuUaAJ4rzuS5eoo4WvJWf9tESn33plSUMACgjxyV
    SJ7Xdt56CDFJxRyCngvLdss=
    =9npk
    -----END PGP SIGNATURE-----

  9. Re: [9fans] Mac p9p snarf buffer

    On Thu, May 03, 2007 at 10:52:26AM -0700, Rob Pike wrote:
    > The snarf issue that bothers me most these days is that the
    > plan9port programs, at least on the mac, don't handle UTF-8
    > in the snarf buffer correctly. UTF-8 going out turns into junk;
    > going in it turns into question marks.


    Yes, this bothered the hell out of me, too. I fixed my copy of
    devdraw(1) to ask for a UTF8_STRING before a STRING, as suggested by the
    comment, which seems to imply that the extra polling is not worth the
    effort:

    * We should try to go for _x.utf8string instead of XA_STRING,
    * but that would add to the polling.

    I hacked this together in about a minute, so it's not beautiful, but it
    works.

    $PLAN9/src/cmd/devdraw/x11-itrans.c:439:
    prop = 1;
    data = nil;
    XChangeProperty(_x.display, _x.drawable, prop, _x.utf8string, 8, PropModeReplace, (uchar*)"", 0);
    XConvertSelection(_x.display, clipboard, _x.utf8string, prop, _x.drawable,CurrentTime);
    XFlush(_x.display);
    lastlen = 0;
    for(i=0; i<10 || (lastlen!=0 && i<30); i++){
    usleep(100*1000);
    XGetWindowProperty(_x.display, _x.drawable, prop, 0, 0, 0, AnyPropertyType,
    &type, &fmt, &dummy, &len, &data);
    if(lastlen == len && len > 0)
    break;
    lastlen = len;
    }
    if(lastlen == 0) {
    XChangeProperty(_x.display, _x.drawable, prop, XA_STRING, 8, PropModeReplace, (uchar*)"", 0);
    XConvertSelection(_x.display, clipboard, XA_STRING, prop, _x.drawable, CurrentTime);
    XFlush(_x.display);
    lastlen = 0;
    for(i=0; i<10 || (lastlen!=0 && i<30); i++){
    usleep(100*1000);
    XGetWindowProperty(_x.display, _x.drawable, prop, 0, 0, 0, AnyPropertyType,
    &type, &fmt, &dummy, &len, &data);
    if(lastlen == len && len > 0)
    break;
    lastlen = len;
    }
    }
    if(lastlen == 0)
    goto out;

    --
    Kris Maglione


    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.3 (FreeBSD)

    iD8DBQFGOmh1seQZD8Aui4wRAu3CAJoCxfgKlmZSQOidjmwzzl KuQwDxuwCeOfTJ
    tkAAH9ywaPukqsoi5MuujoM=
    =r4ot
    -----END PGP SIGNATURE-----


  10. Re: [9fans] Mac p9p snarf buffer

    > Yes, this bothered the hell out of me, too. I fixed my copy of
    > devdraw(1) to ask for a UTF8_STRING before a STRING, as suggested by the
    > comment, which seems to imply that the extra polling is not worth the
    > effort:


    This is now fixed in the latest CVS,
    as is the other direction (a completely
    different fix, of course).

    Russ

+ Reply to Thread