 	    (message "Duplicated code detection finished!")))))))
 
 
-(defun erl-refactor-duplicated-code-in-directories(node minlines minclones)
-  "Find code clones in the current buffer."
+(defun erl-refactor-duplicated-code-in-dirs(node mintokens minclones)
+  "Find code clones in the directories specified by the search paths."
   (interactive (list (erl-target-node)
 		     (read-string "Minimum number of tokens a code clone should have: ")
 		     (read-string "Minimum number of duplicated times: ")

    (setq line2 (elt reg 2))
    (setq col2  (elt  reg 3))
    (highlight-region line1 (- col1 1) line2  col2 buffer)
    (if (equal (read-char-exclusive) '13)
	(setq regions (cdr regions))
      (setq regions nil))
    )
  (delete-overlay highlight-region-overlay)
  )


  )


;;   ;; (message "Press 'Enter' key to go to the next instance, any other key to exit.")
;;     (let (input (read-event))
;;       (if (equal input 'return)
;; 	  ((setq regions (cdr regions))
;; 	   (message "Press 'Enter' key to go to the next instance, 'Esc' to exit.")
;; 	   )
;; 	(if (equal input 'escape)
;; 	    (setq regions nil)
;; 	  (message "Press 'Enter' key to go to the next instance, 'Esc' to exit.")
;; 	  )
;; 	))
;;     )

(defun highlight-search-results(regions buffer)
  "highlight the found results one by one"
  (while (not (equal regions nil))
