Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. (defun afs/org-replace-link-by-link-description ()
  2. "Replace an org link by its description or if empty its address"
  3. (interactive)
  4. (if (org-in-regexp org-bracket-link-regexp 1)
  5. (let ((remove (list (match-beginning 0) (match-end 0)))
  6. (description (if (match-end 3)
  7. (org-match-string-no-properties 3)
  8. (org-match-string-no-properties 1))))
  9. (apply 'delete-region remove)
  10. (insert description))))
  11.  
  12. (fset 'my/org-remove-link
  13. [?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