   ;; which buttons are currently pressed?
   (setq acme-mouse-state 'left)
   (mouse-set-mark click)
-  (setq acme-last-command nil)
+  (setq acme-last-command 'none)
   ;; pass to regular click handler
   (mouse-drag-region click))
 

                 (undo)
               (mouse-set-point click)
               (let ((range (mouse-start-end (mark) (point) mouse-selection-click-count)))
                 (set-mark (car range))
                 (goto-char (nth 1 range))
                 (kill-region (mark) (point))))
             (setq acme-last-command 'cut))))


  (if (eq acme-mouse-state 'left)
      (progn
        (setq acme-mouse-state 'left-right)
        (case acme-last-command
          ('none (mouse-set-point click)
                 (let ((range (mouse-start-end (mark) (point) mouse-selection-click-count)))
                   (setq acme-start (car range))
                   (setq acme-end (nth 1 range))
                   (set-mark acme-start)
                   (goto-char acme-end)
                   (delete-region (mark) (point))
                   (yank arg)))
          ('cut (undo)
                (set-mark acme-start)
                (goto-char acme-end)))
        (setq acme-last-command 'paste)
        (setq deactivate-mark nil)
        (exchange-point-and-mark))))
