Function: rst-convert-bullets-to-enumeration
rst-convert-bullets-to-enumeration is an interactive and byte-compiled
function defined in rst.el.gz.
Signature
(rst-convert-bullets-to-enumeration BEG END)
Documentation
Convert the bulleted and enumerated items in the region to enumerated lists.
Renumber as necessary. Region is from BEG to END.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/rst.el.gz
;; FIXME: Does not deal with a varying number of digits appropriately.
;; FIXME: Does not deal with multiple levels independently.
;; FIXME: Does not indent a multiline item correctly.
(defun rst-convert-bullets-to-enumeration (beg end)
"Convert the bulleted and enumerated items in the region to enumerated lists.
Renumber as necessary. Region is from BEG to END."
(interactive "r")
(let ((count 1))
(save-match-data
(save-excursion
(dolist (marker (mapcar
(cl-function
(lambda ((pnt &rest clm))
(copy-marker pnt)))
(rst-find-begs beg end 'itmany-beg-1)))
(set-marker
(goto-char marker) nil)
(looking-at (rst-re 'itmany-beg-1))
(replace-match (format "%d." count) nil nil nil 1)
(incf count))))))