emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How do you store web pages for reference?


From: Adam Porter
Subject: Re: [O] How do you store web pages for reference?
Date: Wed, 22 Mar 2017 19:01:05 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Thanks for sharing that, Bob.  You mentioned on that page that you
couldn't get it working with a capture template; here's what I use,
which does use a capture template.  Maybe this will be helpful:

#+BEGIN_SRC elisp
(defun ap/org-capture-w3m ()
    "Call org-capture with the `W' template.  Use this from within w3m.

Depends on Magnar Sveen's s.el package."
    (interactive)
    (if (use-region-p)
        (progn
          ;; Replace current kill with one wrapped in an org quote block
          (org-w3m-copy-for-org-mode)
          (kill-new (s-wrap (s-trim (current-kill 0 t)) "\n\n#+BEGIN_QUOTE\n" 
"\n#+END_QUOTE") t))
      ;; Prevent whatever happens to be in the kill-ring from being captured
      (kill-new ""))
    (org-capture nil "w3"))

;; Associated capture template
("w3" "w3m capture" entry
      (file "")
      "* %a :website:

%U %?%c")

#+END_SRC




reply via email to

[Prev in Thread] Current Thread [Next in Thread]