 	  (cur-point (point)))      
 ;;      (condition-case err
 	  (while (< (point) (point-max))
-	    (let ((next-function (re-search-forward *pjs-start-block-regexp* nil t)))
+	    (let ((next-function (re-real-search-forward *pjs-start-block-regexp* nil t)))
 	      (if next-function
 		  (let* ((start-inter cur-point)
 			 (end-inter (1- (line-beginning-position)))


(defface pjs-semantic-error-font
    '((t 
       :underline (:color "red" :style wave)))
    "Underline parser errors in red waves"
    )

(defvar pjs-semantic-error-font
  'pjs-semantic-error-font)

;; we cache the last result for each region
(defun pjs-semantic-parse-region-1 (start end &optional nonterminal depth returnonerror)

	(if error
	    (error "error reading return value: %s" string)
	  (fi::handle-lep-input process form))))))


;; patched from c:/Program Files (x86)/GNU Emacs 24.5/share/emacs/24.5/lisp/cedet/semantic/edit.el
;; do not return tags we don't want to parse on their own
(defun semantic-edits-change-leaf-tag (change)
  "A leaf tag which completely encompasses CHANGE.
If change overlaps a tag, but is not encompassed in it, return nil.
Use `semantic-edits-change-overlap-leaf-tag'.
If CHANGE is completely encompassed in a tag, but overlaps sub-tags,
return nil."
  (let* ((start (semantic-edits-os change))
	 (end (semantic-edits-oe change))
	 (tags (nreverse
		  (semantic-find-tag-by-overlay-in-region
		   start end))))
    
    (while (and tags
		(semantic--tag-get-property (car tags) 'no-single-reparse))
      (setq tags (cdr tags)))
    
    ;; A leaf is always first in this list
    (if (and tags
	     (<= (semantic-tag-start (car tags)) start)
	     (> (semantic-tag-end (car tags)) end))
	;; Ok, we have a match.  If this tag has children,
	;; we have to do more tests.
	(let ((chil (semantic-tag-components (car tags))))
	  (if (not chil)
	      ;; Simple leaf.
	      (car tags)
	    ;; For this type, we say that we encompass it if the
	    ;; change occurs outside the range of the children.
	    (if (or (not (semantic-tag-with-position-p (car chil)))
		    (> start (semantic-tag-end (nth (1- (length chil)) chil)))
		    (< end (semantic-tag-start (car chil))))
		;; We have modifications to the definition of this parent
		;; so we have to reparse the whole thing.
		(car tags)
	      ;; We actually modified an area between some children.
	      ;; This means we should return nil, as that case is
	      ;; calculated by someone else.
	      nil)))
      nil)))
