lang/org: update +org/remove-link
To reflects changes made upstream, in org.
This commit is contained in:
parent
70c60e6583
commit
f816149589
1 changed files with 6 additions and 7 deletions
|
@ -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 ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue