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 () (defun +org/remove-link ()
"Unlink the text at point." "Unlink the text at point."
(interactive) (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")) (user-error "No link at point"))
(save-excursion (save-excursion
(let ((remove (list (match-beginning 0) (match-end 0))) (let ((label (if (match-end 2)
(description (if (match-end 3) (match-string-no-properties 2)
(match-string-no-properties 3) (org-link-unescape (match-string-no-properties 1)))))
(match-string-no-properties 1)))) (delete-region (match-beginning 0) (match-end 0))
(apply #'delete-region remove) (insert label))))
(insert description))))
;;;###autoload ;;;###autoload
(defun +org/toggle-checkbox () (defun +org/toggle-checkbox ()