{"id":7314,"date":"2018-07-02T13:48:29","date_gmt":"2018-07-02T17:48:29","guid":{"rendered":"http:\/\/irreal.org\/blog\/?p=7314"},"modified":"2018-07-02T13:48:29","modified_gmt":"2018-07-02T17:48:29","slug":"a-bbedit-challenge","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=7314","title":{"rendered":"A BBEdit Challenge"},"content":{"rendered":"<p> My friend Watts tweets that he thinks <a href=\"http:\/\/www.barebones.com\/products\/bbedit\/index.html\">BBEdit<\/a> has the simplest workflow for doing a search and replace on the files of a directory that do <i>not<\/i> include some term: <\/p>\n<blockquote class=\"twitter-tweet\" data-lang=\"en\">\n<p lang=\"en\" dir=\"ltr\">I\u2019m sure BBEdit isn\u2019t the only editor that can do \u201cfind all text files in this folder that do not contain \u2018foo\u2019 and do a separate multifile search-and-replace within the first search\u2019s result set\u201d in just two operations, but I\u2019d be surprised if any others can do it as easily.<\/p>\n<p>&mdash; Watts Martin (@chipotlecoyote) <a href=\"https:\/\/twitter.com\/chipotlecoyote\/status\/1009221665782423552?ref_src=twsrc%5Etfw\">June 19, 2018<\/a><\/p><\/blockquote>\n<p> <script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script> <\/p>\n<p> I took that as a challenge, of course, and immediately started figuring out how to do it in Emacs. I have a solution that uses two (or arguably 3) simple commands to do the same thing starting from a dired buffer. So the challenge is, how would you do this in Emacs using the minimum number of {commands | keystrokes}<sup><a id=\"fnr.1\" class=\"footref\" href=\"#fn.1\">1<\/a><\/sup>? If you know BBEdit (I don&rsquo;t) is your solution easier\/simpler than the same thing in BBEdit? <\/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\"> Not counting keystrokes for the search term or regular expressions in the search and replace. <\/p>\n<\/div>\n<\/div><\/div>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>My friend Watts tweets that he thinks BBEdit has the simplest workflow for doing a search and replace on the files of a directory that do not include some term: I\u2019m sure BBEdit isn\u2019t the only editor that can do &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=7314\">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-7314","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\/7314","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=7314"}],"version-history":[{"count":1,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7314\/revisions"}],"predecessor-version":[{"id":7315,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/7314\/revisions\/7315"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}