anchor.diff:                        :key #'tag-name)))
         (when with-empty-tag
           (push "" tags))
  -      (lambda (minibuffer)
  -        (fuzzy-match (text-buffer::word-at-cursor (input-cursor minibuffer)) tags)))))
  -
  -(define-command insert-tag (&optional (minibuffer (current-minibuffer)))
  -  "Replace current word with selected tag."
  -  (let ((selection (get-suggestion minibuffer)))
  -    (unless (uiop:emptyp selection)
  -      (text-buffer::replace-word-at-cursor (input-cursor minibuffer) (str:concat selection " "))
  -      (update-display minibuffer))))
  -
  -(define-mode set-tag-mode (nyxt/minibuffer-mode:minibuffer-mode)
  -  "Minibuffer mode for setting the tag of a bookmark."
  -  ((keymap-scheme
  -    (define-scheme "set-tag"
  -      scheme:cua
  -      (list "tab" 'insert-tag
  -            ;; TODO: RETURN
  -            )))))
  +      tags
  +      ;; (lambda (minibuffer)
  +      ;;   (fuzzy-match (text-buffer::word-at-cursor (input-cursor minibuffer)) tags))
  +      )))
  +
  +(define-class tag-source (prompter:source)
  +  ((prompter:name "Tags")
  +   (extra-tags '())
  +   (prompter:multi-selection-p t)
  +   (prompter:constructor (lambda (source)
  +                           (tag-suggestions :extra-tags (extra-tags source)))))
  +  (:accessor-name-transformer (hu.dwim.defclass-star:make-name-transformer name)))
  +
  +;; (define-command insert-tag (&optional (minibuffer (current-minibuffer)))
  +;;   "Replace current word with selected tag."
  +;;   (let ((selection (get-suggestion minibuffer)))
  +;;     (unless (uiop:emptyp selection)
  +;;       (text-buffer::replace-word-at-cursor (input-cursor minibuffer) (str:concat selection " "))
  +;;       (update-display minibuffer))))
  +
  +;; (define-mode set-tag-mode (nyxt/minibuffer-mode:minibuffer-mode)
  +;;   "Minibuffer mode for setting the tag of a bookmark."
  +;;   ((keymap-scheme
  +;;     (define-scheme "set-tag"
  +;;       scheme:cua
  +;;       (list "tab" 'insert-tag
  +;;             ;; TODO: RETURN
  +;;             )))))
   
   (define-command list-bookmarks ()
     "List all bookmarks in a new buffer."
  
positive.code:         (echo "Buffer has no URL.")
          (let* ((body (with-current-buffer buffer
                         (ffi-buffer-get-document buffer)))
                 (tags (prompt-minibuffer
                        :input-prompt "Space-separated tag(s)"
                        :default-modes '(set-tag-mode minibuffer-mode)
                        :input-buffer (url-bookmark-tags (url buffer))
                        :suggestion-function (tag-suggestion-filter
                                              :extra-tags (make-tags (extract-keywords body 5))))))
            (bookmark-add (url buffer)
                          :title (title buffer)
                          :tags tags)
  
negative.code:            (list (make-instance 'bookmark-entry :url (quri:uri url)))
             :test #'equals))))
  
  ;; (define-command insert-suggestion-or-tag (&optional (minibuffer (current-minibuffer)))
  ;;   "Paste selected suggestion or tag in input.
  ;; If character before cursor is '+' or '-' complete against tag."
  ;;   (let* ((current-word (text-buffer::word-at-cursor (input-cursor minibuffer)))
  ;;          (operand? (unless (str:emptyp current-word) (subseq current-word 0 1))))
  ;;     (if (or (equal "-" operand?)
  ;;             (equal "+" operand?))
  ;;         (let ((tag (prompt
  ;;                     :prompt "Tag"
  ;;                     :input (subseq current-word 1)
  ;;                     :sources (make-instance 'tag-source))))
  ;;           (when tag
  ;;             (text-buffer::replace-word-at-cursor
  ;;              (input-cursor minibuffer)
  ;;              (str:concat operand? (tag-name tag)))))
  ;;         ;; (nyxt/minibuffer-mode:insert-suggestion minibuffer)
  ;;         )))
  
  ;; (define-mode minibuffer-tag-mode (nyxt/minibuffer-mode:minibuffer-mode)
  ;;   "Minibuffer mode for setting the bookmark and their tags."
  ;;   ((keymap-scheme
  ;;     (define-scheme "minibuffer-tag"
  ;;       scheme:cua
  ;;       (list
  ;;        "tab" 'insert-suggestion-or-tag)))))
  
  (define-command set-url-from-bookmark ()
    "Set the URL for the current buffer from a bookmark.
  With multiple selections, open the first bookmark in the current buffer, the
  rest in background buffers."
    (let ((entries (prompt
                    :prompt "Open bookmark(s)"
                    ;; :default-modes '(minibuffer-tag-mode minibuffer-mode) ; TODO: Replace this behaviour.
                    :sources (make-instance 'bookmark-source
                                            :multi-selection-p t))))
      (dolist (entry (rest entries))
        (make-buffer :url (object-string (url entry))))
      (buffer-load (url (first entries)))))
  
  (define-command set-url-from-bookmark-new-buffer ()
    "Open selected bookmarks in new buffers."
    (let ((entries (prompt
                    :prompt "Open bookmark(s) in new buffers"
                    ;; :default-modes '(minibuffer-tag-mode minibuffer-mode) ; TODO: Replace this behaviour.
                    :sources (make-instance 'bookmark-source
                                            :multi-selection-p t))))
      (dolist (entry (rest entries))
        (make-buffer :url (object-string (url entry))))
      (make-buffer-focus :url (url (first entries)))))
  