Function: completion--replace

completion--replace is a byte-compiled function defined in minibuffer.el.gz.

Signature

(completion--replace BEG END NEWTEXT)

Documentation

Replace the buffer text between BEG and END with NEWTEXT.

Moves point to the end of the new text.

Source Code

;; Defined in /usr/src/emacs/lisp/minibuffer.el.gz
(defun completion--replace (beg end newtext)
  "Replace the buffer text between BEG and END with NEWTEXT.
Moves point to the end of the new text."
  ;; The properties on `newtext' include things like the
  ;; `completions-first-difference' face, which we don't want to
  ;; include upon insertion.
  (setq newtext (copy-sequence newtext)) ;Don't modify the arg by side-effect.
  (if minibuffer-allow-text-properties
      ;; If we're preserving properties, then just remove the faces
      ;; and other properties added by the completion machinery.
      (remove-text-properties 0 (length newtext) '(face completion-score)
                              newtext)
    ;; Remove all text properties.
    (set-text-properties 0 (length newtext) nil newtext))
  (replace-region-contents beg end newtext 0.1 nil 'inherit)
  (goto-char (+ beg (length newtext))))