From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ihor Radchenko Subject: Re: refile captured to all opened Org buffer files as targets Date: Fri, 27 Dec 2019 15:54:22 +0800 Message-ID: <8736d6fbkh.fsf@localhost> References: <87sgl8v9sp.fsf@gmail.com> <878sn0fm6i.fsf@localhost> <87r20qa6yd.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:41460) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ikkU2-0007cU-Sv for emacs-orgmode@gnu.org; Fri, 27 Dec 2019 02:56:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ikkU1-0000DA-FZ for emacs-orgmode@gnu.org; Fri, 27 Dec 2019 02:56:30 -0500 Received: from mail-yw1-xc2e.google.com ([2607:f8b0:4864:20::c2e]:33843) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ikkU1-0000Ci-9a for emacs-orgmode@gnu.org; Fri, 27 Dec 2019 02:56:29 -0500 Received: by mail-yw1-xc2e.google.com with SMTP id b186so11071798ywc.1 for ; Thu, 26 Dec 2019 23:56:28 -0800 (PST) In-Reply-To: <87r20qa6yd.fsf@gmail.com> 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: stardiviner Cc: Nicolas Goaziou , Org Mode Thanks! org-web-tools--html-to-org-with-pandoc is an interesting idea. I was using elfeed-insert-html for this purpose. Also, note that your capture may be messed up when the rss content contains org-mode text. A real-case scenario from Stack Exchange rss: > I'd like to find a way to jump to a location in an org-mode file while automatically unfolding only the heading at the location I'm jumping to and all its parent headings (but not any sibling headings). > > For example, if I have this org-mode file: > > * A > ** AA If you insert the rss entry contents as is, two unexpected headings will be created. I use the following to escape possible org-mode text: (setq content-text (with-temp-buffer (when content (if (eq content-type 'html) (elfeed-insert-html content) (insert content))) (let ((org-babel-min-lines-for-block-output 0)) ;; handle org-mode syntax in body (org-escape-code-in-region (point-min) (point-max))) (buffer-string))) Best, Ihor stardiviner writes: > 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 >