From bc3230068f968ed85b547c183b1c7016232d84e1 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 19 Aug 2023 02:16:59 +0200 Subject: Remove ‘iota--internal’ and improve docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iota.el | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/iota.el b/iota.el index 0d1c8cc..7d92a61 100644 --- a/iota.el +++ b/iota.el @@ -31,26 +31,27 @@ ;;; Code: (defcustom iota-regexp "\\" - "Regular expression to match substrings that should be replaced with the -accumulator." + "Regular expression to match substrings that should be replaced." :type '(regexp)) (defun iota (start end &optional initial) - "Replace all substrings in the region of START and END that match the regular -expression defined by ‘iota-regexp’ with incrementing integers beginning with -INITIAL or 1 if INITIAL is nil. When called interactively, the universal -argument can be used to specify INITIAL." + "Replace substrings in the region with incrementing integers. + +This function replaces all substrings in the region of START and END that match +the regular expression defined by ‘iota-regexp’ with incrementing integers +beginning with INITIAL or 1 if INITIAL is nil. When called interactively, the +universal argument can be used to specify INITIAL." (interactive "*r\np") - (iota--internal start end initial #'1+)) + (iota-complex start end initial #'1+)) (defun iota-complex (start end &optional initial function) - "Replace all substrings in the region of START and END that match the regular -expression defined by ‘iota-regexp’ with the result of calling FUNCTION with the -argument N which starts at INITIAL and increments by 1 every replacement." - (interactive "*r\nnInitial value: \nxFunction: ") - (iota--internal start end initial function)) + "Replace substrings in the region with the result of FUNCTION on a count. -(defun iota--internal (start end initial function) +This function replaces all substrings in the region of START and END that match +the regular expression defined by ‘iota-regexp’ with the result of calling +FUNCTION with the argument N which starts at INITIAL and increments by 1 every +replacement." + (interactive "*r\nnInitial value: \nxFunction: ") (let ((m1 (make-marker)) (m2 (make-marker)) (initial (or initial 1))) -- cgit v1.2.3