all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Org Protocol error, does not recognize template
@ 2017-06-11  2:41 Samuel W. Flint
  2017-06-11  3:08 ` Samuel W. Flint
  0 siblings, 1 reply; 8+ messages in thread
From: Samuel W. Flint @ 2017-06-11  2:41 UTC (permalink / raw)
  To: Org-Mode

Hello,

I have an issue with org-protocol at the moment.  If using new-style
links, one of my templates is not recognized.  If I try the following
link:
org-protocol://capture?template=b&title=FlintFam.org+Home&url=http%3A%2F%2Fflintfam.org

I get an error:

*ERROR*: Capture template ‘b’: nil

What can I do to fix this?

Thanks,

Sam Flint

-- 
Samuel W. Flint
4096R/266596F4
      (9477 D23E 389E 40C5 2F10  DE19 68E5 318E 2665 96F4)
λs.(s s) λs.(s s)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Org Protocol error, does not recognize template
  2017-06-11  2:41 Org Protocol error, does not recognize template Samuel W. Flint
@ 2017-06-11  3:08 ` Samuel W. Flint
  2017-06-11  7:15   ` Nicolas Goaziou
  2017-06-14 17:05   ` Nick Dokos
  0 siblings, 2 replies; 8+ messages in thread
From: Samuel W. Flint @ 2017-06-11  3:08 UTC (permalink / raw)
  To: Org-Mode

>>>>> Samuel W Flint writes:

    SF> Hello, I have an issue with org-protocol at the moment.  If
    SF> using new-style links, one of my templates is not recognized.
    SF> If I try the following link:
    SF> org-protocol://capture?template=b&title=FlintFam.org+Home&url=http%3A%2F%2Fflintfam.org

    SF> I get an error:

    SF> *ERROR*: Capture template ‘b’: nil

As it turns out, it can't find that template in any situation (including
if it's called accurately).

org-capture-templates is set as follows:

