{"id":78484,"date":"2021-07-19T11:48:32","date_gmt":"2021-07-19T15:48:32","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/?p=78484"},"modified":"2021-11-15T14:45:58","modified_gmt":"2021-11-15T19:45:58","slug":"save-keyboard-macros-as-functions","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/","title":{"rendered":"Save Keyboard Macros as Functions in Emacs"},"content":{"rendered":"<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"538\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/07\/Save-Keyboard-Macros-as-Functions-in-Emacs-1024x538.png\" alt=\"Save keyboard macros as functions in Emacs\" class=\"wp-image-78485\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/07\/Save-Keyboard-Macros-as-Functions-in-Emacs-1024x538.png 1024w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/07\/Save-Keyboard-Macros-as-Functions-in-Emacs-300x158.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/07\/Save-Keyboard-Macros-as-Functions-in-Emacs-768x403.png 768w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/07\/Save-Keyboard-Macros-as-Functions-in-Emacs.png 1200w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/figure>\n\n\n\n<p> There will be many instances in which a valuable sequence of commands may need to be repeated an indefinite amount of times.  Instead of endlessly typing and re-typing the same set of commands, you can use keyboard macros in Emacs to record and save those key command sequences as functions that can be called upon later. <\/p>\n\n\n\n<p class=\"alert alert-warning\">Installing and using Emacs is ideal for private hosting but can be used on  <a href=\"https:\/\/www.inmotionhosting.com\/cpanel-hosting\/vps-with-cpanel\">cPanel VPS hosting<\/a> as well.<\/p>\n\n\n\n<p class=\"alert alert-info\">Be sure to first check out our full guide on how to  <a href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/emacs-keyboard-macros\/\">record and playback keyboard macros in Emacs<\/a>.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"#basic-sequence\">The Basic Sequence<\/a>\n<ul>\n<li><a href=\"#keyboard-macros\">Why Use Keyboard Macros?<\/a><\/li>\n<\/ul>\n<\/li><li><a href=\"#name-and-save-macros\">How To Name and Save Keyboard Macros in Emacs<\/a>\n<ul>\n<li><a href=\"#how-name\">How to Name a Keyboard Macro<\/a><\/li>\n<li><a href=\"#optional-binding\">Optional Binding<\/a><\/li>\n<\/ul>\n<\/li><li><a href=\"#loading\">Loading Your Macros as Stored Functions<\/a>\n<ul>\n<li><a href=\"#storage-options\">Storage Options<\/a><\/li>\n<\/ul>\n<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"basic-sequence\">The Basic Sequence<\/h2>\n\n\n\n<p>\nHere is the basic sequence of recording and saving macro definitions:\n<\/p>\n\n\n\n<ol class=\"org-ol wp-block-list\"><li>Find a helpful sequence of keys<\/li><li>Record the sequences with <code>&lt;f3&gt;<\/code><\/li><li>Play the sequence back with <code>&lt;f4&gt;<\/code><\/li><li>If everything works as expected, give the key sequence a name to save it as a function in memory<\/li><li>Optionally, bind the macro (now a function of its own) to a key<\/li><li>Insert the keyboard macro definition into a buffer as Lisp code so you can reload it later<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"keyboard-macros\">Why Use Keyboard Macros?<\/h3>\n\n\n\n<p> Just about everything you do in Emacs involves a sequence of key inputs.  Every time you press a key or combination of keys, different functions run in the background.  This means you can save time and energy by taking key sequences you use frequently and saving them as a new custom function.  Your custom function is basically just a series of key commands. <\/p>\n\n\n\n<p> This is similar to shell scripting.  However, in shell scripting you would use an interpreted language like <code>bash<\/code>, for example, to create a series of commands, loops, pipes, and other constructs to script a kind of shell function that does what you want it to do. <\/p>\n\n\n\n<p>\nWith Emacs, you can use the keyboard macros in a similar fashion, but you don\u2019t have to know much about Lisp code in order to record your function and save it for use later.\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"name-and-save-macros\">How To Name and Save Keyboard Macros in Emacs<\/h2>\n\n\n\n<p>\nNow you have arrived at the important part, understanding how to name and save keyboard macros in Emacs.  Bearing in mind, the naming must be done <i>before<\/i> the saving.  Once you have defined a macro (with <code>&lt;f3&gt;<\/code>) and run it once or several times (with <code>&lt;f4&gt;<\/code>), and decided you want to save it, you\u2019ll start by giving it a name.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-name\">How to Name a Keyboard Macro<\/h3>\n\n\n\n<p>\nTo name a macro, Emacs will use a pre-defined function called <code>kmacro-name-last-macro<\/code>.  This function, as the name suggests, operates on the last macro you defined.  That means the most recent macro in memory, still stored there, will be named by this function.  The function is also bound to <code>C-x C-k n<\/code>.  (Notice, <code>n<\/code> for \u201cname\u201d as a mnemonic hint.)\n<\/p>\n\n\n\n<p> After running the naming function you will be prompted to type in the name of your function in the minibuffer. <\/p>\n\n\n\n<p class=\"alert alert-info\"> Pro tip:  Emacs Lisp allows for the use of namespaces.   This way, you can put in a custom namespace to make sure that your function will not interfere with any predefined function in Emacs.  Namespaces precede function name with some text and a forward slash (<code>\/<\/code>).  For example, if you wanted to use a namespace of \u201cabc\u201d, your custom function would be named something like this: <code>abc\/my-function<\/code>. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"optional-binding\">Optional Binding<\/h3>\n\n\n\n<p>\nYour function is now written into temporary memory.  This is the best time to bind your custom function to a key.  You can do that with the <code>kmacro-bind-to-key<\/code> function, which is also bound to <code>C-x C-k b<\/code>.  Notice, \u201cb\u201d for \u201cbind\u201d  as the mnemonic clue for remembering this function.  When prompted in the minibuffer, you will be asked to input your desired key.\n<\/p>\n\n\n\n<p> Remember, many of the best keys are already used in various keymaps throughout your Emacs system.  So what can you do?  If you already know an available key sequence, you can go ahead and put it here.  If you are inadvertently going to overwrite an existing key sequence, Emacs will warn you. <\/p>\n\n\n\n<p> Here you have a few options.  You can temporarily bind your current macro to an existing set key, knowing that when you close Emacs and open it later the function and key mapping will have been wiped from memory. <\/p>\n\n\n\n<p> Or, you can use the reserved macro key bindings.  Numbers and letters prefixed with <code>C-x C-k<\/code> have been reserved just for macros.  This means you can use numbers 0-9 and letters A-Z (lower and upper case) to store your function.  For example, you can bind your function to <code>C-x C-k 1<\/code>, and in practice that keyboard input would Control-x Control-k followed by the number 1. <\/p>\n\n\n\n<p>\n(You\u2019ll see how to save that function and key binding into permanent memory in the next section.)\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"loading\">Loading Your Macros as Stored Functions<\/h2>\n\n\n\n<p> You have already seen how to record and playback key sequences by defining keyboard macros.  And you have seen how to name and bind those key sequences with function definition.  Everything you have accomplished so far is stored only in the current Emacs session.  But if you close Emacs and open it back up again the previous stored settings will have been flushed from memory.  This is because you created keyboard macros, and named them and bound them to keys, but you did not save your work anywhere permanent. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"storage-options\">Storage Options<\/h3>\n\n\n\n<p>\nThere are many different ways to store your macros for later use.  Basically, you need to store them in a place where they will be run at Emacs startup.  This way, before you start your work, the Emacs Lisp interpreter will have read your function definitions and stored them in memory for use during your Emacs session.\n<\/p>\n\n\n\n<p>\nYou place your keyboard macro into your preferred storage location using an insert function:  \n<\/p>\n\n\n\n<pre id=\"org04ea13b\" class=\"wp-block-preformatted example\">M-x insert-kbd-macro<\/pre>\n\n\n\n<p> This function inserts your keyboard macro as Lisp code.  To insert the keyboard macro with the key binding you selected, you need use a prefix argument with <code>C-u<\/code> (the universal argument).  That would look something like this: <\/p>\n\n\n\n<pre id=\"org3214a09\" class=\"wp-block-preformatted example\">C-u &lt;RET&gt; M-x insert-kbd-macro &lt;RET&gt; &lt;macro name&gt; &lt;RET&gt;<\/pre>\n\n\n\n<p> After running this function, you will see your macro definition (printed out as Lisp code) into whatever buffer you are currently visiting.  To save yourself some time, first visit your preferred storage location file and then run this function. <\/p>\n\n\n\n<p>\nBut where to store your function?\n<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"emacs-init\">The Emacs \u201cInit\u201d File<\/h4>\n\n\n\n<p>\nThe easiest storage location would be your <code>init<\/code> file.  This file\u2019s location depends on how you have Emacs configured.  Emacs will check several different locations for this file.\n<\/p>\n\n\n\n<ul class=\"org-ul wp-block-list\"><li>You may have your init file in your user home directory <code>~\/.emacs<\/code>.  In this case, use that file.<\/li><li>If you have your init file in the <code>\/.emacs.d\/init.el<\/code> file then make sure to use that one instead.<\/li><\/ul>\n\n\n\n<p> These are the various locations of your Emacs configuration file.  You likely know exactly which file to use, but if not you must check and see how your system is configured or ask for help. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"load-file\">Using a \u201cload-file\u201d Function<\/h4>\n\n\n\n<p> The <code>load-file<\/code> function reads a file for input.  This means you can store your keyboard macros in any file you want and load them via a function in your init file. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted src src-elisp\">(load-file FILE)\n<\/pre>\n\n\n\n<p>\nThe <code>load-file<\/code> function accepts any file path as a string.  For example, if you have your functions in a file called \u201cmacros\u201d in your home directory, your load function might look like this:\n<\/p>\n\n\n\n<pre id=\"orgec89203\" class=\"wp-block-preformatted example\">(load-file \"~\/macros\")\n<\/pre>\n\n\n\n<p> Now, when you create, name, and bind a new function, you can visit your macros file and use the insert function to place it there. <\/p>\n\n\n<div class=\"jumbotron\">\r\n<p>If you don\u2019t need cPanel, don't pay for it. Only pay for what you need with our scalable <a href=\"https:\/\/www.inmotionhosting.com\/cloud-vps\">Cloud VPS Hosting<\/a>.<\/p>\r\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>CentOS, Debian, or Ubuntu    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>No Bloatware    <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/design.inmotionhosting.com\/assets\/icons\/standard\/check-blue.svg\" alt=\"check mark\" width=\"24\" height=\"24\" \/>SSH and Root Access<\/p>\r\n<\/div>\n\n\n\n<p class=\"alert alert-info\">Learn more about the differences between <a href=\"https:\/\/www.inmotionhosting.com\/cloud-vs-vps\">cloud vs VPS<\/a> hosting, and why it matters.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There will be many instances in which a valuable sequence of commands may need to be repeated an indefinite amount of times. Instead of endlessly typing and re-typing the same set of commands, you can use keyboard macros in Emacs to record and save those key command sequences as functions that can be called upon<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/\"> Read More ><\/a><\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4396],"tags":[],"class_list":["post-78484","post","type-post","status-publish","format-standard","hentry","category-emacs"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Save Keyboard Macros as Functions in Emacs<\/title>\n<meta name=\"description\" content=\"Now that you know how to define keyboard macros, you can now learn how to store them for later use. Save time and energy in your daily work.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Save Keyboard Macros as Functions in Emacs\" \/>\n<meta property=\"og:description\" content=\"Now that you know how to define keyboard macros, you can now learn how to store them for later use. Save time and energy in your daily work.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-19T15:48:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-15T19:45:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/07\/Save-Keyboard-Macros-as-Functions-in-Emacs.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Christopher Maiorana\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Christopher Maiorana\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/\"},\"author\":{\"name\":\"Christopher Maiorana\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/c6922c56c84e17079fd558e07b7ef72f\"},\"headline\":\"Save Keyboard Macros as Functions in Emacs\",\"datePublished\":\"2021-07-19T15:48:32+00:00\",\"dateModified\":\"2021-11-15T19:45:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/\"},\"wordCount\":1258,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/07\/Save-Keyboard-Macros-as-Functions-in-Emacs-1024x538.png\",\"articleSection\":[\"Emacs\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/\",\"name\":\"Save Keyboard Macros as Functions in Emacs\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/07\/Save-Keyboard-Macros-as-Functions-in-Emacs-1024x538.png\",\"datePublished\":\"2021-07-19T15:48:32+00:00\",\"dateModified\":\"2021-11-15T19:45:58+00:00\",\"description\":\"Now that you know how to define keyboard macros, you can now learn how to store them for later use. Save time and energy in your daily work.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#primaryimage\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/07\/Save-Keyboard-Macros-as-Functions-in-Emacs.png\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/07\/Save-Keyboard-Macros-as-Functions-in-Emacs.png\",\"width\":1200,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Save Keyboard Macros as Functions in Emacs\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/c6922c56c84e17079fd558e07b7ef72f\",\"name\":\"Christopher Maiorana\",\"description\":\"Christopher Maiorana joined the InMotion community team in 2015 and regularly dispenses tips and tricks in the Support Center, Community Q&A, and the InMotion Hosting Blog.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/chris-m-4623144b\/\"],\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/christopherm\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Save Keyboard Macros as Functions in Emacs","description":"Now that you know how to define keyboard macros, you can now learn how to store them for later use. Save time and energy in your daily work.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/","og_locale":"en_US","og_type":"article","og_title":"Save Keyboard Macros as Functions in Emacs","og_description":"Now that you know how to define keyboard macros, you can now learn how to store them for later use. Save time and energy in your daily work.","og_url":"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2021-07-19T15:48:32+00:00","article_modified_time":"2021-11-15T19:45:58+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/07\/Save-Keyboard-Macros-as-Functions-in-Emacs.png","type":"image\/png"}],"author":"Christopher Maiorana","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Christopher Maiorana","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/"},"author":{"name":"Christopher Maiorana","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/c6922c56c84e17079fd558e07b7ef72f"},"headline":"Save Keyboard Macros as Functions in Emacs","datePublished":"2021-07-19T15:48:32+00:00","dateModified":"2021-11-15T19:45:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/"},"wordCount":1258,"commentCount":0,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/07\/Save-Keyboard-Macros-as-Functions-in-Emacs-1024x538.png","articleSection":["Emacs"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/","url":"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/","name":"Save Keyboard Macros as Functions in Emacs","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#primaryimage"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/07\/Save-Keyboard-Macros-as-Functions-in-Emacs-1024x538.png","datePublished":"2021-07-19T15:48:32+00:00","dateModified":"2021-11-15T19:45:58+00:00","description":"Now that you know how to define keyboard macros, you can now learn how to store them for later use. Save time and energy in your daily work.","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#primaryimage","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/07\/Save-Keyboard-Macros-as-Functions-in-Emacs.png","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/07\/Save-Keyboard-Macros-as-Functions-in-Emacs.png","width":1200,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/save-keyboard-macros-as-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"Save Keyboard Macros as Functions in Emacs"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/c6922c56c84e17079fd558e07b7ef72f","name":"Christopher Maiorana","description":"Christopher Maiorana joined the InMotion community team in 2015 and regularly dispenses tips and tricks in the Support Center, Community Q&A, and the InMotion Hosting Blog.","sameAs":["https:\/\/www.linkedin.com\/in\/chris-m-4623144b\/"],"url":"https:\/\/www.inmotionhosting.com\/support\/author\/christopherm\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4396,"name":"Emacs","slug":"emacs","link":"https:\/\/www.inmotionhosting.com\/support\/edu\/emacs\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/78484","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=78484"}],"version-history":[{"count":8,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/78484\/revisions"}],"predecessor-version":[{"id":91618,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/78484\/revisions\/91618"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=78484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=78484"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=78484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}