         buffer-read-only t)
   (hl-line-mode)
   (make-local-variable 'elfeed-search-entries)
+  (make-local-variable 'elfeed-search-filter)
   (when (null elfeed-search-refresh-timer)
     (setf elfeed-search-refresh-timer
           (run-at-time elfeed-search-refresh-rate elfeed-search-refresh-rate

            (standard-output (current-buffer))
            (line (line-number-at-pos)))
        (erase-buffer)
        (loop for entry in (setf elfeed-search-entries (elfeed-db-entries))
              do (elfeed-search-print entry)
              do (insert "\n"))
        (insert "End of entries.\n")

    (when feedtitle
      (insert "(" (propertize feedtitle 'face 'elfeed-search-feed-face) ")"))))

(defun elfeed-search-filter (entries)
  "Filter out only entries that match the filter."
  (let ((must-have ())
        (must-not-have ()))
    (loop for element in (split-string elfeed-search-filter)
          for type = (aref element 0)
          for tag = (intern (substring element 1))
          do (case type
               (?+ (push tag must-have))
               (?- (push tag must-not-have))))
    (loop for entry in entries
          for tags = (elfeed-entry-tags entry)
          when (and (every  (lambda (tag) (member tag tags)) must-have)
                    (notany (lambda (tag) (member tag tags)) must-not-have))
          collect entry)))

(defun elfeed-search-filter-read (new-filter)
  "Query for a new filter from the user."
  (interactive (list (read-from-minibuffer "Filter: " elfeed-search-filter)))
  (setf elfeed-search-filter new-filter)
  (elfeed-search-update :force))

(defun elfeed-search-update (&optional force)
  "Update the display to match the database."
  (interactive)
