{"id":8870,"date":"2020-05-16T11:49:48","date_gmt":"2020-05-16T15:49:48","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=8870"},"modified":"2020-05-16T11:49:48","modified_gmt":"2020-05-16T15:49:48","slug":"emacs-by-macros-6","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=8870","title":{"rendered":"Emacs By Macros 6"},"content":{"rendered":"<p>Sahas Subramanian is back with another excellent episode of learning Emacs through keyboard macros. This video covers <a href=\"https:\/\/www.youtube.com\/watch?v=-Uc948mDp8g&amp;feature=youtu.be\">editing macros<\/a> to correct or change a macro without starting over. If you have a long and complicated macro, that can be a real win.<\/p>\n<p>He begins by showing how you can add some instructions to the last macro by simply calling <code>kmacro-start-macro<\/code> (usually bound to <kbd>Ctrl<\/kbd>+<kbd>x<\/kbd> <kbd>(<\/kbd> or <kbd>F3<\/kbd>) with the universal argument. That can be useful but the real power comes from calling <code>edit-last-kbd-macro<\/code>. That brings up a buffer of the keystroke in the last macro and lets you edit them to correct errors or add or delete keystrokes. The nice thing about <code>edit-last-kbd-macro<\/code> is that there\u2019s nothing to remember other than the name of the command so you can easily use it even though you probably won\u2019t have the opportunity very often.<\/p>\n<p>The video starts with Subramanian using <code>occur<\/code> to locate the function definitions in a C++ file. That\u2019s tricky, of course, so the video provides an amusing real life example of building and correcting complex regular expressions. As I said <a href=\"https:\/\/irreal.org\/blog\/?p=8847\">last time<\/a>, almost everyone watching Subramanian\u2019s videos is going to bring experience with another editor with them so the idea regular expressions will be familiar and the video serves as a partial explanation of Emacs\u2019 regular expression peculiarities.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sahas Subramanian is back with another excellent episode of learning Emacs through keyboard macros. This video covers editing macros to correct or change a macro without starting over. If you have a long and complicated macro, that can be a &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=8870\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18],"class_list":["post-8870","post","type-post","status-publish","format-standard","hentry","category-general","tag-emacs"],"_links":{"self":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8870"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8870\/revisions"}],"predecessor-version":[{"id":8871,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8870\/revisions\/8871"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}