From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Wales Subject: Re: %( in capture template Date: Sun, 19 Feb 2017 16:34:07 -0700 Message-ID: References: <87bmveo58e.fsf@gmail.com> <87inpmug8c.fsf@nicolasgoaziou.fr> <87r32uzgzk.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfaza-00023G-Ba for emacs-orgmode@gnu.org; Sun, 19 Feb 2017 18:34:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfazZ-0003L2-B0 for emacs-orgmode@gnu.org; Sun, 19 Feb 2017 18:34:10 -0500 Received: from mail-ua0-x22b.google.com ([2607:f8b0:400c:c08::22b]:36675) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cfazZ-0003Kp-5M for emacs-orgmode@gnu.org; Sun, 19 Feb 2017 18:34:09 -0500 Received: by mail-ua0-x22b.google.com with SMTP id t17so47882695uae.3 for ; Sun, 19 Feb 2017 15:34:08 -0800 (PST) In-Reply-To: <87r32uzgzk.fsf@nicolasgoaziou.fr> 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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org On 2/19/17, Nicolas Goaziou wrote: > I have trouble understanding the double quote above. Do you mean the > text below is inserted within the %(concat ...) or are these your > templates? In this case, which one produces the error? thanks for asking about this. for clarity, let's do it from the beginning. [first please note that i am experiencing random results. sometimes it works fine but: 1] sometimes nothing shows up 2] sometimes as i will describe below 3] sometimes nothing shows up, but "Warning (emacs): Please update your org protocol handler to deal with new-style links." buffer pops up what i will describe is 2, which is the topic of this thread.] just now i selected the first two paragraphs of the quote of your email, and clicked the org-capture extension unicorn. i use this function: (defun alpha-org-protocol-string (link description region) (format "* x link %s description %s region %s " link description region)) the result of clicking on the unicorn: === ***** x link https://mail.google.com/mail/u/0/h/rfjkj7op114w/?&th=15a580ccf5cb9d34&v=c description Gmail - %( in capture template region %(alpha-org-protocol-string "https://mail.google.com/mail/u/0/h/rfjkj7op114w/?&th=15a580ccf5cb9d34&v=c" "Gmail - %( in capture template" "> with the new org maint code, i still occasionally get the literal string. %(alpha-org-protocol-string "https://mail.google.com/mail/u/0/h/rfjkj7op114w/?&th=15a580ccf5cb9d34&v=c" "Gmail - %( in capture template" "> %(alpha-org-protocol-string "https://mail.google.com/mail/u/0/h/rfjkj7op114w/?&th=15a580ccf5cb9d34&v=c" "Gmail - %( in capture template" "> it occurs when the region spans a blank line. === region should be what i selected. instead it is a garbled version of what i selected with the literal function call text. is this user error? the double quotes are as you see them. i did not add any. below are my templates. (add-to-list 'org-capture-templates `("L" "Protocol L for link" entry (file+headline ,org-default-notes-file "xyzzy-remember") ;; fixme perhaps i do not need the %i, if it is for no text "%(alpha-org-protocol-string \"%:link\" \"%:description\" \"%i\") L" :prepend t :immediate-finish t :jump-to-captured t)) ;; this seems to get called by org capture whether selection or not (add-to-list 'org-capture-templates `("p" "Protocol p" entry (file+headline ,org-default-notes-file "xyzzy-remember") "%(alpha-org-protocol-string \"%:link\" \"%:description\" \"%i\")" :prepend t :immediate-finish t :jump-to-captured t)) the org capture extension is set to p, so the second one should be the operative one. but what do i know? so perhaps %i is being set to some crazy value. i definitely do not understand any of this stuff.