Loading ...
Sorry, an error occurred while loading the content.

Client-Server

Expand Messages
  • Gadrin
    I m experimenting with the Client-Server functions in ME on Windows. I m using a scripting language to send the commands via a DOS window, which auto-closes
    Message 1 of 4 , Feb 9, 2006
    • 0 Attachment
      I'm experimenting with the Client-Server functions in ME on Windows.

      I'm using a scripting language to send the commands via a DOS window,
      which auto-closes once the command finishes.

      cd = dirscript()

      comspec = environment("COMSPEC")
      dirchange("C:\Program Files\JASSPA\MicroEmacs")

      cmd = `/c me32.exe -m "C:ME:find-file \"C:/Program
      Files/JASSPA/MicroEmacs/junk.txt\""`
      ;cmd = `/c me32.exe -m "C:ME:ml-write \"Hello world\"`

      run(comspec, cmd)

      dirchange(cd

      unfortunately the commands above don't find-file or ml-write. In both
      instances ME responds (the icon flashes and gets focus) but I get a
      new file called ME:1.

      the ml-write lines opens a new file called "Hello".

      anyone with more experience can give me a hint?
    • Steven Phillips
      Gadrin, When playing around with these things I try to start off small, so I started a new cmd prompt and typed: me32 -m C:ME:ml-write hello What happened
      Message 2 of 4 , Feb 9, 2006
      • 0 Attachment
        Gadrin,

        When playing around with these things I try to start off small, so I started a
        new cmd prompt and typed:

        me32 -m "C:ME:ml-write hello"

        What happened was a bit of a surprise, my server ME printed:

        helloC:ME:2

        on the message line. Having played around a bit I think that the -m server
        option is working but there are 2 serious problems:

        1) To successfully send a command the message must end with a new-line char
        (i.e. a \n char). This is pretty easy on unix but in a windows cmd prompt...
        (I'm sure there must be a way but I haven't found one yet).

        2) Every -m message has the string 'C:ME:2 popup-window\n' appended to make
        the server ME popup the current frame if it is minimized. So the above call to
        me32 actually sent 'C:ME:ml-write helloC:ME:2 popup-window\n' to the server
        (see that hidden *server* buffer) - this additional command makes sense when
        using the -o option to open a file in the server ME, but I do not think this
        should be sent when only the -m option is used.

        So I think the -m option could be improved by:

        1) 'parsing' the message using the macro parser, this would allow the user to
        sent the message:

        C:ME:find-file "my-path\\my-file"\nC:ME:ml-write "hello\tworld"\n

        as one message (i.e. '\\' -> '\', '\n' -> new-line char etc).

        2) If the last char of the <message> is not a \n then add one.

        3) Only send the popup-window command when -o option is used.

        We are looking to create another development release soon, if no one objects
        to the above changes I will try to get them into this release.

        Steve

        > Subject: [jasspa] Client-Server
        > From: Gadrin <gadrin@...>
        > Date: Thursday, February 9, 2006, 4:26:11 PM
        > To: jasspa@yahoogroups.com
        > I'm experimenting with the Client-Server functions in ME on Windows.

        > I'm using a scripting language to send the commands via a DOS window,
        > which auto-closes once the command finishes.

        > cd = dirscript()

        > comspec = environment("COMSPEC")
        > dirchange("C:\Program Files\JASSPA\MicroEmacs")

        > cmd = `/c me32.exe -m "C:ME:find-file \"C:/Program
        > Files/JASSPA/MicroEmacs/junk.txt\""`
        > ;cmd = `/c me32.exe -m "C:ME:ml-write \"Hello world\"`

        > run(comspec, cmd)

        > dirchange(cd

        > unfortunately the commands above don't find-file or ml-write. In both
        > instances ME responds (the icon flashes and gets focus) but I get a
        > new file called ME:1.

        > the ml-write lines opens a new file called "Hello".

        > anyone with more experience can give me a hint?





        > __________________________________________________________________________

        > This is an unmoderated list. JASSPA is not responsible for the content of
        > any material posted to this list.

        > To unsubscribe, send a mail message to

        > mailto:jasspa-unsubscribe@yahoogroups.com

        > or visit http://groups.yahoo.com/group/jasspa and
        > modify your account settings manually.


        >
        > Yahoo! Groups Links



        >
      • Gadrin
        oh beautiful! I m in no hurry, just a babe in the woods compared to you guys and I thought the feature was interesting. I assumed it was something I d
        Message 3 of 4 , Feb 9, 2006
        • 0 Attachment
          oh beautiful!

          I'm in no hurry, just a babe in the woods compared to you guys and I
          thought the feature was interesting. I assumed it was something I'd
          overlooked.

          I was able to do some "hands-off" editing waaay back when I first
          installed it, but it was slightly cumbersome (probably just me) using
          the @ commandline switch. I think I ended up using the normal
          startup .emf and then placed a line inside it to call and execute my
          special macro script, just for testing.

          I'm a big OLE coder, so... <wish list, wish list> which is one of the
          things that got me interested in VIM, but the learning curve was
          ridiculous for that, despite OLE.

          MicroEmacs is a gem even without it.

          Well, give the list a heads-up when you do release and I'll upgrade.

          Thanks for your time.

          --- In jasspa@yahoogroups.com, Steven Phillips <bill@...> wrote:
          >
          > Gadrin,
          >
          > When playing around with these things I try to start off small, so
          I started a
          > new cmd prompt and typed:
          >
          > me32 -m "C:ME:ml-write hello"
          >
          > What happened was a bit of a surprise, my server ME printed:
          >
          > helloC:ME:2
          >
          > on the message line. Having played around a bit I think that the -m
          server
          > option is working but there are 2 serious problems:
          >
          > 1) To successfully send a command the message must end with a new-
          line char
          > (i.e. a \n char). This is pretty easy on unix but in a windows cmd
          prompt...
          > (I'm sure there must be a way but I haven't found one yet).
          >
          > 2) Every -m message has the string 'C:ME:2 popup-window\n' appended
          to make
          > the server ME popup the current frame if it is minimized. So the
          above call to
          > me32 actually sent 'C:ME:ml-write helloC:ME:2 popup-window\n' to
          the server
          > (see that hidden *server* buffer) - this additional command makes
          sense when
          > using the -o option to open a file in the server ME, but I do not
          think this
          > should be sent when only the -m option is used.
          >
          > So I think the -m option could be improved by:
          >
          > 1) 'parsing' the message using the macro parser, this would allow
          the user to
          > sent the message:
          >
          > C:ME:find-file "my-path\\my-file"\nC:ME:ml-
          write "hello\tworld"\n
          >
          > as one message (i.e. '\\' -> '\', '\n' -> new-line char etc).
          >
          > 2) If the last char of the <message> is not a \n then add one.
          >
          > 3) Only send the popup-window command when -o option is used.
          >
          > We are looking to create another development release soon, if no
          one objects
          > to the above changes I will try to get them into this release.
          >
          > Steve
          >
          > > Subject: [jasspa] Client-Server
          > > From: Gadrin <gadrin@...>
          > > Date: Thursday, February 9, 2006, 4:26:11 PM
          > > To: jasspa@yahoogroups.com
          > > I'm experimenting with the Client-Server functions in ME on
          Windows.
          >
          > > I'm using a scripting language to send the commands via a DOS
          window,
          > > which auto-closes once the command finishes.
          >
          > > cd = dirscript()
          >
          > > comspec = environment("COMSPEC")
          > > dirchange("C:\Program Files\JASSPA\MicroEmacs")
          >
          > > cmd = `/c me32.exe -m "C:ME:find-file \"C:/Program
          > > Files/JASSPA/MicroEmacs/junk.txt\""`
          > > ;cmd = `/c me32.exe -m "C:ME:ml-write \"Hello world\"`
          >
          > > run(comspec, cmd)
          >
          > > dirchange(cd
          >
          > > unfortunately the commands above don't find-file or ml-write. In
          both
          > > instances ME responds (the icon flashes and gets focus) but I get
          a
          > > new file called ME:1.
          >
          > > the ml-write lines opens a new file called "Hello".
          >
          > > anyone with more experience can give me a hint?
          >
          >
          >
          >
          >
          > >
          ______________________________________________________________________
          ____
          >
          > > This is an unmoderated list. JASSPA is not responsible for the
          content of
          > > any material posted to this list.
          >
          > > To unsubscribe, send a mail message to
          >
          > > mailto:jasspa-unsubscribe@yahoogroups.com
          >
          > > or visit http://groups.yahoo.com/group/jasspa and
          > > modify your account settings manually.
          >
          >
          > >
          > > Yahoo! Groups Links
          >
          >
          >
          > >
          >
        • Gadrin
          ... write hello tworld n yeah, I tried appending both CRLF and LF separately to the end of the string but no go. ... sounds good ... yes, that d be nice, so
          Message 4 of 4 , Feb 9, 2006
          • 0 Attachment
            --- In jasspa@yahoogroups.com, Steven Phillips <bill@...> wrote:

            > C:ME:find-file "my-path\\my-file"\nC:ME:ml-
            write "hello\tworld"\n

            yeah, I tried appending both CRLF and LF separately to the end of the
            string but no go.

            > 2) If the last char of the <message> is not a \n then add one.

            sounds good

            >
            > 3) Only send the popup-window command when -o option is used.

            yes, that'd be nice, so ME could stay minimized, if the client is
            issuing several commands during a script/session.

            The Client/Server arrangement seems to work even if I hide ME and
            issue commands, then make it visible again, which is nice to know for
            the future.

            Can't Wait!

            Nice work, as always. Gadrin.
          Your message has been successfully submitted and would be delivered to recipients shortly.