From mboxrd@z Thu Jan 1 00:00:00 1970 From: Allen Li Subject: [PATCH] Update documentation on org-protocol template placeholders Date: Sun, 15 Oct 2017 15:55:37 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3rop-0003K2-U0 for emacs-orgmode@gnu.org; Sun, 15 Oct 2017 18:55:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3roo-0004G6-OR for emacs-orgmode@gnu.org; Sun, 15 Oct 2017 18:55:40 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:56047) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3roo-0004Fr-JG for emacs-orgmode@gnu.org; Sun, 15 Oct 2017 18:55:38 -0400 Received: by mail-qt0-x242.google.com with SMTP id v41so18179146qtv.12 for ; Sun, 15 Oct 2017 15:55:38 -0700 (PDT) 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: Kaushal Modi Cc: emacs-orgmode@gnu.org, Carl Bolduc * doc/org.texi (@code{capture} protocol): Fix placeholder names (Template expansion): Add org-protocol placeholders * lisp/org.el (org-store-link-plist): Fix docstring grammar (org-store-link-props): Fix docstring grammar --- doc/org.texi | 25 +++++++++++++++++-------- lisp/org.el | 5 +++-- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index 999f3f719..4039e127a 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -7351,6 +7351,7 @@ gnus | %:group, @r{for messages also all email fiel eww, w3, w3m | %:url info | %:file %:node calendar | %:date +org-protocol | %:link %:description %:annotation @end smallexample @noindent @@ -7592,15 +7593,14 @@ javascript:location.href='org-protocol://store-link?url='+ @cindex capture protocol @cindex protocol, capture -@cindex capture, %:url placeholder -@cindex %:url template expansion in capture -@cindex capture, %:title placeholder -@cindex %:title template expansion in capture +@cindex capture, %:link placeholder +@cindex %:link template expansion in capture +@cindex capture, %:description placeholder +@cindex %:description template expansion in capture +@cindex capture, %:annotation placeholder +@cindex %:annotation template expansion in capture Activating @code{capture} handler pops up a @samp{Capture} buffer and fills -the capture template associated to the @samp{X} key with them. The template -refers to the data through @code{%:url} and @code{%:title} placeholders. -Moreover, any selected text in the browser is appended to the body of the -entry. +the capture template associated to the @samp{X} key with them. @example emacsclient org-protocol://capture?template=X?url=URL?title=TITLE?body=BODY @@ -7621,6 +7621,15 @@ The result depends on the capture template used, which is set in the bookmark itself, as in the example above, or in @code{org-protocol-default-template-key}. +The following template placeholders are available: + +@example +%:link The URL +%:description The webpage title +%:annotation Equivalent to [[%:link][%:description]] +%i The selected text +@end example + @node @code{open-source} protocol @subsection @code{open-source} protocol @cindex open-source protocol diff --git a/lisp/org.el b/lisp/org.el index d6cd77bf9..3bcfae72a 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9573,7 +9573,7 @@ sub-tree if optional argument INHERIT is non-nil." "Contains the links stored with `org-store-link'.") (defvar org-store-link-plist nil - "Plist with info about the most recently link created with `org-store-link'.") + "Plist with info about the most recent link created with `org-store-link'.") (defun org-store-link-functions () "Return a list of functions that are called to create and store a link. @@ -9847,7 +9847,8 @@ active region." (car org-stored-links))))) (defun org-store-link-props (&rest plist) - "Store link properties, extract names, addresses and dates." + "Store link properties. +The properties are preprocessed by extracting names, addresses and dates." (let ((x (plist-get plist :from))) (when x (let ((adr (mail-extract-address-components x))) -- 2.14.2