From: Allen Li <darkfeline@felesatra.moe>
To: Org Mode List <emacs-orgmode@gnu.org>
Subject: Bug: protocol capture without url corrupts org-stored-links [9.1.14 (9.1.14-1059-gadec50-elpaplus @ /home/ionasal/.emacs.d/elpa/org-plus-contrib-20181211/)]
Date: Tue, 11 Dec 2018 19:18:50 -0800 [thread overview]
Message-ID: <CADbSrJz_JG5X890gvTpkRjO-paQU=he6yUkShBq6toywLh7psA@mail.gmail.com> (raw)
Using Org protocol capture without supplying a URL inserts a corrupt
entry into org-stored-links (nil ""). The nil causes a type error later
in org-insert-link.
(defun org-protocol-do-capture (info)
"Perform the actual capture based on INFO."
(let* ((temp-parts (org-protocol-parse-parameters info))
(parts
(cond
((and (listp info) (symbolp (car info))) info)
((= (length (car temp-parts)) 1) ;; First parameter is exactly one
character long
(org-protocol-assign-parameters temp-parts '(:template :url :title :body)))
(t
(org-protocol-assign-parameters temp-parts '(:url :title :body)))))
(template (or (plist-get parts :template)
org-protocol-default-template-key))
(url (and (plist-get parts :url) (org-protocol-sanitize-uri (plist-get
parts :url))))
(type (and url (string-match "^\\([a-z]+\\):" url) (match-string 1 url)))
(title (or (plist-get parts :title) ""))
(region (or (plist-get parts :body) ""))
(orglink (if url
(org-make-link-string
url (if (string-match "[^[:space:]]" title) title url))
title))
(org-capture-link-is-already-stored t)) ;; avoid call to org-store-link
(setq org-stored-links
(cons (list url title) org-stored-links))
Emacs : GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
of 2018-07-05
Package: Org mode version 9.1.14 (9.1.14-1059-gadec50-elpaplus @
/home/ionasal/.emacs.d/elpa/org-plus-contrib-20181211/)
next reply other threads:[~2018-12-12 3:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-12 3:18 Allen Li [this message]
2018-12-12 3:38 ` Bug: protocol capture without url corrupts org-stored-links [9.1.14 (9.1.14-1059-gadec50-elpaplus @ /home/ionasal/.emacs.d/elpa/org-plus-contrib-20181211/)] Allen Li
2018-12-12 16:38 ` Nicolas Goaziou
2018-12-12 22:59 ` Allen Li
2018-12-18 8:34 ` Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CADbSrJz_JG5X890gvTpkRjO-paQU=he6yUkShBq6toywLh7psA@mail.gmail.com' \
--to=darkfeline@felesatra.moe \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).