anchor.diff:  (define-buffer-local-and-global-hook before-change-functions)
   (define-buffer-local-and-global-hook after-change-functions)
   
  -(defun check-read-only-at-point (point offset)
  +(defun check-read-only-at-point (line charpos offset)
     (unless *inhibit-read-only*
  -    (let ((line (point-line point))
  -          (charpos (point-charpos point)))
  -      (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)))))
  +    (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)
  
positive.code:           (loop :while (or (eq n 'T) (plusp n))
  	     :for eolp := (or (eq n 'T)
  			      (> n (- (line-length line) charpos)))
  	     :do (check-read-only-at-point point (if (eq n 'T) nil (if eolp n nil)))
  	     :do (cond
  		   ((not eolp)
  		    (%delete-line-between/point point charpos (+ charpos n))
  
negative.code:                               (subseq (line-str line) charpos))))))
        char)))
  
  (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)
      (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)
  