From dcdb1ff2aec04056d861c7342826a2183bd7ca6e Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Thu, 24 Nov 2022 21:17:18 +0000 Subject: function to remove checks from successive checkbox lines in markdown --- init.el | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 88aa226..1d7d33a 100644 --- a/init.el +++ b/init.el @@ -224,18 +224,21 @@ Restart works only on graphic display." (setq coding-system-for-read 'utf-8) (setq coding-system-for-write 'utf-8) -;; PACKAGES - -;; markdown mode +;; for markdown mode +;; do this for a region next +(defun mrl/clear-check-single-line (&optional lines) + "Remove the check from LINES number of markdown checkbox lines." + (interactive "p") + (while (> lines 0) + (save-excursion + (beginning-of-line) + (forward-char 3) + (delete-char 1) + (insert-char ?\s)) + (next-line) + (setq lines (- lines 1)))) -(defun mrl/clear-check-single-line () - (interactive) - (save-excursion - (beginning-of-line) - (forward-char 3) - (delete-char 1) - (insert-char ?\s)) - (next-line)) +;; PACKAGES (use-package markdown-mode :ensure t -- cgit v1.2.3