Function: semantic-symref-list-map-open-hits

semantic-symref-list-map-open-hits is a byte-compiled function defined in list.el.gz.

Signature

(semantic-symref-list-map-open-hits FUNCTION)

Documentation

For every open hit in the symref buffer, perform FUNCTION.

The match-data will be set to a successful hit of the searched for symbol. Return the number of occurrences FUNCTION was operated upon.

Source Code

;; Defined in /usr/src/emacs/lisp/cedet/semantic/symref/list.el.gz
;;; REFACTORING UTILITIES
;;
;; Refactoring tools want to operate on only the "good" stuff the
;; user selected.
(defun semantic-symref-list-map-open-hits (function)
  "For every open hit in the symref buffer, perform FUNCTION.
The `match-data' will be set to a successful hit of the searched for symbol.
Return the number of occurrences FUNCTION was operated upon."

  ;; First Pass in this function - a straight rename.
  ;; Second Pass - Allow context specification based on
  ;;               class members. (Not Done)

  (let ((oldsym (oref (oref semantic-symref-current-results
			    created-by)
		      searchfor))
	(count 0))
    (save-excursion
      (goto-char (point-min))
      (while (not (eobp))
	;; Is this line a "hit" line?
	(let* ((ol (car (overlays-at (1- (point))))) ;; trust this for now
	       (tag (when ol (overlay-get ol 'tag)))
	       (line (when ol (overlay-get ol 'line))))
	  (when line
	    ;; The "line" means we have an open hit.
	    (with-current-buffer (semantic-tag-buffer tag)
	      (goto-char (point-min))
	      (forward-line (1- line))
	      (beginning-of-line)
	      (while (re-search-forward (regexp-quote oldsym) (point-at-eol) t)
		(setq count (1+ count))
		(save-excursion ;; Leave cursor after the matched name.
		  (goto-char (match-beginning 0)) ;; Go to beginning of that sym
		  (funcall function))))))
	;; Go to the next line
	(forward-line 1)
	(end-of-line)))
    count))