>>> "EB" == Emanuel Berg writes: > tpeplt wrote: >> Emacs 28 added the function ‘replace-string-in-region’. >> >> (defun my-delete-all-whitespace-region (beg end) >> (interactive "r") >> (save-excursion >> (replace-string-in-region " " "" beg end))) > (defun delete-all-whitespace (&optional beg end) > (interactive > (when (use-region-p) > (list (region-beginning) (region-end)) )) > (or beg (setq beg (point-min))) > (or end (setq end (point-max))) > (save-mark-and-excursion > (replace-string-in-region " " "" beg end) )) > A pretty fancy interface to a one-liner function with > hardcoded data :) Right, but well I would only use this function region wide never on the whole buffer. That is why I prefer *(interactive "r")* -- I strongly condemn Hamas heinous atrocities on Israel, especially the despicable pogroms. I strongly condemn Putin's war of aggression against Ukraine. I support to deliver weapons to Ukraine's military. I support the EU and NATO membership of Ukraine. https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/