lang/org: update +org/remove-link

To reflects changes made upstream, in org.
This commit is contained in:
Henrik Lissner 2019-09-07 15:07:27 -04:00
parent 70c60e6583
commit f816149589
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -298,15 +298,14 @@ wrong places)."
(defun +org/remove-link ()
"Unlink the text at point."
(interactive)
(unless (org-in-regexp org-bracket-link-regexp 1)
(unless (org-in-regexp org-link-bracket-re 1)
(user-error "No link at point"))
(save-excursion
(let ((remove (list (match-beginning 0) (match-end 0)))
(description (if (match-end 3)
(match-string-no-properties 3)
(match-string-no-properties 1))))
(apply #'delete-region remove)
(insert description))))
(let ((label (if (match-end 2)
(match-string-no-properties 2)
(org-link-unescape (match-string-no-properties 1)))))
(delete-region (match-beginning 0) (match-end 0))
(insert label))))
;;;###autoload
(defun +org/toggle-checkbox ()