(setq org-capture-templates
      `(("a" "Create Appointment" entry
         (file+olp "~/org/agenda.org" "Main Agenda, including diary" "Current")
         (file "~/.emacs.d/org-capture-templates/appointment-template.org")
         :empty-lines 1 :prepend nil)
        ("t" "TODO Items")
        ("tt" "Standard TODO" entry
         (file+headline "~/org/main.org" "To Do")
         (file "~/.emacs.d/org-capture-templates/todo-template.org")
         :empty-lines 1)
        ("td" "Deadline TODO" entry
         (file+headline "~/org/main.org" "To Do")
         (file "~/.emacs.d/org-capture-templates/todo-deadline-template.org")
         :empty-lines 1)
        ("tl" "Linked TODO" entry
         (file+headline "~/org/main.org" "To Do")
         (file "~/.emacs.d/org-capture-templates/todo-link-template.org")
         :empty-lines 1)
        ("n" "Notes")
        ("nn" "General Notes" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/notes-journal-template.org")
         :empty-lines 1)
        ("nl" "Linked Note" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/linked-note-journal-template.org")
         :empty-lines 1)
        ("nq" "Quoting Note" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/quoting-note-journal-template.org")
         :empty-lines 1)
        ("nt" "Linked/Quoted Notes" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/technical-journal-template.org")
         :empty-lines 1)
        ("nd" "Note on Date" entry
         (file+datetree+prompt ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/notes-journal-template.org")
         :empty-lines 1)
        ("nc" "Clocking Notes")
        ("ncn" "General Notes" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/notes-journal-template-clocking.org")
         :empty-lines 1)
        ("ncl" "Linked Note" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/linked-note-journal-template-clocking.org")
         :empty-lines 1)
        ("ncq" "Quoting Note" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/quoting-note-journal-template-clocking.org")
         :empty-lines 1)
        ("nct" "Linked/Quoted Notes" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/technical-journal-template-clocking.org")
         :empty-lines 1)
        ("A" "Assignment" entry
         (file "~/org/school.org")
         (file "~/.emacs.d/org-capture-templates/assignment-template.org")
         :empty-lines 1)
        ("j" "Journal Entry" entry
         (file+datetree ,(format-time-string "~/org/journal/%Y.org.gpg"))
         (file "~/.emacs.d/org-capture-templates/journal-template.org")
         :empty-lines 1)
        ("c" "calfw2org" entry
         (file+olp "~/org/agenda.org" "Main Agenda, including diary" "Current")
         (file "~/.emacs.d/org-capture-templates/clfw-template.org")
         :empty-lines 1)
        ("b" "Bookmark" item
         (file+olp "~/org/bookmarks.org" "Unsorted Bookmarks")
         "%a"
         :immediate-finish t)
        ("m" "Mail Message Follow-up" entry
         (file+olp "~/org/agenda.org" "Main Agenda, including diary" "Mail Message Follow-up")
         (file "~/.emacs.d/org-capture-templates/mail-followup-template.org")
         :immediate-finish t :empty-lines 1)))

    SF> What can I do to fix this?

    SF> Thanks,

    SF> Sam Flint

    SF> -- Samuel W. Flint 4096R/266596F4 (9477 D23E 389E 40C5 2F10 DE19
    SF> 68E5 318E 2665 96F4) λs.(s s) λs.(s s)


-- 
Samuel W. Flint
4096R/266596F4
      (9477 D23E 389E 40C5 2F10  DE19 68E5 318E 2665 96F4)
λs.(s s) λs.(s s)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Org Protocol error, does not recognize template
  2017-06-11  3:08 ` Samuel W. Flint
@ 2017-06-11  7:15   ` Nicolas Goaziou
  2017-06-11 16:43     ` Samuel W. Flint
  2017-06-14 17:05   ` Nick Dokos
  1 sibling, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2017-06-11  7:15 UTC (permalink / raw)
  To: Samuel W. Flint; +Cc: Org-Mode

Hello,

swflint@flintfam.org (Samuel W. Flint) writes:

> (setq org-capture-templates
>       `(("a" "Create Appointment" entry
>          (file+olp "~/org/agenda.org" "Main Agenda, including diary" "Current")
>          (file "~/.emacs.d/org-capture-templates/appointment-template.org")

You cannot have more than one target in the same template. Ditto for the
other templates.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Org Protocol error, does not recognize template
  2017-06-11  7:15   ` Nicolas Goaziou
@ 2017-06-11 16:43     ` Samuel W. Flint
  2017-06-14 13:58       ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Samuel W. Flint @ 2017-06-11 16:43 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org-Mode

First, my apologies for sending directly to you and not the list the
first time.

>>>>> Nicolas Goaziou writes:

    NG> Hello, swflint@flintfam.org (Samuel W. Flint) writes:

    >> (setq org-capture-templates `(("a" "Create Appointment" entry
    >> (file+olp "~/org/agenda.org" "Main Agenda, including diary"
    >> "Current") (file
    >> "~/.emacs.d/org-capture-templates/appointment-template.org")

    NG> You cannot have more than one target in the same template. Ditto
    NG> for the other templates.

I'm aware.  The second (file path) is the capture template.  All other
templates work, except for b for some reason.

    NG> Regards,

    NG> -- Nicolas Goaziou

Sam

-- 
Samuel W. Flint
4096R/266596F4
      (9477 D23E 389E 40C5 2F10  DE19 68E5 318E 2665 96F4)
λs.(s s) λs.(s s)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Org Protocol error, does not recognize template
  2017-06-11 16:43     ` Samuel W. Flint
@ 2017-06-14 13:58       ` Nicolas Goaziou
  2017-06-14 16:02         ` Samuel W. Flint
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2017-06-14 13:58 UTC (permalink / raw)
  To: Samuel W. Flint; +Cc: Org-Mode

Hello,

swflint@flintfam.org (Samuel W. Flint) writes:

> I'm aware.  The second (file path) is the capture template.  All other
> templates work, except for b for some reason.

Isn't the capture template supposed to be a string?

Anyway, I'm not able to reproduce your problem. Could you post a more
precise recipe?

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Org Protocol error, does not recognize template
  2017-06-14 13:58       ` Nicolas Goaziou
@ 2017-06-14 16:02         ` Samuel W. Flint
  2017-06-14 16:31           ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Samuel W. Flint @ 2017-06-14 16:02 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org-Mode


> On Jun 14, 2017, at 08:58, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> 
> Hello,
> 
> swflint@flintfam.org (Samuel W. Flint) writes:
> 
>> I'm aware.  The second (file path) is the capture template.  All other
>> templates work, except for b for some reason.
> 
> Isn't the capture template supposed to be a string?

That format is documented in the docstring for org-capture-templates.

> Anyway, I'm not able to reproduce your problem. Could you post a more
> precise recipe?

That's the most precise recipe I have. For some reason that specific template cannot be found.

> Regards,
> 
> -- 
> Nicolas Goaziou
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Org Protocol error, does not recognize template
  2017-06-14 16:02         ` Samuel W. Flint
@ 2017-06-14 16:31           ` Nicolas Goaziou
  0 siblings, 0 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2017-06-14 16:31 UTC (permalink / raw)
  To: Samuel W. Flint; +Cc: Org-Mode

"Samuel W. Flint" <swflint@flintfam.org> writes:

> That format is documented in the docstring for org-capture-templates.

Correct! I suppose I should read docstrings from time to time.

> That's the most precise recipe I have. For some reason that specific
> template cannot be found.

I put

(setq org-capture-templates
      `(("a" "Create Appointment" entry
         (file+olp "~/org/agenda.org" "Main Agenda, including diary" "Current")
         (file "~/.emacs.d/org-capture-templates/appointment-template.org")
         :empty-lines 1 :prepend nil)
        ("t" "TODO Items")
        ("tt" "Standard TODO" entry
         (file+headline "~/org/main.org" "To Do")
         (file "~/.emacs.d/org-capture-templates/todo-template.org")
         :empty-lines 1)
        ("td" "Deadline TODO" entry
         (file+headline "~/org/main.org" "To Do")
         (file "~/.emacs.d/org-capture-templates/todo-deadline-template.org")
         :empty-lines 1)
        ("tl" "Linked TODO" entry
         (file+headline "~/org/main.org" "To Do")
         (file "~/.emacs.d/org-capture-templates/todo-link-template.org")
         :empty-lines 1)
        ("n" "Notes")
        ("nn" "General Notes" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/notes-journal-template.org")
         :empty-lines 1)
        ("nl" "Linked Note" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/linked-note-journal-template.org")
         :empty-lines 1)
        ("nq" "Quoting Note" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/quoting-note-journal-template.org")
         :empty-lines 1)
        ("nt" "Linked/Quoted Notes" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/technical-journal-template.org")
         :empty-lines 1)
        ("nd" "Note on Date" entry
         (file+datetree+prompt ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/notes-journal-template.org")
         :empty-lines 1)
        ("nc" "Clocking Notes")
        ("ncn" "General Notes" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/notes-journal-template-clocking.org")
         :empty-lines 1)
        ("ncl" "Linked Note" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/linked-note-journal-template-clocking.org")
         :empty-lines 1)
        ("ncq" "Quoting Note" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/quoting-note-journal-template-clocking.org")
         :empty-lines 1)
        ("nct" "Linked/Quoted Notes" entry
         (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
         (file "~/.emacs.d/org-capture-templates/technical-journal-template-clocking.org")
         :empty-lines 1)
        ("A" "Assignment" entry
         (file "~/org/school.org")
         (file "~/.emacs.d/org-capture-templates/assignment-template.org")
         :empty-lines 1)
        ("j" "Journal Entry" entry
         (file+datetree ,(format-time-string "~/org/journal/%Y.org.gpg"))
         (file "~/.emacs.d/org-capture-templates/journal-template.org")
         :empty-lines 1)
        ("c" "calfw2org" entry
         (file+olp "~/org/agenda.org" "Main Agenda, including diary" "Current")
         (file "~/.emacs.d/org-capture-templates/clfw-template.org")
         :empty-lines 1)
        ("b" "Bookmark" item
         (file+olp "~/org/bookmarks.org" "Unsorted Bookmarks")
         "%a"
         :immediate-finish t)
        ("m" "Mail Message Follow-up" entry
         (file+olp "~/org/agenda.org" "Main Agenda, including diary" "Mail Message Follow-up")
         (file "~/.emacs.d/org-capture-templates/mail-followup-template.org")
         :immediate-finish t :empty-lines 1)))

in a minimal init file and successfully called "M-x org-capture RET b".
Is that you recipe or am I doing something wrong?

Regards,

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Org Protocol error, does not recognize template
  2017-06-11  3:08 ` Samuel W. Flint
  2017-06-11  7:15   ` Nicolas Goaziou
@ 2017-06-14 17:05   ` Nick Dokos
  1 sibling, 0 replies; 8+ messages in thread
From: Nick Dokos @ 2017-06-14 17:05 UTC (permalink / raw)
  To: emacs-orgmode

swflint@flintfam.org (Samuel W. Flint) writes:

>>>>>> Samuel W Flint writes:
>
>     SF> Hello, I have an issue with org-protocol at the moment.  If
>     SF> using new-style links, one of my templates is not recognized.
>     SF> If I try the following link:
>     SF> org-protocol://capture?template=b&title=FlintFam.org+Home&url=http%3A%2F%2Fflintfam.org
>
>     SF> I get an error:
>
>     SF> *ERROR*: Capture template ‘b’: nil
>
> As it turns out, it can't find that template in any situation (including
> if it's called accurately).
>

Can you see the "b" choice in the capture menu?

I tried it with a minimal init.el, setting org-capture-templates as you describe
(and creating the ancillary structures as needed). Saving a link with `C-c l'
and then interactively calling org-capture and selecting the "b" template,
saves the link into ~/org/bookmarks.org.

I did not try with org-protocol.

> org-capture-templates is set as follows:
>
> (setq org-capture-templates
>       `(("a" "Create Appointment" entry
>          (file+olp "~/org/agenda.org" "Main Agenda, including diary" "Current")
>          (file "~/.emacs.d/org-capture-templates/appointment-template.org")
>          :empty-lines 1 :prepend nil)
>         ("t" "TODO Items")
>         ("tt" "Standard TODO" entry
>          (file+headline "~/org/main.org" "To Do")
>          (file "~/.emacs.d/org-capture-templates/todo-template.org")
>          :empty-lines 1)
>         ("td" "Deadline TODO" entry
>          (file+headline "~/org/main.org" "To Do")
>          (file "~/.emacs.d/org-capture-templates/todo-deadline-template.org")
>          :empty-lines 1)
>         ("tl" "Linked TODO" entry
>          (file+headline "~/org/main.org" "To Do")
>          (file "~/.emacs.d/org-capture-templates/todo-link-template.org")
>          :empty-lines 1)
>         ("n" "Notes")
>         ("nn" "General Notes" entry
>          (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
>          (file "~/.emacs.d/org-capture-templates/notes-journal-template.org")
>          :empty-lines 1)
>         ("nl" "Linked Note" entry
>          (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
>          (file "~/.emacs.d/org-capture-templates/linked-note-journal-template.org")
>          :empty-lines 1)
>         ("nq" "Quoting Note" entry
>          (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
>          (file "~/.emacs.d/org-capture-templates/quoting-note-journal-template.org")
>          :empty-lines 1)
>         ("nt" "Linked/Quoted Notes" entry
>          (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
>          (file "~/.emacs.d/org-capture-templates/technical-journal-template.org")
>          :empty-lines 1)
>         ("nd" "Note on Date" entry
>          (file+datetree+prompt ,(format-time-string "~/org/notes/%Y.org"))
>          (file "~/.emacs.d/org-capture-templates/notes-journal-template.org")
>          :empty-lines 1)
>         ("nc" "Clocking Notes")
>         ("ncn" "General Notes" entry
>          (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
>          (file "~/.emacs.d/org-capture-templates/notes-journal-template-clocking.org")
>          :empty-lines 1)
>         ("ncl" "Linked Note" entry
>          (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
>          (file "~/.emacs.d/org-capture-templates/linked-note-journal-template-clocking.org")
>          :empty-lines 1)
>         ("ncq" "Quoting Note" entry
>          (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
>          (file "~/.emacs.d/org-capture-templates/quoting-note-journal-template-clocking.org")
>          :empty-lines 1)
>         ("nct" "Linked/Quoted Notes" entry
>          (file+datetree ,(format-time-string "~/org/notes/%Y.org"))
>          (file "~/.emacs.d/org-capture-templates/technical-journal-template-clocking.org")
>          :empty-lines 1)
>         ("A" "Assignment" entry
>          (file "~/org/school.org")
>          (file "~/.emacs.d/org-capture-templates/assignment-template.org")
>          :empty-lines 1)
>         ("j" "Journal Entry" entry
>          (file+datetree ,(format-time-string "~/org/journal/%Y.org.gpg"))
>          (file "~/.emacs.d/org-capture-templates/journal-template.org")
>          :empty-lines 1)
>         ("c" "calfw2org" entry
>          (file+olp "~/org/agenda.org" "Main Agenda, including diary" "Current")
>          (file "~/.emacs.d/org-capture-templates/clfw-template.org")
>          :empty-lines 1)
>         ("b" "Bookmark" item
>          (file+olp "~/org/bookmarks.org" "Unsorted Bookmarks")
>          "%a"
>          :immediate-finish t)
>         ("m" "Mail Message Follow-up" entry
>          (file+olp "~/org/agenda.org" "Main Agenda, including diary" "Mail Message Follow-up")
>          (file "~/.emacs.d/org-capture-templates/mail-followup-template.org")
>          :immediate-finish t :empty-lines 1)))
>
>     SF> What can I do to fix this?
>
>     SF> Thanks,
>
>     SF> Sam Flint
>
>     SF> -- Samuel W. Flint 4096R/266596F4 (9477 D23E 389E 40C5 2F10 DE19
>     SF> 68E5 318E 2665 96F4) λs.(s s) λs.(s s)

-- 
Nick

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-06-14 17:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-11  2:41 Org Protocol error, does not recognize template Samuel W. Flint
2017-06-11  3:08 ` Samuel W. Flint
2017-06-11  7:15   ` Nicolas Goaziou
2017-06-11 16:43     ` Samuel W. Flint
2017-06-14 13:58       ` Nicolas Goaziou
2017-06-14 16:02         ` Samuel W. Flint
2017-06-14 16:31           ` Nicolas Goaziou
2017-06-14 17:05   ` Nick Dokos

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.