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

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

Re: Does one need save-excursion with delete-region


From: Filipp Gunbin
Subject: Re: Does one need save-excursion with delete-region
Date: Fri, 21 May 2021 22:57:48 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin)

On 20/05/2021 16:02 +0200, pauline-galea@gmx.com wrote:

> Does one need save-excursion with delete-region so that the cursor
> remains at the same position.
>
> (save-excursion (delete-region (point) c))

No:

--8<---------------cut here---------------start------------->8---
 -- Command: delete-region start end
     This command deletes the text between positions START and END in
     the current buffer, and returns ‘nil’.  If point was inside the
     deleted region, its value afterward is START.  Otherwise, point
     relocates with the surrounding text, as markers do.
--8<---------------cut here---------------end--------------->8---



reply via email to

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