anchor.diff:          (make-term :id (doc-value doc :id)))))
   
   (defun get-name (package)
  -  (typecase package
  +  (etypecase package
       (null "")
       (package (package-name package))
  -    (t package)))
  +    (symbol (%to-s package))
  +    (string package)))
   
   (defun cl-doc-key (package name type)
     (format nil "~A:~A:~A"
  
positive.code: 
  (defun package-for-name (name)
    (etypecase name
      (symbol (package-name (symbol-package name)))
      (cons (if (eql 'setf (first name))
                (package-for-name (second name))
  
negative.code: 
  (defun is-macro? (thing)
    (ignore-errors (macro-function thing)))
  
  
  (defun delete-package-contents-from-index (package)
    (mapc #'%delete-doc
            (docs-for-term :package (package-designator package)))
    (montezuma:flush *cl-doc-index*))
  
  
  (defun make-default-doc (thing
                           &optional type package
                           &aux (docs (manifest::docs-for thing type)))
    ;; TODO: figure out how to filter by missing documentation then always return
    ;; the doc instead of not adding docs with missing documentation
    (setf type (case type
                 (:function (if (is-macro? thing) 
                                :macro
                                :function))
                 (T type)))
    (when docs
      (doc-with-fields
       (make-field :id (cl-doc-key package thing type) nil)
       (make-field :name thing nil)
       (make-field :search-name thing)
       (make-field :type type nil)
       (make-field :package package nil)
       (make-field :documentation docs)
       (case type
         ((:function :macro)
          (let ((arglist (ignore-errors (swank::arglist thing))))
            (when arglist (make-field
                           :arglist
                           ;; dont use standard list translation
                           (princ-to-string arglist)))))) )
      ))
  
  (defun package-designator (n)
    (typecase n
      (keyword n)
      (T (intern (get-name n) :keyword))))
  
  (defun package-document (n)
    (setf n (package-designator n))
    (find-doc-by-key nil n :package))
  
  (defun make-package-doc (package &optional (type :package) package-package)
    (let* ((pname (package-designator package))
           (readme (manifest::readme-text pname))
           (doc (doc-with-fields
                 (make-field :id (cl-doc-key nil pname type)  nil)
                 (make-field :name pname nil)
                 (make-field :search-name pname)
                 (make-field :nicknames (package-nicknames package))
                 (make-field :type type nil)
                 (make-field :package package-package nil)
                 (make-field :documentation (documentation package t))
                 (make-field :readme readme))))
      doc))
  
  (defun add-to-index (thing type package
                       &key
  