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

2158Re: [jasspa] Align Character's macro

Expand Messages
  • Jon Green
    Dec 1, 2006
    • 0 Attachment
      Jeremy Cowgar wrote:
      > Attached below is my align-character macro. It's function is:
      >
      > int rad = 10;
      > int speed = 20;
      > int drag = 3;
      >
      > Set the mark at int rad, move to int drag, Esc-x, align-character,
      > it'll prompt for a character, enter =... The result will be:
      >
      > int rad = 10;
      > int speed = 20;
      > int drag = 3;
      >
      > It aligned the = signs.
      >
      > Now, the macro has a few flaws:
      >
      > #1 If the character you want to align starts on the 1 column, it'll
      > be over looked.
      > #2 If you move too far down, say after int drag, and there is no =
      > sign, it'll abort with a end of buffer error.
      > #3 If you have:
      >
      > int rad = 10;
      > int speed = 20;
      > int drag = 3;
      >
      > and align, it'll align to the furthest = sign, so the result would be:
      >
      > int rad = 10;
      > int speed = 20;
      > int drag = 3;
      >
      > If anyone has any fixes for those items or can make the macro better
      > in any way, I'd appriciate it! Oh! One more thing, I'd like to be
      > able to wrap it in other macros and call it with a parameter but am
      > unsure how to do that yet. i.e.
      >

      Here

      http://www.jasspa.com/development/align.emf

      is a cleaned up version which handles regions properly.
      Not had time to wrap it up for macro calling yet.

      Note called "align-char" rather than "align-character" in keeping with
      the other "-char" commands. Also if you add multiple characters as the
      alignment then any of the characters are aligned vertically.

      Jon.

      > define-macro align-equals
      > align-character "="
      > !emacro
      >
      > Jeremy Cowgar
    • Show all 5 messages in this topic