Function: semantic-complete-hack-word-boundaries

semantic-complete-hack-word-boundaries is a byte-compiled function defined in complete.el.gz.

Signature

(semantic-complete-hack-word-boundaries ORIGINAL NEW)

Documentation

Return a string to use for completion.

ORIGINAL is the text in the minibuffer. NEW is the new text to insert into the minibuffer. Within the difference bounds of ORIGINAL and NEW, shorten NEW to the nearest word boundary, and return that.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/complete.el.gz
;;; Completion Functions
;;
;; Thees routines are functional entry points to performing completion.
;;
(defun semantic-complete-hack-word-boundaries (original new)
  "Return a string to use for completion.
ORIGINAL is the text in the minibuffer.
NEW is the new text to insert into the minibuffer.
Within the difference bounds of ORIGINAL and NEW, shorten NEW
to the nearest word boundary, and return that."
  (save-match-data
    (let* ((diff (substring new (length original)))
	   (end (string-match "\\>" diff))
	   (start (string-match "\\<" diff)))
      (cond
       ((and start (> start 0))
	;; If start is greater than 0, include only the new
	;; white-space stuff
	(concat original (substring diff 0 start)))
       (end
	(concat original (substring diff 0 end)))
       (t new)))))