mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
lang/org: update +org/remove-link
To reflects changes made upstream, in org.
This commit is contained in:
@ -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 ()
|
||||
|
Reference in New Issue
Block a user