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.
This commit is contained in:
Nicolas Goaziou 2019-01-01 17:16:50 +01:00
parent f584d37a67
commit 284799a2e8
1 changed files with 1 additions and 1 deletions

View File

@ -9938,7 +9938,7 @@ Use TAB to complete link prefixes, then RET for type-specific completion support
(read-string "Description: " initial-input) (read-string "Description: " initial-input)
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)) (when remove (apply 'delete-region remove))
(insert (org-make-link-string link desc)) (insert (org-make-link-string link desc))
;; Redisplay so as the new link has proper invisible characters. ;; Redisplay so as the new link has proper invisible characters.