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 ()
|
||||
"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 ()
|
||||
|
|
Loading…
Reference in a new issue