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

Re: Getting Buffer Information

Expand Messages
  • Gadrin
    ... in the ... you ... yes, I found it about an hour later, buried in one of the on-line samples. I wrote a complete script to grab an FTP folder listing and
    Message 1 of 8 , Sep 9, 2005
      --- In jasspa@yahoogroups.com, Thomas Hundt <thundt@s...> wrote:

      > You'll want to look at the variables like $window-xxx.
      >
      > Notice that $window-line is the line where point (the cursor) is
      in the
      > *buffer* and not where it is in the *window*. To get the latter,
      you
      > must compute $window-line minus $window-y-scroll.
      >
      > Have fun,
      >
      > -Th

      yes, I found it about an hour later, buried in one of the on-line
      samples.

      I wrote a complete script to grab an FTP folder listing and turn all
      the dates in the file to YYYY:MM:DD:HH:MM format (adding 12 to the
      times with AM in them).

      A minor challenge to write the buffer and display the message at the
      end (shell-ed out to delete the existing file first). But it works
      like a charm and very quickly.

      the other issue is concatenating a bunch of variables together which
      either is done in one confusingly long line or many, many set-
      variable statements.

      perhaps I can write a function to concatenate a "list" of vars or
      something. I'll have to see.

      Sorry for the bother, and thanks for your help Thom and Jon.

      PS -- no samples in the FILES section of this site ?
    • Thomas Hundt
      You mean like set-variable #l9 &cat #l1 &cat #l2 &cat #l3 &cat #l4 #l5 or ml-write &cat range is &cat #l7 &cat to &cat #l8 &cat len #l6 Yes, it gets
      Message 2 of 8 , Sep 9, 2005
        You mean like

        set-variable #l9 &cat #l1 &cat #l2 &cat #l3 &cat #l4 #l5

        or

        ml-write &cat "range is " &cat #l7 &cat " to " &cat #l8 &cat " len
        " #l6

        Yes, it gets a little hard to read vs. other languages that use, say, a
        '+', but it's not THAT hard...?

        -Th

        > the other issue is concatenating a bunch of variables together which
        > either is done in one confusingly long line or many, many set-
        > variable statements.
        >
        > perhaps I can write a function to concatenate a "list" of vars or
        > something. I'll have to see.
      • Gadrin
        I code alot in Winbatch which uses x = World ile = I like EMACs. strcat( Hello , x, ile) but I did come across sprintf, which is almost as good. I
        Message 3 of 8 , Sep 9, 2005
          I code alot in Winbatch which uses

          x = "World "
          ile = "I like EMACs."
          strcat("Hello ", x, ile)

          but I did come across sprintf, which is almost as good.

          I suppose I could build my own Strcat @1 @2 @3 ... @n

          boy, I'm very happy with the JASSPA incarnation.

          the find-file/file browser alone is a great feature.


          --- In jasspa@yahoogroups.com, Thomas Hundt <thundt@s...> wrote:
          > You mean like
          >
          > set-variable #l9 &cat #l1 &cat #l2 &cat #l3 &cat #l4 #l5
          >
          > or
          >
          > ml-write &cat "range is " &cat #l7 &cat " to " &cat #l8
          &cat " len
          > " #l6
          >
          > Yes, it gets a little hard to read vs. other languages that use,
          say, a
          > '+', but it's not THAT hard...?
          >
          > -Th
          >
          > > the other issue is concatenating a bunch of variables together
          which
          > > either is done in one confusingly long line or many, many set-
          > > variable statements.
          > >
          > > perhaps I can write a function to concatenate a "list" of vars
          or
          > > something. I'll have to see.
        • Jon Green
          ... Problem with your suggestion is that you need to know when the argument list ends, this would mean that you need a terminator of some description or an
          Message 4 of 8 , Sep 10, 2005
            Gadrin wrote:
            > I code alot in Winbatch which uses
            >
            > x = "World "
            > ile = "I like EMACs."
            > strcat("Hello ", x, ile)
            >
            > but I did come across sprintf, which is almost as good.
            >
            > I suppose I could build my own Strcat @1 @2 @3 ... @n
            >

            Problem with your suggestion is that you need to know when the argument list ends, this
            would mean that you need a terminator of some description or an argument count. &spr like
            you suggest is probably best.

            Jon.
          Your message has been successfully submitted and would be delivered to recipients shortly.