[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Nice blog post - Org-mode in Your Pocket Is a GNU-Shaped Devil
From: |
François Pinard |
Subject: |
Re: [O] Nice blog post - Org-mode in Your Pocket Is a GNU-Shaped Devil |
Date: |
Fri, 05 Apr 2013 06:59:23 -0400 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/23.4 (gnu/linux) |
Bastien <address@hidden> writes:
>> It took me about one hour (my Gnus programming is rather rusty) for
>> adding a Gnus command opening many tabs at once, in a graphical
>> browser, for all articles I retain in Gnus for reading.
> That looks nice, is your hack public somewhere?
No, but here it is, usage instructions follow.
(defun fp-gnus-summary-open-links (arg)
"Open links in a browser for processable articles, like for Hacker News."
(interactive "P")
(let ((articles (gnus-summary-work-articles arg)))
(save-excursion
(while articles
(setq article (pop articles))
(gnus-summary-goto-article article)
(gnus-summary-show-article t)
(save-excursion
(pop-to-buffer gnus-article-buffer)
(re-search-forward "<a href=\"\\([^\"]+\\)\">Link</a>")
(browse-url (match-string 1)))
(gnus-summary-remove-process-mark article))))
(gnus-summary-position-point))
(defun my-gnus-summary-mode-hook ()
(define-key gnus-summary-mode-map "\C-cnl" 'fp-gnus-summary-open-links)
;; ...
)
(add-hook 'gnus-summary-mode-hook 'my-gnus-summary-mode-hook)
The function selects articles according to the process/mark convention,
and I want it to fail whenever an article does not have a "Link" button
(that's why I do not catch the error if "re-search" fails). So, I use
it this way. In an RSS summary buffer, I use C-k to "read" without
opening any subject I want to skip. Once done, I use "x M P A C-c n l"
to remove all article I C-k'ed, add a process mark on everything else,
then transfer marked articles into a graphical browser, one tab per
article. Transferred articles also get "read" in the summary buffer.
I also use this bit of Emacs Lisp code in ~/.emacs, which is related:
;; Chrome (really xdg-open)
;; ------------------------
(defun browse-url-xdg-open (url &optional new-window)
"Ask the default browser to load URL.
Default to the URL around or before point."
(interactive (browse-url-interactive-arg "URL: "))
(shell-command (concat "xdg-open "
(shell-quote-argument (browse-url-encode-url url)))))
(setq browse-url-browser-function 'browse-url-xdg-open)
François
- [O] Nice blog post - Org-mode in Your Pocket Is a GNU-Shaped Devil, Rainer M. Krug, 2013/04/04
- Re: [O] Nice blog post - Org-mode in Your Pocket Is a GNU-Shaped Devil, Russell Adams, 2013/04/04
- Re: [O] Nice blog post - Org-mode in Your Pocket Is a GNU-Shaped Devil, Christian Moe, 2013/04/04
- Re: [O] Nice blog post - Org-mode in Your Pocket Is a GNU-Shaped Devil, Rainer M. Krug, 2013/04/04
- Re: [O] Nice blog post - Org-mode in Your Pocket Is a GNU-Shaped Devil, Suvayu Ali, 2013/04/04
- Re: [O] Nice blog post - Org-mode in Your Pocket Is a GNU-Shaped Devil, François Pinard, 2013/04/05
- Re: [O] Nice blog post - Org-mode in Your Pocket Is a GNU-Shaped Devil, Suvayu Ali, 2013/04/05
- Re: [O] Nice blog post - Org-mode in Your Pocket Is a GNU-Shaped Devil, Gareth Smith, 2013/04/05
- Re: [O] Nice blog post - Org-mode in Your Pocket Is a GNU-Shaped Devil, Eric Schulte, 2013/04/05