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

suggestion: beginning-/end-of-region

Expand Messages
  • Christof Boeckler
    Hi, I wrote two trivial macros that I missed in the standard distribution, maybe they are useful and find their way in the distribution. It s about moving
    Message 1 of 2 , Nov 9, 2005
    • 0 Attachment
      Hi,

      I wrote two trivial macros that I missed in the standard distribution,
      maybe they are useful and find their way in the distribution. It's about
      moving point to the beginning or end of a region.

      define-macro beginning-of-region
      ; is there a region?
      0 show-region
      !if &iseq $result 0
      !abort
      !endif
      ; get line and column numbers
      set-variable #l0 $window-aline
      set-variable #l1 $window-acol
      exchange-point-and-mark
      set-variable #l2 $window-aline
      set-variable #l3 $window-acol
      !if &great #l2 #l0
      ; we're at the end, so get back
      exchange-point-and-mark
      !elif &great #l0 #l2
      ; we're at the beginning, everything is fine
      !else
      ; same line, thus check columns
      !if &great #l3 #l1
      ; we're at the end, so get back
      exchange-point-and-mark
      !endif
      !endif
      !emacro

      define-macro end-of-region
      ; is there a region?
      0 show-region
      !if &iseq $result 0
      !abort
      !endif
      beginning-of-region
      exchange-point-and-mark
      !emacro

      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
      ... Haha, I finally found it: show-region is the solution to my problems ... forget the last mail. Just bloody beginner s thoughts! Gruß / Regards Christof --
      Message 2 of 2 , Nov 9, 2005
      • 0 Attachment
        Christof Boeckler schrieb:
        > I wrote two trivial macros that I missed in the standard distribution,
        > maybe they are useful and find their way in the distribution. It's about
        > moving point to the beginning or end of a region.

        Haha, I finally found it: show-region is the solution to my problems ...
        forget the last mail. Just bloody beginner's thoughts!

        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.