Skip to content

Commit a1e1ecc

Browse files
pyluytenjrblevin
authored andcommitted
Add markdown-kill-outline and markdown-kill-block
1 parent 5252b71 commit a1e1ecc

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
references (available via `C-c C-c u`). ([GH-322][])
5656
- Add `markdown-insert-table` (`C-c C-s t`) for interactive
5757
table insertion. ([GH-369][])
58+
- Add `markdown-kill-outline` and `markdown-kill-block`
59+
functions.
5860

5961
* Improvements:
6062

markdown-mode.el

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4817,6 +4817,20 @@ text to kill ring), and list items."
48174817
(t
48184818
(user-error "Nothing found at point to kill")))))
48194819

4820+
(defun markdown-kill-outline ()
4821+
"Kill visible heading and add it to `kill-ring'."
4822+
(interactive)
4823+
(save-excursion
4824+
(markdown-outline-previous)
4825+
(kill-region (point) (progn (markdown-outline-next) (point)))))
4826+
4827+
(defun markdown-kill-block ()
4828+
"Kill visible code block, list item, or blockquote and add it to `kill-ring'."
4829+
(interactive)
4830+
(save-excursion
4831+
(markdown-backward-block)
4832+
(kill-region (point) (progn (markdown-forward-block) (point)))))
4833+
48204834

48214835
;;; Indentation ====================================================================
48224836

0 commit comments

Comments
 (0)