From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.help Subject: Re: Does one need save-excursion with delete-region Date: Fri, 21 May 2021 22:57:48 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21049"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (darwin) Cc: Help Gnu Emacs To: pauline-galea@gmx.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 21 21:58:25 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lkBHs-0005Cj-2U for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 21 May 2021 21:58:24 +0200 Original-Received: from localhost ([::1]:56136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lkBHr-0004Il-1s for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 21 May 2021 15:58:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkBHO-0004IX-Ml for help-gnu-emacs@gnu.org; Fri, 21 May 2021 15:57:55 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:57405) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lkBHM-0006zH-Bi for help-gnu-emacs@gnu.org; Fri, 21 May 2021 15:57:54 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6A4125C01D1; Fri, 21 May 2021 15:57:51 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 21 May 2021 15:57:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type:content-transfer-encoding; s=fm3; bh= Ewy/F4/ibmvvJUmtflksKjfZke6NR5vqTCJ1xwJzGu8=; b=qFquOI1B4Zp+dMbF eGnmGtp/B9LYgg89h/OTYDhetzzE5yCqgpHGllNegZ2YAsWSP0sMn54/vzpykYrl Is00DjXnj1ITD9SKc1KiJrLzjJqAfP0XjNupmQWxxykfd5p/C1AYfqz4g4yfqPJy ScVoBy1aJoDVMuhbWCEBO9Dt3A446v138ckGvmZuBssSYevUU7swDYSuyongntic 0uUsQNoF3PvgAcxqWy3+nyj/D809W2EYZBa4mcz6ZOGwL8yRURO6fFugKVmjFb4t m/eBnYexw5HnotVNqcD6Hg6ndmH8ueL5QKOFahWkUyoaaNaTkYC8YHDq2cG3OpJI 31yDCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=Ewy/F4/ibmvvJUmtflksKjfZke6NR5vqTCJ1xwJzG u8=; b=cQc5+GaB/02sD7z0TihFpR2NGoHTneQbS/VfES0rYw7BaizubFhb+1bFH FtE9j6zK81g2HIMCx4cXs7fKfEhDBy/WiXBFsgcKMwKCQCyGFxci/Ztz1LfEViul pfm/wIUWQZm/k4x5+kIPaoW9yrvw9wQvexxfuN/y0PuAl46pZPblKxPuHcpurUyl bxrhW60A40H8UDZZbWrjIf+nyq2jAx1v40k2Vv1bTABK/hGPPhRnXtHxnLCag0N6 IznzPB4E0xABJkiZmtfIrUaoe3Eye3EbajhYt3vEzBXS3ua/y0lOVQJK0yuify7n hTzZltqIQsQbAQOBx9KPvAMGQJ0HQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejfedgudegfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffujghffgffkfggtgfgsehtqhertddtreejnecuhfhrohhmpefhihhl ihhpphcuifhunhgsihhnuceofhhguhhnsghinhesfhgrshhtmhgrihhlrdhfmheqnecugg ftrfgrthhtvghrnhepkedvkeduledvtddvleevjeegtedugfdvlefgfeetgfekjeehheev hffgteffiefgnecukfhppeekgedrvddtgedrudelfedruddtieenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehfghhunhgsihhnsehfrghsthhm rghilhdrfhhm X-ME-Proxy: Original-Received: from fgunbin.local (unknown [84.204.193.106]) by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 21 May 2021 15:57:50 -0400 (EDT) In-Reply-To: (pauline-galea@gmx.com's message of "Thu, 20 May 2021 16:02:50 +0200") Mail-Followup-To: pauline-galea@gmx.com, Help Gnu Emacs Received-SPF: pass client-ip=66.111.4.27; envelope-from=fgunbin@fastmail.fm; helo=out3-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:130004 Archived-At: 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 =E2=80=98nil=E2=80=99. If point was i= nside the deleted region, its value afterward is START. Otherwise, point relocates with the surrounding text, as markers do. --8<---------------cut here---------------end--------------->8---