 ;;;;; it stores the documentation in the symbol 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (defun ojs-find-candidates-from-regexp (regexp doc)
-  (let ((point (point))
-	(prefix "")
-	(limit 10)
-	(i 0)
-	candidate
+  (let (candidate
 	candidates
 	)
     (save-excursion
-      ;; Search backward
-      (goto-char point)
-      (while (and (or (not (integerp limit)) (< i limit))
-		  (re-search-backward regexp nil t))
+      ;; Search forward from the beginning of the file
+      (goto-char 0)
+      (while  (re-search-forward regexp nil t)
 	(setq candidate (match-string-no-properties 1))
 	(unless (member candidate candidates)
 	  (when (and doc candidate)
 	    (put (intern candidate) :document (match-string-no-properties 0)))
 	  (push candidate candidates)
-	  (incf i)))
+	  ))
       ;; Search forward
-      (goto-char (+ point (length prefix)))
-      (while (and (or (not (integerp limit)) (< i limit))
-		  (re-search-forward regexp nil t))
-	(setq candidate (match-string-no-properties 1))
-	(unless (member candidate candidates)
-	  (when (and doc candidate)
-	    (put (intern candidate) :document (match-string-no-properties 0)))
-	  (push candidate candidates)
-	  (incf i)))
-      ;;(message "%s" candidates)
       (nreverse candidates))))
 
 ;;;;; configuration of the hook

(ac-define-source "ojs-methods"
    '((candidates . ojs-methods-ac-candidates)
      (document . ojs-methods-ac-document)
      (symbol . "m")
      (requires . -1)))

(defun ojs-methods-ac-document (symbol)
  (or 

;;;; (:require-patch "")
;;;; HISTORY :
;;;; $Log$
;;;; Revision 3.4  2014/10/31 16:10:14  troche
;;;; * match all items
;;;;
;;;; Revision 3.3  2014/10/31 15:09:55  troche
;;;; * debug
;;;;
