Function: html2text-replace-string

html2text-replace-string is a byte-compiled function defined in html2text.el.gz.

Signature

(html2text-replace-string FROM-STRING TO-STRING MIN MAX)

Documentation

Replace FROM-STRING with TO-STRING in region from MIN to MAX.

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/html2text.el.gz
;;
;; </Global variables>
;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;
;; <Utility functions>
;;


(defun html2text-replace-string (from-string to-string min max)
  "Replace FROM-STRING with TO-STRING in region from MIN to MAX."
  (goto-char min)
  (let ((delta (- (string-width to-string) (string-width from-string)))
	(change 0))
    (while (search-forward from-string max t)
      (replace-match to-string)
      (setq change (+ change delta)))
    change))