Function: rst-replace-lines

rst-replace-lines is an interactive and byte-compiled function defined in rst.el.gz.

Signature

(rst-replace-lines FROMCHAR TOCHAR)

Documentation

Replace flush-left lines of FROMCHAR with equal-length lines of TOCHAR.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/rst.el.gz
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Convenience functions

;; FIXME: Unbound command - should be bound or removed.
(defun rst-replace-lines (fromchar tochar)
  "Replace flush-left lines of FROMCHAR with equal-length lines of TOCHAR."
  (interactive "\
cSearch for flush-left lines of char:
cand replace with char: ")
  (save-excursion
    (let ((searchre (rst-re "^" fromchar "+\\( *\\)$"))
          (found 0))
      (while (search-forward-regexp searchre nil t)
        (setq found (1+ found))
        (goto-char (match-beginning 1))
        (let ((width (current-column)))
          (rst-delete-entire-line 0)
          (insert-char tochar width)))
      (message "%d lines replaced." found))))