Function: c-ml-string-opener-intersects-region

c-ml-string-opener-intersects-region is a byte-compiled function defined in cc-engine.el.gz.

Signature

(c-ml-string-opener-intersects-region &optional START FINISH)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-engine.el.gz
(defun c-ml-string-opener-intersects-region (&optional start finish)
  ;; If any part of the region [START FINISH] is inside an ml-string opener,
  ;; return a dotted list of the start, end and double-quote position of that
  ;; opener.  That list wlll not include any "context characters" before or
  ;; after the opener.  If an opener is found, the match-data will indicate
  ;; it, with (match-string 1) being the entire delimiter, and (match-string
  ;; 2) the "main" double-quote.  Otherwise, the match-data is undefined.
  ;; Both START and FINISH default to point.  FINISH may not be at an earlier
  ;; buffer position than START.
  (let ((here (point)) found)
    (or finish (setq finish (point)))
    (or start (setq start (point)))
    (goto-char (max (- start (1- c-ml-string-max-opener-len)) (point-min)))
    (while
	(and
	 (setq found
	       (search-forward-regexp
		c-ml-string-opener-re
		(min (+ finish (1- c-ml-string-max-opener-len)) (point-max))
		'bound))
	 (<= (match-end 1) start)))
    (prog1
	(and found
	     (< (match-beginning 1) finish)
	     (cons (match-beginning 1)
		   (cons (match-end 1) (match-beginning 2))))
      (goto-char here))))