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

Re: [jasspa] Regexp problem

Expand Messages
  • Christof Boeckler
    ... I wonder whether that is also written in the documentation, because it seems new to me - although it perfectly works for me ... ... Maybe you have a
    Message 1 of 8 , Oct 29, 2005
    • 0 Attachment
      Jon Green schrieb:
      > The problem is the backslash escape character in a macro script. In a
      > script the escape character is \ so for a single backslash you need two
      > i.e. \\. For a double backslash you actually need 4 i.e. \\\\.

      I wonder whether that is also written in the documentation, because it
      seems new to me - although it perfectly works for me ...

      > So the macro language input of \\\\ enters the regex engine as \\. The
      > regex engine also uses backslash as an escape so \\ => \ as required.

      Maybe you have a similar solution to this problem: in a macro I use
      kill-region
      set-variable #l1 @y
      insert-string #l1

      but it inserts the region I killed two times (doubled).

      > Jon

      Thanks for the help so far!
      Gruß / Regards
      Christof Böckler

      --
      http://home.in.tum.de/~boeckler/ http://www.spiegel.de/zwiebelfisch
      Da sie sich für weise hielten, sind sie zu Narren geworden. Rö 1,22
    • Thomas Hundt
      ... It works correctly for me, inserting only ONE copy of the region: kill-region set-variable #l1 @y insert-string before insert-string #l1 insert-string
      Message 2 of 8 , Oct 29, 2005
      • 0 Attachment
        > Maybe you have a similar solution to this problem: in a macro I use
        > kill-region
        > set-variable #l1 @y
        > insert-string #l1
        >
        > but it inserts the region I killed two times (doubled).

        It works correctly for me, inserting only ONE copy of the region:

        kill-region
        set-variable #l1 @y
        insert-string "before"
        insert-string #l1
        insert-string "after"

        (in fact, it looks to the user like the strings "before" and "after" are
        inserted, and the rest is left alone)

        -Th
      • Christof Boeckler
        ... Hm, now I realized the problem is somewhere else: depending on the way you mark the region it either works or not. It works if you do it the standard way
        Message 3 of 8 , Oct 29, 2005
        • 0 Attachment
          Thomas Hundt schrieb:
          > It works correctly for me, inserting only ONE copy of the region:
          >
          > kill-region
          > set-variable #l1 @y
          > insert-string "before"
          > insert-string #l1
          > insert-string "after"
          >
          > (in fact, it looks to the user like the strings "before" and "after" are
          > inserted, and the rest is left alone)

          Hm, now I realized the problem is somewhere else: depending on the way
          you mark the region it either works or not. It works if you do it the
          standard way (set-mark + move cursor), but it doesn't work properly, if
          you use either the mouse or the MS-ish shift-cursor way.

          I think this problem lays deeper ...

          > -Th

          Gruß / Regards
          Christof

          --
          http://home.in.tum.de/~boeckler/ http://www.spiegel.de/zwiebelfisch
          Da sie sich für weise hielten, sind sie zu Narren geworden. Rö 1,22
        • Christof Boeckler
          ... I consider this to be a serious bug - what do you think? Gruß / Regards Christof -- http://home.in.tum.de/~boeckler/ http://www.spiegel.de/zwiebelfisch Da
          Message 4 of 8 , Nov 8, 2005
          • 0 Attachment
            Christof Boeckler schrieb:
            > Hm, now I realized the problem is somewhere else: depending on the way
            > you mark the region it either works or not. It works if you do it the
            > standard way (set-mark + move cursor), but it doesn't work properly, if
            > you use either the mouse or the MS-ish shift-cursor way.
            >
            > I think this problem lays deeper ...

            I consider this to be a serious bug - what do you think?

            Gruß / Regards
            Christof

            --
            http://home.in.tum.de/~boeckler/ http://www.spiegel.de/zwiebelfisch
            Da sie sich für weise hielten, sind sie zu Narren geworden. Rö 1,22
          Your message has been successfully submitted and would be delivered to recipients shortly.