                   (and (eq dir -1) (eq start pos)))
           (throw 'emc-region-found region))))))
 
+;; (eq cmd 'abc)
+;; (eq cmd 'abc)
+;; (eq cmd 'abc)
+;; (eq cmd 'abc)
+;; (eq cmd 'abc)
+;; (eq cmd 'abc)
+
 (defun emc-refresh-region (region orig)
   "Refresh the visual REGION when point moved from ORIG to current location."
-  (let ((mark (or (and region (emc-get-region-mark region)) orig)))
-    (when region (delete-overlay region))
-    (cond ((and (< mark (point))) (emc-make-region-overlay mark (1+ (point))))
-          ((and (< (point) mark)) (emc-make-region-overlay mark (point)))
+  (let ((mark (emc-get-region-mark region)))
+    (message "mark %s orig %s point %s" mark orig (point))
+    (unless mark (setq mark orig))
+    (cond ((and (eq orig mark) (< (point) mark)) (setq mark (1+ mark)))
+          ((and (< orig mark) (<= mark (point))) (setq mark (1- mark))))
+    (cond ((< mark (point)) (emc-make-region-overlay mark (1+ (point))))
+          ((< (point) mark) (emc-make-region-overlay mark (point)))
           (t (emc-make-region-overlay (point) (1+ (point)))))))
 
 (defun emc-exchange-point-and-mark (region)
   "Exchange point and mark for a fake REGION."
-  (let* ((region (emc-find-region (point)))
-         (mark (emc-get-region-mark region))
+  (let* ((mark (emc-get-region-mark region))
          (point (emc-get-region-point region)))
     (when region
       (let (new-region new-cursor)

            ((or (eq cmd 'evil-inner-paren)
                 (eq cmd 'evil-a-paren))
             ;; TODO try this using evil-with-active-region
             (evil-with-state normal
               (let* ((limits (funcall cmd))
                      (start (nth 0 limits))
                      (end (1- (nth 1 limits))))
                 (goto-char end)
                 (list nil (emc-refresh-region region start)))))
            ((eq repeat-type 'motion)
             (let ((orig (point)))
               (evil-with-state normal
                 (funcall cmd)
                 (list nil (emc-refresh-region region orig)))))
            ((eq cmd 'evil-visual-char) (emc-delete-all-regions))
            (t (message "not implemented"))))))

(defun emc-run-last-command (cursor region)


            (setq emc-cursor-list cursor-list)
            (setq emc-region-list region-list))
          (setq emc-command-info nil)
          ;; (message "AFTER-VISUAL %s" (evil-visual-state-p))
          )))))

;; TODO hooks should not throw errors
(defun emc-add-hooks ()
