{"id":11655,"date":"2023-09-23T11:40:51","date_gmt":"2023-09-23T15:40:51","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=11655"},"modified":"2023-09-23T11:40:51","modified_gmt":"2023-09-23T15:40:51","slug":"batch-mode","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=11655","title":{"rendered":"Batch Mode"},"content":{"rendered":"<p>If you&rsquo;re an even moderately experienced Emacs user, you probably know about batch mode. You can write a file with some Emacs commands and run it either by calling Emacs on the command line with a <code>--script<\/code> parameter pointing to the file or by adding at <code>#!<\/code> line to the top of the script and running it by calling the script directly.<\/p>\n<p><a href=\"https:\/\/www.youtube.com\/@emacselements\/videos\">Emacs Elements<\/a> has a short <a href=\"https:\/\/www.youtube.com\/watch?v=5Vume2SETNM\">video on batch mode<\/a> that describes a use case I hadn&rsquo;t seen before. The video is only 5 minutes, 45 seconds so you can watch it to get the details but the TL;DR is that you can use batch mode to check a changed <code>init.el<\/code> file for errors.<\/p>\n<p>The idea is that you use batch mode to load the modified <code>init.el<\/code> file. If there are any errors, you get notified but your active Emacs instance is still operable. It&rsquo;s preferable to just restarting Emacs because if there&rsquo;s a disabling error, you still have a working Emacs to correct it. Sure, you could always restart Emacs with a <code>-q<\/code> or <code>-Q<\/code> option but then you don&rsquo;t really have a fully operational Emacs to work with. That happens to me a lot when I have an error in my <code>init.el<\/code>. I can get by, of course, but it&rsquo;s a pain. With Emacs Elements&rsquo; method you still have your familiar and comfortable working environment available.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&rsquo;re an even moderately experienced Emacs user, you probably know about batch mode. You can write a file with some Emacs commands and run it either by calling Emacs on the command line with a &#8211;script parameter pointing to &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=11655\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[18],"class_list":["post-11655","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\/11655","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=11655"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11655\/revisions"}],"predecessor-version":[{"id":11656,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/11655\/revisions\/11656"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}