{"id":65,"date":"2008-06-17T13:17:16","date_gmt":"2008-06-17T21:17:16","guid":{"rendered":"http:\/\/www.muzeo.com\/wp\/2008\/06\/17\/xemacs-redoubt\/"},"modified":"2008-06-17T13:17:16","modified_gmt":"2008-06-17T21:17:16","slug":"xemacs-redoubt","status":"publish","type":"post","link":"https:\/\/www.aye0.com\/darmablog\/xemacs-redoubt\/","title":{"rendered":"xemacs redoubt"},"content":{"rendered":"<p>There are so many little and no-so-little programs out there for Mac that enable one to, say, validate a DTD, perform XSL transforms, or even <strong>batch rename some files<\/strong>.  For some reason, I often find myself trying them out (the latest candidates were Editix, Oxygen, Renamer4Mac, etc.).  At the end of the day, I always find myself back in XEmacs, doing the job faster and with less fuss.  On the other hand, (X)Emacs tends to be fairly opaque, and it&#8217;s easy to forget stuff, so:<\/p>\n<p>Since I always forget how to do a batch rename, here&#8217;s how: Select the files you want to rename by marking them in dired (&#8216;m&#8217; or use a regexp), then using the Regexp menu, select Rename&#8230; (or type % R).  Then in the minibuffer, type the &#8216;from&#8217; regexp (^.*$ selects the entire filename), hit return, and then the &#8216;to&#8217; regexp.  For example, <code>% R ^.*$ &lt;ret&gt; x-&amp; &lt;\/ret&gt;&lt;ret&gt;' prepends an<\/code>x-&#8216; to the filenames.<\/p>\n<p>You can also use a grouping construct in a regexp to remember part of the original expression.  For example, by surrounding part of the name in &#40;&#8230;&#41;, we can refer to it later with a n, where the n is the occurrence of the match.  For example, ^x&#40;.<em>&#41;$ <ret> 1 <\/ret><ret> would remove the initial x, and in another slightly more complicated example, ^xx&#40;.<\/ret><\/em>&#41;xx.&#40;.*&#41;$ <ret> 1.2<\/ret><ret> would turn xxfooxx.bar into foo.bar&#8230; Cool, eh?<br \/>\n<\/ret><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are so many little and no-so-little programs out there for Mac that enable one to, say, validate a DTD, perform XSL transforms, or even batch rename some files. For some reason, I often find myself trying them out (the latest candidates were Editix, Oxygen, Renamer4Mac, etc.). At the end of the day, I always&#8230; <a class=\"more-link\" href=\"https:\/\/www.aye0.com\/darmablog\/xemacs-redoubt\/\">Continue reading <span class=\"meta-nav\">&#8594;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,5,7],"tags":[27,35],"class_list":["post-65","post","type-post","status-publish","format-standard","hentry","category-code","category-emacs","category-misc","tag-emacs","tag-mac"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7fNAG-13","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/posts\/65","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/comments?post=65"}],"version-history":[{"count":0,"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/posts\/65\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/categories?post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aye0.com\/darmablog\/wp-json\/wp\/v2\/tags?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}