Function: srecode-in-macro-p

srecode-in-macro-p is a byte-compiled function defined in srt-mode.el.gz.

Signature

(srecode-in-macro-p &optional POINT)

Documentation

Non-nil if POINT is inside a macro bounds.

If the ESCAPE_START and END are different sequences, a simple search is used. If ESCAPE_START and END are the same characters, start at the beginning of the line, and find out how many occur.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/srecode/srt-mode.el.gz
;;; Local Context Parsing.

(defun srecode-in-macro-p (&optional point)
  "Non-nil if POINT is inside a macro bounds.
If the ESCAPE_START and END are different sequences,
a simple search is used.  If ESCAPE_START and END are the same
characters, start at the beginning of the line, and find out
how many occur."
  (let ((tag (semantic-current-tag))
	(es (regexp-quote (srecode-template-get-escape-start)))
	(ee (regexp-quote (srecode-template-get-escape-end)))
	(start (or point (point)))
	)
    (when (and tag (semantic-tag-of-class-p tag 'function))
      (if (string= es ee)
	  (save-excursion
	    (beginning-of-line)
	    (while (re-search-forward es start t 2))
	    (if (re-search-forward es start t)
		;; If there is a single, the answer is yes.
		t
	      ;; If there wasn't another, then the answer is no.
	      nil)
	    )
	;; ES And EE are not the same.
	(save-excursion
	  (and (re-search-backward es (semantic-tag-start tag) t)
	       (>= (or (re-search-forward ee (semantic-tag-end tag) t)
		       ;; No end match means an incomplete macro.
		       start)
		  start)))
	))))