[Top][All Lists]

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

Re: delete buffer content from the point

From: Philip Kaludercic
Subject: Re: delete buffer content from the point
Date: Tue, 13 Jul 2021 11:44:57 +0000

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.

With the default keys, you could probably do something like

     C-SPC             mark the current position
     M->               go to the end of the buffer
     C-w               kill the region

but if you want to declare your own function

    (defun local/delete-rest-of-buffer ()
      "Delete the buffer contents from the point onwards."
      (delete-region (point) (point-max)))

would probably do the job, without having to append the region to the
kill ring.

> Thanks,
> Luca

        Philip Kaludercic

reply via email to

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