Emacs: Delete Text Block
Here's a convenient command to delete/kill current text block (aka paragraph).
Call it again to delete next one, or hold a key to keep deleting.
Be sure to give it a key. [see Emacs: How to Define Keys]
(defun xah-delete-current-text-block () "Delete the current text block or selection, and copy to `kill-ring'. A “block” is text between blank lines. URL `http://ergoemacs.org/emacs/emacs_delete_block.html' Version 2017-07-09" (interactive) (let ($p1 $p2) (if (use-region-p) (setq $p1 (region-beginning) $p2 (region-end)) (progn (if (re-search-backward "\n[ \t]*\n+" nil "move") (progn (re-search-forward "\n[ \t]*\n+") (setq $p1 (point))) (setq $p1 (point))) (re-search-forward "\n[ \t]*\n" nil "move") (setq $p2 (point)))) (kill-region $p1 $p2)))
Enhanced Editing Commands Topic
- Select Line, between Quotes, Extend Selection
- Copy/Cut Current Line If No Selection
- Copy/Cut All or Selection
- Paste or Paste Previous
- Delete Whitespace around Cursor
- Move Cursor to Beginning of Line/Paragraph
- Move Cursor by Text Block
- Move Cursor to Bracket/Quote
- Move Cursor to Punctuation
- Delete Text Block
- Toggle Comment Current Line
- Insert Date Time
Working with Brackets
If you have a question, put $5 at patreon and message me.