From ea3e2f52ba09acd0d58f4bb398a671d483f3cc15 Mon Sep 17 00:00:00 2001 From: Shane Mulligan Date: Thu, 15 Apr 2021 09:33:24 +1200 Subject: [PATCH] Thu 15 Apr 2021 09:33:24 --- pen-core.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pen-core.el b/pen-core.el index fcd199b6f..c35dc7d09 100644 --- a/pen-core.el +++ b/pen-core.el @@ -6,10 +6,15 @@ (defun pen-preceding-text () (str (buffer-substring (point) (max 1 (- (point) 1000))))) +(defmacro ntimes (n &rest body) + `(dotimes (n ,n) + ,@body)) + (defun pen-surrounding-text (&optional window-line-size) (if (not window-line-size) (setq window-line-size 20)) - (str (buffer-substring (point) (max 1 (- (point) 1000))))) + (str (buffer-substring (- (point) (save-excursion + (dotimes) 10)) (max 1 (- (point) 1000))))) (provide 'pen-core) \ No newline at end of file