Added strike-region and strike-previos-word.

Pascal J. Bourguignon [2021-04-03 16:11]
Added strike-region and strike-previos-word.
Filename
pjb-emacs.el
diff --git a/pjb-emacs.el b/pjb-emacs.el
index 20add80..153ecfc 100644
--- a/pjb-emacs.el
+++ b/pjb-emacs.el
@@ -2970,8 +2970,28 @@ and converted as such."

 (test/enough-namestring)

+(defun strike-previous-word ()
+  "Strike the previous word."
+  (interactive)
+  (backward-word 1)
+  (while (looking-at "[[:word:]]")
+    (forward-char 1)
+    (insert #x336)))
+
+(defun strike-region (start end)
+  "Strike the whole region."
+  (interactive "r")
+  (let ((stop (make-marker)))
+    (set-marker stop end)
+    (save-excursion
+     (goto-char start)
+     (while (< (point) stop)
+       (forward-char 1)
+       (insert #x336)))))
+
 (provide 'pjb-emacs)

 ;; Local Variables:
 ;; coding: utf-8
 ;; End Variables:
+ -->
ViewGit