Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use variable or function for target org file #2

Closed
dakra opened this issue Oct 30, 2017 · 2 comments
Closed

Use variable or function for target org file #2

dakra opened this issue Oct 30, 2017 · 2 comments

Comments

@dakra
Copy link

dakra commented Oct 30, 2017

I try to use a variable or a function to specify
the org file target but it seems to be only working with a string?

(setq orca-handler-list
      '((orca-handler-match-url
         "https://www.reddit.com/r/emacs"
         (concat org-directory "refile.org") "\\* Reddit")  ;; Doesn't work
        (orca-handler-match-url
         "https://emacs.stackexchange.com/"
         org-default-notes-file "\\* Questions")      ;; Doesn't work
        (orca-handler-file
         "~/org/refile.org" "\\* Refile")))       ;; Works

In the message buffer I get
Greedy org-protocol handler. Killing client.

Thanks.

@abo-abo
Copy link
Owner

abo-abo commented Oct 30, 2017

It only works with a string, but you can have your config work by using quasi-quote:

(setq orca-handler-list
      `((orca-handler-match-url
         "https://www.reddit.com/r/emacs"
         ,(concat org-directory "refile.org") "\\* Reddit")
        (orca-handler-match-url
         "https://emacs.stackexchange.com/"
         ,org-default-notes-file "\\* Questions")
        (orca-handler-file
         "~/org/refile.org" "\\* Refile")))

@dakra
Copy link
Author

dakra commented Oct 30, 2017

Great. Thank you very much.
Now looking at it I see that your solution is also the way I define org-capture-templates already so should have figured it out myself.

@dakra dakra closed this as completed Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants