{"id":12641,"date":"2024-12-12T11:02:31","date_gmt":"2024-12-12T16:02:31","guid":{"rendered":"https:\/\/irreal.org\/blog\/?p=12641"},"modified":"2024-12-12T13:27:57","modified_gmt":"2024-12-12T18:27:57","slug":"showing-diff-on-some-buffers","status":"publish","type":"post","link":"https:\/\/irreal.org\/blog\/?p=12641","title":{"rendered":"Showing Diff On Some Buffers"},"content":{"rendered":"<p>\nProtesilaos Stavrou has a post with a really nice tip. Almost all Emacsers know about <code>save-some-buffers<\/code> if only from fat fingering its default binding of <kbd>Ctrl<\/kbd>+<kbd>x<\/kbd> <kbd>s<\/kbd> instead of <code>save buffer<\/code> bound to <kbd>Ctrl<\/kbd>+<kbd>x<\/kbd> <kbd>Ctrl<\/kbd>+<kbd>s<\/kbd>.\n<\/p>\n<p>\nAs Prot says, that&rsquo;s handy but often you&rsquo;re not sure of whether you should save a particular buffer or not. Fortunately, there&rsquo; a command to run a diff against the current buffer and its underlying file. Unfortunately, there&rsquo;s no default way of calling it in the middle of a <code>save-some-buffers<\/code> command.\n<\/p>\n<p>\nOf course, Prot being Prot, he <a href=\"https:\/\/protesilaos.com\/codelog\/2024-12-11-emacs-diff-save-some-buffers\/\">decided to fix that<\/a>. It turns out to be pretty simple. You just need to add another entry to the <code>save-some-buffers-action-alist<\/code>. Take a look at Prot&rsquo;s post for the details. Even if you use this capability only occasionally, it&rsquo;s worth adding the minimal code to your <code>init.el<\/code> to have it available when you need it.\n<\/p>\n<p>\n<b>Update<\/b> <span class=\"timestamp-wrapper\"><span class=\"timestamp\">[2024-12-12 Thu 13:22]<\/span><\/span>: Added link to post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Protesilaos Stavrou has a post with a really nice tip. Almost all Emacsers know about save-some-buffers if only from fat fingering its default binding of Ctrl+x s instead of save buffer bound to Ctrl+x Ctrl+s. As Prot says, that&rsquo;s handy &hellip; <a href=\"https:\/\/irreal.org\/blog\/?p=12641\">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-12641","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\/12641","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=12641"}],"version-history":[{"count":4,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12641\/revisions"}],"predecessor-version":[{"id":12645,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/12641\/revisions\/12645"}],"wp:attachment":[{"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/irreal.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}