From mboxrd@z Thu Jan 1 00:00:00 1970 From: Allen Li 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 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]:43729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gWv3D-0007sA-6z for emacs-orgmode@gnu.org; Tue, 11 Dec 2018 22:19:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gWv39-0007Ax-G9 for emacs-orgmode@gnu.org; Tue, 11 Dec 2018 22:19:05 -0500 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]:40364) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gWv39-0007AY-1w for emacs-orgmode@gnu.org; Tue, 11 Dec 2018 22:19:03 -0500 Received: by mail-io1-xd2e.google.com with SMTP id n9so13652559ioh.7 for ; Tue, 11 Dec 2018 19:19:02 -0800 (PST) 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: Org Mode List 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/)