Function: thai-find-word-boundaries

thai-find-word-boundaries is a byte-compiled function defined in thai-word.el.gz.

Signature

(thai-find-word-boundaries &optional LIMIT)

Source Code

;; Defined in /usr/src/emacs/lisp/language/thai-word.el.gz
;; Return a list of Thai word boundary positions after the current
;; point.  LIMIT, if non-nil, limits the region to check.

(defun thai-find-word-boundaries (&optional limit)
  (or limit
      (setq limit (point-max)))
  (save-excursion
    (let ((vec (make-vector 3 nil))
	  (boundaries nil)
	  this-limit)
      ;; Loop over all (consecutive) Thai regions by using the
      ;; character property `t' until LIMIT is reached.
      (while (and (< (point) limit)
		  (re-search-forward "\\ct+" nil t))
	(setq this-limit (point))
	(goto-char (match-beginning 0))
	(fillarray vec nil)
	;; Check the first word, initializing VEC.
	(thai-forward-word-update-info vec this-limit)
	;; Then loop over the remaining words in the current Thai
	;; region, collecting the boundaries.
	(while (< (point) this-limit)
	  (setq boundaries (cons (point) boundaries))
	  (thai-forward-word-update-info vec this-limit)))
      boundaries)))