       (if changed (message-box (format "there are modified buffers: %s" changed))
     (erl-spawn
       (erl-send-rpc node 'wrangler_distel 'tuple_funpar (list current-file-name line-no column-no number erlang-refac-search-paths))
-      (erl-receive (buffer)
+      (erl-receive (buffer line-no column-no)
 	  ((['rex ['badrpc rsn]]
 	    (message "Refactoring failed: %S" rsn))
 	   (['rex ['error rsn]]
 	    (message "Refactoring failed: %s" rsn))
 	   (['rex ['ok refac-rename]]
-	    (with-current-buffer buffer (revert-buffer nil t t))
+	    (with-current-buffer buffer (progn (revert-buffer nil t t)
+					       (goto-char (get-position line-no column-no))))
             (message "Refactoring succeeded!")))))))))
 
 

      (if changed (message-box (format "there are modified buffers: %s" changed))
    (erl-spawn
      (erl-send-rpc node 'wrangler_distel 'rename_fun (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!")))))))))




	(erl-spawn
	  (erl-send-rpc node 'wrangler_distel 'new_macro
			(list current-file-name start-line-no start-col-no end-line-no (- end-col-no 1) name erlang-refac-search-paths))
	  (erl-receive (buffer start-line-no start-col-no)
	      ((['rex ['badrpc rsn]]
		(message "Refactoring failed: %S" rsn))
	       (['rex ['error rsn]]
		(message "Refactoring failed: %s" rsn))
	       (['rex ['ok str]]
		(with-current-buffer buffer (progn (revert-buffer nil t t)
						   (goto-char (get-position start-line-no start-col-no))))
		(message "Refactoring succeeded!")))))))))

(defun erl-refactor-fold-against-macro(node)
