help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

delete all whitespace (space) in a region


From: Uwe Brauer
Subject: delete all whitespace (space) in a region
Date: Wed, 08 Nov 2023 18:53:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Hi

I have constructs like
$\left[ \left( \partial_{t}\Phi  \right)^{2} -                 \left\vert 
\nabla\Phi \right\vert^{2}   \right]^{\frac{1+K}{2K}}$:

That contain to much ........

So I am looking for a region-wise command deleting all this .. With the result
$\left[\left(\partial_{t}\Phi\right)^{2}-\left\vert 
\nabla\Phi\right\vert^{2}\right]^{\frac{1+K}{2K}}$:

(defun my-delete-all-whitespace-region (beg end)
  (interactive "r")
  (query-replace " " "" nil beg end nil nil))

Seems to be a very simple solution, but maybe too simple?

Any comments?

Uwe Brauer 

--
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 NATO membership of Ukraine.
I support the EU membership of Ukraine.
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]