Created
November 18, 2021 14:48
-
-
Save Luctins/73922233a16036f45d7d040d5a01d355 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun org-format-hyperlink (link-text-start link-text-end) | |
"Format the selected text as a orgmode link prompting for the link" | |
(interactive "r") | |
;(setq clip (shell-command-to-string "xclip -selection clip -t TEXT -o")) | |
(setq dest-link (read-string "Link to insert: ")); nil nil (nth 0 kill-ring))) | |
(if (not (string-blank-p dest-link)) | |
(progn (goto-char link-text-start) | |
(setq tmp-link (concat `"[[" dest-link `"][" (buffer-substring link-text-start link-text-end) '"]]")) | |
(delete-region link-text-start link-text-end) | |
(insert tmp-link)) | |
(message "Empty link") | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment