diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-20 17:03:59 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-12-20 17:03:59 -0200 |
commit | 72cdd44dbfe6266f33471012091b58f85d5b7d88 (patch) | |
tree | f8073789fe8b6b80c6454959d3d2cc2a43f341d4 | |
parent | abaad8b3c57355be672e13a2f5cdff3d651e91d0 (diff) |
sx-open-link takes link from clipboard by default
-rw-r--r-- | sx-interaction.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sx-interaction.el b/sx-interaction.el index ed8891b..2b41b35 100644 --- a/sx-interaction.el +++ b/sx-interaction.el @@ -131,7 +131,11 @@ If DATA is a question, also mark it as read." (defun sx-open-link (link) "Visit element given by LINK inside Emacs. Element can be a question, answer, or comment." - (interactive "sLink: ") + (interactive + (let ((def (with-temp-buffer + (save-excursion (yank)) + (thing-at-point 'url)))) + (list (read-string (concat "Link (" def "): ") nil nil def)))) (let ((data (sx--link-to-data link))) (sx-assoc-let data (cl-case .type |