         buffer-read-only t)
   (hl-line-mode)
   (make-local-variable 'elfeed-search-entries)
+  (when (null elfeed-search-refresh-timer)
+    (setf elfeed-search-refresh-timer
+          (run-at-time elfeed-search-refresh-rate elfeed-search-refresh-rate
+                       (apply-partially #'elfeed-search-update))))
+  (add-hook 'kill-buffer-hook
+            (lambda ()
+              (message "killed timer?")
+              (ignore-errors (cancel-timer elfeed-search-refresh-timer))
+              (setf elfeed-search-refresh-timer nil))
+            t t)
   (elfeed-search-update)
   (run-hooks 'elfeed-search-mode-hook))
 

          for old = (gethash id table)
          when old  ; merge old tags back in
          do (setf (elfeed-entry-tags entry) (elfeed-entry-tags old))
          do (setf (gethash id table) entry))))

(defun elfeed-string> (a b)
  (string< b a))

  (let ((map (make-sparse-keymap)))
    (prog1 map
      (define-key map "q" 'quit-window)
      (define-key map "g" (elfeed-expose #'elfeed-search-update :force))
      (define-key map "G" 'elfeed-update)
      (define-key map "b" 'elfeed-search-browse-url)
      (define-key map "y" 'elfeed-search-yank)
      (define-key map "u" (elfeed-expose #'elfeed-search-tag-all 'unread))
