anchor.diff:                                (subseq (line-str line) charpos))))))
         char)))
   
  -(defun %insert-line-string/point (point linum charpos string)
  -  (check-read-only-at-point point 0)
  -  (shift-sticky-objects point (length string))
  -  (let ((line
  -         (buffer-get-line (point-buffer point)
  -                          linum)))
  -    (setf (line-str line)
  -          (concatenate 'string
  -                       (subseq (line-str line) 0 charpos)
  -                       string
  -                       (subseq (line-str line) charpos)))))
  +(defun %insert-line-string/point (buffer linum line charpos string)
  +  (check-read-only-at-point line charpos 0)
  +  (shift-sticky-objects buffer linum line charpos (length string))
  +  (setf (line-str line)
  +        (concatenate 'string
  +                     (subseq (line-str line) 0 charpos)
  +                     string
  +                     (subseq (line-str line) charpos))))
   
   (defgeneric insert-string/point (point string)
     (:method (point string)
  -    (with-modify-buffer (point-buffer point)
  -      (loop :with start := 0
  -	 :for pos := (position #\newline string :start start)
  -	 :for linum :from (point-linum point) :by 1
  -	 :for charpos := (point-charpos point) :then 0
  -	 :do (if (null pos)
  -		 (progn
  -		   (%insert-line-string/point point linum charpos (subseq string start))
  -		   (return))
  -		 (let ((substr (subseq string start pos)))
  -		   (%insert-line-string/point point linum charpos substr)
  -		   (%insert-newline/point point linum (+ charpos (length substr)))
  -		   (setf start (1+ pos))))))
  +    (let ((buffer (point-buffer point)))
  +      (with-modify-buffer buffer
  +        (loop :with start := 0
  +              :for pos := (position #\newline string :start start)
  +              :for line := (point-line point) :then (line-next line)
  +              :for linum :from (point-linum point) :by 1
  +              :for charpos := (point-charpos point) :then 0
  +              :do (cond ((null pos)
  +                         (%insert-line-string/point buffer linum line charpos
  +                                                    (subseq string start))
  +                         (return))
  +                        (t
  +                         (let ((substr (subseq string start pos)))
  +                           (%insert-line-string/point buffer linum line charpos substr)
  +                           (%insert-newline/point buffer linum line
  +                                                  (+ charpos (length substr)))
  +                           (setf start (1+ pos))))))))
       string))
   
   (defun %delete-line-between/point (point start end)
  
positive.code:     (when nextp
        (line-merge line (line-next line) charpos))))
  
  (defun %insert-newline/point (point linum charpos)
    (let* ((buffer (point-buffer point))
           (line (buffer-get-line buffer linum)))
      (make-line line
                 (line-next line)
                 (subseq (line-str line) charpos))
      (shift-sticky-objects-newline point)
      (incf (buffer-nlines buffer))
      (setf (line-str line)
            (subseq (line-str line) 0 charpos))))
  
  (defgeneric insert-char/point (point char)
    (:method (point char)
      (with-modify-buffer (point-buffer point)
        (check-read-only-at-point point 0)
        (cond
          ((char= char #\newline)
           (%insert-newline/point point
  				(point-linum point)
  				(point-charpos point)))
          (t
           (let ((line (point-line point))
                 (charpos (point-charpos point)))
             (shift-sticky-objects point 1)
             (setf (line-str line)
                   (concatenate 'string
                                (subseq (line-str line) 0 charpos)
  
negative.code: (define-buffer-local-and-global-hook before-change-functions)
  (define-buffer-local-and-global-hook after-change-functions)
  
  (defun check-read-only-at-point (line charpos offset)
    (unless *inhibit-read-only*
      (when (if (eql offset 0)
                (line-search-property line :read-only charpos)
                (line-search-property-range line
                                            :read-only
                                            charpos
                                            (if (null offset)
                                                nil
                                                (+ charpos offset))))
        (error 'read-only-error))))
  
  (defmacro with-modify-buffer (buffer &body body)
    (alexandria:once-only (buffer)
  