{"id":7469,"date":"2018-09-10T13:25:54","date_gmt":"2018-09-10T17:25:54","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=7469"},"modified":"2018-09-10T13:25:54","modified_gmt":"2018-09-10T17:25:54","slug":"displaying-alerts-from-eshell","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=7469","title":{"rendered":"Displaying Alerts from Eshell"},"content":{"rendered":"<p>\nJ\u00fcrgen H\u00f6tzel has a nice post on solving a problem many of us have. Suppose you start a long running process\u2014a make, say\u2014from Eshell and then go on to do other work. It&rsquo;s easy to lose track of the process because the original buffer may be buried and nothing might happen for a long time. H\u00f6tzel wants to be <a href=\"https:\/\/blog.hoetzel.info\/post\/eshell-notifications\/\">notified when the process completes or if it terminates abnormally<\/a>.\n<\/p>\n<p>\nIt turns out to be absurdly easy to do that by leveraging John Wiegley&rsquo;s <a href=\"https:\/\/github.com\/jwiegley\/alert\/blob\/master\/alert.el\">alert<\/a> package. H\u00f6tzel has the alert set up to show in the minibuffer but the alert package supports many different styles of alerts. For example, if you&rsquo;re a Mac user and have Growl installed, you can send the alert to Growl. Another nice feature of the alert package is that you can add rules to filter the alerts. For example, H\u00f6tzel added a rule to not display the alert if the original buffer is visible. That helps cut down on noise.\n<\/p>\n<p>\nH\u00f6tzel triggers his alerts by hooking into the <code>eshell-kill-hook<\/code> but it&rsquo;s easy to see how you could generate many other types of alerts either by using other hooks. Take a look at H\u00f6tzel&rsquo;s code; it&rsquo;s very minimal and simple and mostly decides whether the alert should have &ldquo;normal&rdquo; status (when the process terminate normally) or &ldquo;urgent&rdquo; status (when the process terminates abnormally).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>J\u00fcrgen H\u00f6tzel has a nice post on solving a problem many of us have. Suppose you start a long running process\u2014a make, say\u2014from Eshell and then go on to do other work. It&rsquo;s easy to lose track of the process &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=7469\">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-7469","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\/7469","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=7469"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7469\/revisions"}],"predecessor-version":[{"id":7470,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7469\/revisions\/7470"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7469"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7469"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7469"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}