{"id":6442,"date":"2017-07-21T11:11:00","date_gmt":"2017-07-21T15:11:00","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=6442"},"modified":"2017-07-21T11:58:51","modified_gmt":"2017-07-21T15:58:51","slug":"john-wiegley-and-sacha-chua-on-use-package","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=6442","title":{"rendered":"John Wiegley and Sacha Chua on <code>use-package<\/code>"},"content":{"rendered":"<p> A couple years ago, John Wiegley and Sacha Chua made a <a href=\"https:\/\/www.youtube.com\/watch?v=2TSKxxYEbII\">video about Wiegley&rsquo;s use-package package<\/a>. I&rsquo;ve mentioned it a couple of times in passing but never written about it. Recently, I stumbled across it again and rewatched it. <\/p>\n<p> There&rsquo;s a lot of interesting material in the video and I decided that even though it&rsquo;s old it was worth writing about. If you aren&rsquo;t already using <code>use-package<\/code>, you should definitely take a look. The package really does make your configuration simpler and more logical. It can even be used to speed up Emacs&rsquo; start time: Wiegley reports that he has over 200 package and his Emacs starts in about a third of a second. <\/p>\n<p> Even if, like me, you&rsquo;re already using <code>use-package<\/code>, there&rsquo;s still a good reason to spend a half hour watching the video. Wiegley discusses some things I didn&rsquo;t know about. First is the <code>macrostep<\/code> package. If you only use it to see exactly what <code>use-package<\/code> is doing, it&rsquo;s worth installing. The <code>use-package<\/code> macro confuses many people. If you watch the video and then expand an invocation of the macro in your configuration, you&rsquo;ll easily understand what&rsquo;s going on. It&rsquo;s really easy to use and if you bind a key sequence to invoke it<sup><a id=\"fnr.1\" class=\"footref\" href=\"#fn.1\">1<\/a><\/sup>, it won&rsquo;t be loaded until you need it. <\/p>\n<p> Another thing I learned is that you can fold the text in a buffer so that any text that starts more than \\(n\\) columns from the left margin isn&rsquo;t shown. Oddly, this is a built in functionality (bound to <kbd>Ctrl<\/kbd>+<kbd>x<\/kbd> <kbd>$<\/kbd>) so you don&rsquo;t need to get anything to use it. <\/p>\n<p> Once you start using <code>use-package<\/code>, you&rsquo;ll automatically pull in <code>bind-key<\/code> so you&rsquo;ll have <code>describe-personal-keybindings<\/code> available. When you invoke it, you&rsquo;ll get a nice list of all the keybindings you&rsquo;ve defined along with what, if anything, they replaced. That can be really handy for organizing your configuration. <\/p>\n<p> Finally, one of the nice things about <code>use-package<\/code> is that you can configure it to record how long it takes to load and configure the packages it loads. That can really be handy for tracking down the hot spots in your configuration load time. It all goes into the <code>*Message*<\/code> buffer so you can ignore it except when you need it. <\/p>\n<p> I really like <code>use-package<\/code> and have converted my entire <code>init.el<\/code> to use it. If you aren&rsquo;t already using it, you should start and the video will go a long way towards convincing you of that. <\/p>\n<p> <b>UPDATE<\/b> <span class=\"timestamp-wrapper\"><span class=\"timestamp\">[2017-07-21 Fri 11:58]<\/span><\/span>: Added link to video. <\/p>\n<div id=\"footnotes\">\n<h2 class=\"footnotes\">Footnotes: <\/h2>\n<div id=\"text-footnotes\">\n<div class=\"footdef\"><sup><a id=\"fn.1\" class=\"footnum\" href=\"#fnr.1\">1<\/a><\/sup> <\/p>\n<div class=\"footpara\">\n<p class=\"footpara\"> Or you can ask <code>use-package<\/code> to delay loading it explicitly. <\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>A couple years ago, John Wiegley and Sacha Chua made a video about Wiegley&rsquo;s use-package package. I&rsquo;ve mentioned it a couple of times in passing but never written about it. Recently, I stumbled across it again and rewatched it. There&rsquo;s &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=6442\">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-6442","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\/6442","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=6442"}],"version-history":[{"count":2,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6442\/revisions"}],"predecessor-version":[{"id":6444,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/6442\/revisions\/6444"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}