< Return to Video

Emacs Rocks! Episode 05: Macros in style

  • 0:00 - 0:04
    Welcome back to emacs rocks
  • 0:04 - 0:08
    last episode I did this cool stunt
  • 0:09 - 0:12
    but that doesn't work very well for real asserts
  • 0:12 - 0:16
    transpose-words just doesn't cut it
  • 0:16 - 0:18
    so it's time to bring out the *big guns*
  • 0:18 - 0:22
    macros
  • 0:22 - 0:26
    define macro, search for assertEquals
  • 0:26 - 0:28
    and when you do your macros, you have to show some care
  • 0:28 - 0:30
    and use some cool tricks
  • 0:30 - 0:33
    for instance, I can now jump to the opposing paren
  • 0:33 - 0:35
    using ctrl-meta-n
  • 0:35 - 0:38
    back again with ctrl-meta-p
  • 0:38 - 0:44
    okay, I go back and do a reverse search for comma
  • 0:50 - 0:55
    and a reverse search for equals
  • 1:00 - 1:02
    done
  • 1:02 - 1:04
    so since I did that in reverse,
  • 1:04 - 1:06
    it not only works for that long string,
  • 1:06 - 1:09
    but it also works for the array
  • 1:09 - 1:12
    and that's why I did the comma in reverse
  • 1:12 - 1:16
    it also works for my object
  • 1:16 - 1:18
    and my multiline object
  • 1:18 - 1:20
    nice!
  • 1:20 - 1:23
    so if you have some tricks in your back pocket,
  • 1:23 - 1:27
    you can make some really powerful macros
  • 1:29 - 1:30
    that was episode five
  • 1:30 -
    follow me on twitter
Title:
Emacs Rocks! Episode 05: Macros in style
Description:

http://emacsrocks.com - Rocking emacs tricks and tips screencast.

Follow me on twitter: @emacsrocks

more » « less
Video Language:
English
Duration:
01:32
magnarsveen added a translation

English subtitles

Revisions