anchor.diff:      (unless (next-char 1)
         (return))))
   
  -(defun skip-chars-backward (pred &optional not-p)
  -  (do ()
  -      ((if (funcall pred (preceding-char))
  -         not-p
  -         (not not-p))
  -       t)
  -    (unless (prev-char 1)
  -      (return))))
  -
   (defun skip-space-forward ()
     (skip-chars-forward 'syntax-space-char-p))
   
   (defun skip-space-backward ()
     (skip-chars-backward 'syntax-space-char-p))
   
  -(defun two-preceding-char ()
  -  (when (prev-char 1)
  -    (prog1 (preceding-char)
  -      (next-char 1))))
  +(defun skip-until-open-paren-forward ()
  +  (skip-chars-forward 'syntax-open-paren-char-p t))
   
  -(defun three-preceding-char ()
  -  (when (prev-char 2)
  -    (prog1 (preceding-char)
  -      (next-char 2))))
  +(defun skip-until-closed-paren-backward ()
  +  (skip-chars-backward 'syntax-closed-paren-char-p t))
  +
  +(define-dir-functions (forward-list-1 backward-list-1) ()
  +  ((skip-until-open-paren-forward skip-until-closed-paren-backward)
  +   (following-char preceding-char)
  +   (syntax-pair-closed-paren syntax-pair-open-paren)
  +   (preceding-char char-before-2)
  +   (char-before-2 char-before-3)
  +   (forward-list-1 backward-list-1)
  +   (prev-char next-char)
  +   (next-char prev-char)
  +   (skip-string-forward skip-string-backward))
  +  (skip-until-open-paren-forward)
  +  (let* ((paren-char (following-char))
  +         (goal-char (syntax-pair-closed-paren paren-char)))
  +    (do () (nil)
  +        (unless (next-char 1)
  +          (return))
  +      (unless (and (syntax-escape-char-p (preceding-char))
  +                (not (syntax-escape-char-p (char-before-2))))
  +        (let ((c (following-char)))
  +          (cond
  +           ((eql c paren-char)
  +            (forward-list-1)
  +            (prev-char 1))
  +           ((eql c goal-char)
  +            (next-char 1)
  +            (return t))
  +           ((syntax-string-quote-char-p c)
  +            (skip-string-forward)
  +            (prev-char 1))))))))
   
   (define-key *global-keymap* "M-C-n" 'forward-list)
  -(defcommand forward-list (&optional (n 1)) ("p")
  +(defcommand forward-list (n) ("p")
     (dotimes (_ n t)
  -    (skip-chars-forward 'syntax-open-paren-char-p t)
  -    (let* ((paren-char (following-char))
  -           (goal-char (syntax-pair-closed-paren paren-char)))
  -      (do () (nil)
  -        (unless (next-char 1)
  -          (return))
  -        (unless (and (syntax-escape-char-p (preceding-char))
  -                     (not (syntax-escape-char-p (two-preceding-char))))
  -          (let ((c (following-char)))
  -            (cond
  -             ((char= c paren-char)
  -              (forward-list)
  -              (prev-char 1))
  -             ((char= c goal-char)
  -              (next-char 1)
  -              (return t))
  -             ((syntax-string-quote-char-p c)
  -              (skip-string-forward)
  -              (prev-char 1)))))))))
  +    (unless (forward-list-1)
  +      (return))))
   
   (define-key *global-keymap* "M-C-p" 'backward-list)
  -(defcommand backward-list (&optional (n 1)) ("p")
  +(defcommand backward-list (n) ("p")
     (dotimes (_ n t)
  -    (skip-chars-backward 'syntax-closed-paren-char-p t)
  -    (let* ((paren-char (preceding-char))
  -           (goal-char (syntax-pair-open-paren paren-char)))
  -      (do () (nil)
  -        (unless (prev-char 1)
  -          (return))
  -        (unless (and (syntax-escape-char-p (two-preceding-char))
  -                     (not (syntax-escape-char-p (three-preceding-char))))
  -          (let ((c (preceding-char)))
  -            (cond
  -             ((char= c paren-char)
  -              (backward-list)
  -              (next-char 1))
  -             ((char= c goal-char)
  -              (prev-char 1)
  -              (return t))
  -             ((syntax-string-quote-char-p c)
  -              (skip-string-backward)
  -              (next-char 1)))))))))
  +    (unless (backward-list-1)
  +      (return))))
   
  -(defun skip-string-forward ()
  +(define-dir-functions (skip-string-forward skip-string-backward) ()
  +  ((skip-chars-forward skip-chars-backward)
  +   (following-char preceding-char)
  +   (next-char prev-char)
  +   (preceding-char char-before-2)
  +   (char-before-2 char-before-3))
     (skip-chars-forward 'syntax-string-quote-char-p t)
     (let ((goal-char (following-char)))
       (do () (nil)
         (unless (next-char 1)
           (return))
         (unless (and (syntax-escape-char-p (preceding-char))
  -                   (not (syntax-escape-char-p (two-preceding-char))))
  -        (when (char= (following-char) goal-char)
  +                   (not (syntax-escape-char-p (char-before-2))))
  +        (when (eql (following-char) goal-char)
             (next-char 1)
             (return t))))))
   
  -(defun skip-string-backward ()
  -  (skip-chars-backward 'syntax-string-quote-char-p t)
  -  (let ((goal-char (preceding-char)))
  -    (do () (nil)
  -      (unless (prev-char 1)
  -        (return))
  -      (unless (and (syntax-escape-char-p (two-preceding-char))
  -                   (not (syntax-escape-char-p (three-preceding-char))))
  -        (when (char= (preceding-char) goal-char)
  -          (prev-char 1)
  -          (return t))))))
  -
  -(defun skip-symbol-forward ()
  +(define-dir-functions (skip-symbol-forward skip-symbol-backward) ()
  +  ((next-char prev-char)
  +   (following-char preceding-char)
  +   (preceding-char char-before-2)
  +   (char-before-2 char-before-3))
     (do () (nil)
       (unless (next-char 1)
         (return))
  
positive.code:       (cond
         ((and
           (syntax-escape-char-p (preceding-char))
           (not (syntax-escape-char-p (two-preceding-char)))))
         ((not
           (or
            (syntax-escape-char-p c)
  
negative.code:           (syntax-word-char-p c)))
          (return t))))))
  
  (define-dir-functions (%forward-sexp %backward-sexp) ()
    ((skip-space-forward skip-space-backward)
     (syntax-open-paren-char-p syntax-closed-paren-char-p)
     (syntax-closed-paren-char-p syntax-open-paren-char-p)
     (following-char preceding-char)
     (preceding-char char-before-2)
     (char-before-2 char-before-3)
     (forward-list-1 backward-list-1)
     (skip-string-forward skip-string-backward)
     (skip-symbol-forward skip-symbol-backward))
    (skip-space-forward)
    (let ((c (following-char)))
      (when (and
             (syntax-escape-char-p (preceding-char))
             (not (syntax-escape-char-p (char-before-2))))
        (next-char 1)
        (setq c (following-char)))
      (cond
       ((syntax-open-paren-char-p c)
        (forward-list-1))
       ((syntax-closed-paren-char-p c)
        nil)
       ((syntax-string-quote-char-p c)
        (skip-string-forward))
       (t
        (skip-symbol-forward)))))
  
  (define-key *global-keymap* "M-C-f" 'forward-sexp)
  (defcommand forward-sexp (n) ("p")
    (dotimes (_ n t)
      (unless (%forward-sexp)
        (return))))
  
  (define-key *global-keymap* "M-C-b" 'backward-sexp)
  (defcommand backward-sexp (n) ("p")
    (dotimes (_ n t)
      (unless (%backward-sexp)
        (return))))
  