     (mapc #'elfeed-search-update-entry entries)
     (unless (use-region-p) (forward-line))))
 
+(defun elfeed-search-show-entry (entry)
+  "Display the currently selected item in a buffer."
+  (interactive (list (elfeed-search-selected :ignore-region)))
+  (elfeed-untag entry 'unread)
+  (elfeed-search-update-entry entry)
+  (forward-line)
+  (elfeed-show-entry entry))
+
 ;; Helper functions
+
+(defun elfeed-kill-buffer ()
+  "Kill the current buffer."
+  (interactive)
+  (kill-buffer (current-buffer)))
 
 (defun elfeed-regexp-tagger (regexp tag)
   "Return a function suitable for `elfeed-new-entry-hook' that

;;; Code:

(require 'cl)
(require 'xml)
(require 'xml-query)


          (elfeed-untag entry tag)
          :untag)))))

;; Entry display

(defvar elfeed-show-entry nil
  "The current entry being displayed.")

(defvar elfeed-show-mode-map
  (let ((map (make-sparse-keymap)))
    (prog1 map
      (define-key map "q" 'elfeed-kill-buffer)
      (define-key map "g" 'elfeed-show-refresh)))
  "Keymap for `elfeed-show-mode'.")

(defun elfeed-show-mode ()
  "Mode for displaying Elfeed feed entries.
\\{elfeed-show-mode-map}"
  (interactive)
  (kill-all-local-variables)
  (use-local-map elfeed-show-mode-map)
  (setq major-mode 'elfeed-show-mode
        mode-name "elfeed-show"
        buffer-read-only t)
  (make-local-variable 'elfeed-show-entry)
  (run-hooks 'elfeed-show-mode-hook))

(defun elfeed-insert-html (html)
  "Converted HTML markup to a propertized string."
  (shr-insert-document
   (with-temp-buffer
     (insert html)
     (libxml-parse-html-region (point-min) (point-max)))))

(defun elfeed-show-refresh ()
  "Update the buffer to match the selected entry."
  (interactive)
  (let ((inhibit-read-only t)
        (title (elfeed-entry-title elfeed-show-entry))
        (date (elfeed-entry-date elfeed-show-entry))
        (content (elfeed-entry-content elfeed-show-entry))
        (type (elfeed-entry-content-type elfeed-show-entry)))
    (erase-buffer)
    (insert (format "Title: %s\n" title))
    (insert (format "Date:  %s\n\n" date))
    (if (eq type 'html)
        (elfeed-insert-html content)
      (insert content))
    (goto-char (point-min))))

(defun elfeed-show-entry (entry)
  "Display a specific entry in the current window."
  (let ((title (elfeed-entry-title entry)))
    (switch-to-buffer (get-buffer-create (format "*elfeed %s*" title)))
    (unless (eq major-mode 'elfeed-show-mode)
      (elfeed-show-mode))
    (setq elfeed-show-entry entry)
    (elfeed-show-refresh)))

(provide 'elfeed)

;;; elfeed.el ends here
