From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: delete buffer content from the point Date: Tue, 13 Jul 2021 13:40:34 +0200 Message-ID: <87y2aaa14o.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36315"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.13; emacs 28.0.50 Cc: help-gnu-emacs@gnu.org To: Luca Ferrari Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 13 13:47:54 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 1m3GtG-0009Gs-Eu for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 13 Jul 2021 13:47:54 +0200 Original-Received: from localhost ([::1]:54928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3GtF-00024v-Gl for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 13 Jul 2021 07:47:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Gr6-0001Oo-Ks for help-gnu-emacs@gnu.org; Tue, 13 Jul 2021 07:45:40 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56486) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Gr6-0003fI-CU; Tue, 13 Jul 2021 07:45:40 -0400 Original-Received: from auth1-smtp.messagingengine.com ([66.111.4.227]:33545) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3Gqg-0002Q9-H0; Tue, 13 Jul 2021 07:45:17 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id A98B527C0054; Tue, 13 Jul 2021 07:45:13 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 13 Jul 2021 07:45:13 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehgdefhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpehffgfhvffuffgjkfggtgesthdtredttdertdenucfhrhhomhepvfgrshhsihhl ohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpeevve eikeetkeeviefgfeffiedvteeguddvffeuueduveegtddthedvhfeuveffhfenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnodhmvg hsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedvleek qdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Jul 2021 07:45:12 -0400 (EDT) In-reply-to: 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:131675 Archived-At: Luca Ferrari writes: > Is there a short and sweet way to kill the content of the current > buffer from the point to the end of the buffer itself? > I do often duplicate files and adjusts the header part, then I do > 'C-k' until the part of the file I want to delete has disappeared, but > this has the drawback of being slow and inserting a wall of text into > the kill ring. The following should do the trick. Bind it to a key of your liking. --8<---------------cut here---------------start------------->8--- (defun my/delete-from-point-to-end () (interactive) ;; Or kill-region if you want the text in the kill-ring. ;; Maybe (1+ (point)) if you don't want the char at point to be removed. (delete-region (point) (buffer-end 1))) --8<---------------cut here---------------end--------------->8--- Bye, Tassilo