From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: Re: refile captured to all opened Org buffer files as targets Date: Fri, 27 Dec 2019 09:32:58 +0800 Message-ID: <87r20qa6yd.fsf@gmail.com> References: <87sgl8v9sp.fsf@gmail.com> <878sn0fm6i.fsf@localhost> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:39982) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ikeV1-0007Rr-Ii for emacs-orgmode@gnu.org; Thu, 26 Dec 2019 20:33:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ikeV0-0000im-2U for emacs-orgmode@gnu.org; Thu, 26 Dec 2019 20:33:07 -0500 Received: from [183.246.146.61] (port=2143 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ikeUz-0000c1-0Z for emacs-orgmode@gnu.org; Thu, 26 Dec 2019 20:33:06 -0500 In-reply-to: <878sn0fm6i.fsf@localhost> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Ihor Radchenko Cc: Nicolas Goaziou , Org Mode Ihor Radchenko writes: > [offtopic] > >> I recently created an org-capture template for elfeed, it is finished. > > Could you share your capture template? Sure, here it is: #+begin_src emacs-lisp ;; support Org Mode Capture template (defun my/org-capture-elfeed-title () (with-current-buffer "*elfeed-entry*" (elfeed-entry-title elfeed-show-entry))) (defun my/org-capture-elfeed-date () (with-current-buffer "*elfeed-entry*" (format-time-string "[%Y-%m-%d %a %H:%M]" (seconds-to-time (elfeed-entry-date elfeed-show-entry))))) (defun my/org-capture-elfeed-source () (with-current-buffer "*elfeed-entry*" (let ((feed (elfeed-entry-feed elfeed-show-entry))) (elfeed-feed-title feed)))) (defun my/org-capture-elfeed-content () (with-current-buffer "*elfeed-entry*" (let* ((content (elfeed-deref (elfeed-entry-content elfeed-show-entry))) (type (elfeed-entry-content-type elfeed-show-entry)) (feed (elfeed-entry-feed elfeed-show-entry)) (base-url (and feed (elfeed-compute-base (elfeed-feed-url feed))))) (if content (if (eq type 'html) (org-web-tools--html-to-org-with-pandoc content) (insert content)))))) (add-to-list 'org-capture-templates '("R" "Capture elfeed [R]SS feed content to Org buffer" entry (file "") "* %(my/org-capture-elfeed-title) :PROPERTIES: :SOURCE: %(my/org-capture-elfeed-source) :DATE(original): %(my/org-capture-elfeed-date) :DATE: %u :END: %(my/org-capture-elfeed-content)" :empty-lines 1 :jump-to-captured t)) #+end_src If possible, I might submit this PR to elfeed.el repository. -- [ stardiviner ] I try to make every word tell the meaning what I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3