       (when buffer
         (with-current-buffer buffer
           (let* ((window (get-buffer-window (elfeed-search-buffer)))
+                 (height (window-total-height window))
                  (limiter (if window
-                              (format "#%d " (window-total-height window))
+                              (format "#%d " height)
                             "#1 "))
                  (elfeed-search-filter (concat limiter current-filter)))
-            (elfeed-search-update :force)))))))
+            (elfeed-search-update :force)
+            (setf elfeed-search-filter-overflowing
+                  (= (length elfeed-search-entries)
+                     height))))))))
 
 (defun elfeed-search-live-filter ()
   "Filter the elfeed-search buffer as the filter is written."

  '((((class color) (background light)) (:foreground "#070"))
    (((class color) (background dark))  (:foreground "#0f0")))
  "Face used in search mode for tags."
  :group 'elfeed)

(defcustom elfeed-search-title-max-width 70

      (define-key map "-" 'elfeed-search-untag-all)))
  "Keymap for elfeed-search-mode.")

(defun elfeed-search--intro-header ()
  "Return the header shown to new users."
  (with-temp-buffer
    (cl-flet ((button (f)
                (insert-button (symbol-name f)
                               'follow-link t
                               'action (lambda (_) (call-interactively f)))))
      (insert "Database empty. Use ")
      (button 'elfeed-add-feed)
      (insert ", or ")
      (button 'elfeed-load-opml)
      (insert ", or ")
      (button 'elfeed-update)
      (insert ".")
      (buffer-string))))

(defun elfeed-search--count-unread ()
  "Count the number of entries and feeds being currently displayed."
  (if (and elfeed-search-filter-active elfeed-search-filter-overflowing)
      "?/?:?"
    (cl-loop with feeds = (make-hash-table :test 'equal)
             for entry in elfeed-search-entries
             for feed = (elfeed-entry-feed entry)
             for url = (elfeed-feed-url feed)
             count entry into entry-count
             count (elfeed-tagged-p 'unread entry) into unread-count
             do (puthash url t feeds)
             finally
             (cl-return
              (format "%d/%d:%d"
                      unread-count entry-count
                      (hash-table-count feeds))))))

(defun elfeed-search--header ()
  "Returns the string to be used as the Elfeed header."
  (cond
   ((zerop (elfeed-db-last-update))
    (elfeed-search--intro-header))
   (url-queue
    (let ((total (length url-queue))
          (in-process (cl-count-if #'url-queue-buffer url-queue)))
      (format "%d feeds pending, %d in process ..."
              (- total in-process) in-process)))
   ((let* ((db-time (seconds-to-time (elfeed-db-last-update)))
           (update (format-time-string "%Y-%m-%d %H:%M:%S %z" db-time))
           (unread (elfeed-search--count-unread)))
      (format "Last update %s, %s%s"
              (propertize update 'face 'elfeed-search-last-update-face)
              (propertize unread 'face 'elfeed-search-unread-count-face)
              (propertize (cond
                           (elfeed-search-filter-active
                            "")
                           (elfeed-search-filter
                            (concat ", " elfeed-search-filter))
                           (""))
                          'face 'elfeed-search-filter-face))))))

(defun elfeed-search-mode ()
  "Major mode for listing elfeed feed entries.
\\{elfeed-search-mode-map}"
