Function: he-substitute-string

he-substitute-string is a byte-compiled function defined in hippie-exp.el.gz.

Signature

(he-substitute-string STR &optional TRANS-CASE)

Source Code

;; Defined in /usr/src/emacs/lisp/hippie-exp.el.gz
;; Substitutes an expansion STR into the correct region (the region
;; initialized with `he-init-string').
;; An optional argument TRANS-CASE means that it is ok to transfer case
;; from the abbreviation to the expansion if that is possible, and is
;; enabled in the buffer.
(defun he-substitute-string (str &optional trans-case)
  (let ((trans-case (and trans-case
			 case-replace
			 case-fold-search))
	(newpos (point-marker))
	(subst ()))
    (goto-char he-string-beg)
    (setq subst (if trans-case (he-transfer-case he-search-string str) str))
    (setq he-tried-table (cons subst he-tried-table))
    (insert subst)
    (delete-region (point) he-string-end)
    (goto-char newpos)))