0

I would like to create an org-capture template such that when I select it with org-capture (which is mapped to C-c c for me), I want the capture template to ask me for the description and URL of a link, then insert that into a heading and use the entered data as the title of a second level heading.

* Bookmarks
  ** Captured Link
  ** Captured Link
  ** ..

So far I use this:

("b" "Bookmark"
        entry (file+headline ,(concat org-directory "/refile.org") "Bookmarks")
        "* %?\n")

The problem is that I need to press C-c l manually. I would like the org-store-link function to be called automatically when I run the capture template.

6
  • org-store-link does not insert a link: it stores a link for later insertion by org-inert-link, so I'm not sure what you mean - can you clarify? Providing a detailed usage example would go a long way towards clarifying what you mean.
    – NickD
    Aug 11 at 15:01
  • As NickD said, you should org-store-link and add "%a" to the org-capture template to get stored-link like "* %a\n%?". For more detail, please refer to the doc of org-capture-templates. Aug 11 at 15:16
  • 1
    And If you want to add bookmarks from the web browser, you can use org-protocol + org-capture like cestlaz.github.io/post/using-emacs-70-org-protocol, emacstil.com/til/2021/11/09/firefox-org-capture or mediaonfire.com/blog/2017_07_21_org_protocol_firefox.html Aug 11 at 15:22
  • @NickD When I select the capture template with org-capture which is mapped to C-c c for me, I want the capture template to ask me for the description and url of the link then insert that into a heading.
    – Leslie
    Aug 12 at 9:21
  • I edited your question to include that information. Please check it and fix any inaccuracies. It is far better to edit the question and add those details than to add them in a comment. The question needs to stand on its own.
    – NickD
    Aug 12 at 14:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.