anchor.diff:      ;;;;;;;;;; Basic codemirror-related predicates and getters
       ;;;;;;;;;;;;;;;
       ;; TODO fix and test these predicates
  -    (defun at-beginning? (mirror &key ls)
  +    (defun at-beginning? (mirror &key (ls (lines (mirror-contents mirror))))
         (with-slots (line ch) (get-cur :right mirror)
  -	  (and (>= 0 line) (>= -1 ch))))
  +	  (and (>= 0 line) (>= 0 ch))))
       (defun at-end? (mirror &key (ls (lines (mirror-contents mirror))))
         (with-slots (line ch) (get-cur :right mirror)
   	(and (>= line (- (length ls) 1))
   	     ;; the line length doesn't include newline
   	     ;; so we don't subtract one here
   	     (>= ch (length (last ls))))))
  +    (defun at-empty-line? (mirror &key (ls (lines (mirror-contents mirror))))
  +      (with-slots (line ch) (get-cur :right mirror)
  +	(= 0 (length (aref ls line)))))
   
       (defun mirror-contents (mirror)
         (chain mirror (get-value)))
  
positive.code: 		 (skip-to direction mirror (+ " " other-paren) :ls ls))))))
  
      (defun forward-sexp (mirror)
        (go-sexp :right mirror))
      (defun backward-sexp (mirror) 
        (go-sexp :left mirror))
  
      (defun kill-forward-sexp (mirror))
      (defun kill-backward-sexp (mirror))
  
negative.code: 		     (case direction
  		       (:left "goCharLeft")
  		       (:right "goCharRight")))))
  
      (defun go-line (direction mirror)
        (chain mirror (exec-command
  		     (case direction
  		       (:up "goLineUp")
  		       (:down "goLineDown")))))
      
      (defun char-at-cursor (direction mirror &key (ls (lines (mirror-contents mirror))))
        (with-slots (line ch) (get-cur direction mirror)
  