21 Nov

Open Gnus article in new tab

Tuesday November 21st 2006, 6:08 pm
Tags: , , , ,

And yet another Emacs hack: open an article from the Gnus summary buffer in another elscreen tab by pressing C-RET. Gnus does not support multiple article buffers for the same group, so I select the article below the cursor, rename the buffer to something else and restore the previous selected article. Works fine ™. Only drawback: most Gnus command like “reply” will not work, or more precisely they will be relative to the current article in the real *Article* buffer.

(defun my-show-article-other-window ()
  (interactive)
  "Show article in a seperate window from Gnus summary buffer"
  (mapcar
   (lambda (article)
     (elscreen-find-and-goto-by-buffer gnus-summary-buffer)
     (let ((show-article
            (lambda ()
              (gnus-summary-select-article nil ‘force ‘pseudo article)
              (gnus-summary-select-article-buffer)
              (let ((new-name (concat "*Article " gnus-newsgroup-name
                                      "/" (number-to-string article) "*")))
                (if (get-buffer new-name) (kill-buffer (get-buffer new-name)))
                (rename-buffer new-name)
                new-name))))
       (elscreen-create)
       (switch-to-buffer
        (save-window-excursion
          (save-excursion
            (if (gnus-buffer-live-p gnus-article-buffer)
                (let ((old-article (cdr gnus-article-current))
                      (new-name (funcall show-article)))
                  (gnus-summary-select-article nil ‘force ‘pseudo old-article)
                  new-name)
              (funcall show-article))))))
     (gnus-summary-work-articles nil))))

(define-key gnus-summary-mode-map [(control return)] ‘my-show-article-other-window)

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • del.icio.us
  • Reddit

No Comments »

No comments yet.

 

RSS feed for comments on this post. TrackBack Website

Leave a comment

(required)

(required)

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>