From 284799a2e86be0d95abe3e5404a48e2c4f1fc8fc Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 1 Jan 2019 17:16:50 +0100 Subject: [PATCH] Fix `org-insert-link' with nil description * lisp/org.el (org-insert-link): DESC may be nil; do not use `string-match' directly on it. --- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 0a44556d1..8e1486ea0 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9938,7 +9938,7 @@ Use TAB to complete link prefixes, then RET for type-specific completion support (read-string "Description: " initial-input) initial-input)))) - (unless (string-match "\\S-" desc) (setq desc nil)) + (unless (org-string-nw-p desc) (setq desc nil)) (when remove (apply 'delete-region remove)) (insert (org-make-link-string link desc)) ;; Redisplay so as the new link has proper invisible characters.