 	    (message "Refactoring failed: %s" rsn))
 	   (['rex ['ok refac-rename]]
 	    (with-current-buffer buffer (revert-buffer nil t t))
-            (message "Refactoring succeeded!")))))))+            (message "Refactoring succeeded!")))))))

  (delete-overlay highlight-region-overlay)
  )

 
 ;; End of modification by H.Li
;;---------------------------------------------------------------------

	    (highlight-search-results regions buffer)
	   (revert-buffer nil t t)
	    (message "Searching finished."))))))))


(defun erl-refactor-fun-to-process (node name)
  "From a function to a process."
  (interactive (list (erl-target-node)
		     (read-string "Process name: ")
		     ))
  (let ((current-file-name (buffer-file-name))
	(line-no           (current-line-no))
        (column-no         (current-column-no))
	(buffer (current-buffer)))       
    (erl-spawn
      (erl-send-rpc node 'wrangler_distel 'fun_to_process (list current-file-name line-no column-no name erlang-refac-search-paths))
      (erl-receive (buffer)
	  ((['rex ['badrpc rsn]]
	    (message "Refactoring failed: %S" rsn))
	   (['rex ['error rsn]]
	    (message "Refactoring failed: %s" rsn))
	   (['rex ['ok modified]]
	    (with-current-buffer buffer
	       (dolist (f modified)
		 (let ((buffer (get-file-buffer f)))
		   (if buffer (with-current-buffer buffer (revert-buffer nil t t))
		     ;;(message-box (format "modified unopened file: %s" f))))))
		     nil))))
	       (message "Refactoring succeeded!")))))))


(defun current-line-no ()
