Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun afs/org-replace-link-by-link-description ()
- "Replace an org link by its description or if empty its address"
- (interactive)
- (if (org-in-regexp org-bracket-link-regexp 1)
- (let ((remove (list (match-beginning 0) (match-end 0)))
- (description (if (match-end 3)
- (org-match-string-no-properties 3)
- (org-match-string-no-properties 1))))
- (apply 'delete-region remove)
- (insert description))))
- (fset 'my/org-remove-link
- [?M-a delete delete ?M-x ?z ?a ?p ?- ?t ?o ?- ?c ?h ?a ?r return ?[ ?C-e backspace backspace ?C-x])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement