summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2019-01-01 17:16:50 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2019-01-01 17:16:50 +0100
commit284799a2e86be0d95abe3e5404a48e2c4f1fc8fc (patch)
treec5e65f872c8e123ed92fcfb12759ea58fccf37c1
parentf584d37a67c7e199957c040973dd85e9606e9469 (diff)
downloadorg-mode-284799a2e86be0d95abe3e5404a48e2c4f1fc8fc.tar.gz
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.
-rw-r--r--lisp/org.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 0a44556..8e1486e 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.