diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-29 03:36:29 +0000 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2014-11-29 03:36:29 +0000 |
commit | 9d39b0d1bcaa3186e21171f656b807fde2611b53 (patch) | |
tree | 037417936d90d32c3922fadc2d5bc5ad4fabeaf4 /sx-button.el | |
parent | 771bcf75deb0596331a539a57dcf37c278e34910 (diff) |
Improve button-copy
Diffstat (limited to 'sx-button.el')
-rw-r--r-- | sx-button.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sx-button.el b/sx-button.el index 3f532bb..aa77086 100644 --- a/sx-button.el +++ b/sx-button.el @@ -40,11 +40,14 @@ This is usually a link's URL, or the content of a code block." (interactive) (let ((content - (get-text-property - (point) 'sx-button-copy-content))) - (if content - (kill-new content) - (sx-message "Nothing to copy here.")))) + (get-text-property (point) 'sx-button-copy))) + (if (null content) + (sx-message "Nothing to copy here.") + (kill-new content) + (sx-message "Copied %s to kill ring." + (or (get-text-property + (point) 'sx-button-copy-type) + content))))) (defun sx-button-follow-link (&optional pos) "Follow link at POS. If POS is nil, use `point'." @@ -63,6 +66,7 @@ This is usually a link's URL, or the content of a code block." 'face 'sx-question-mode-title 'action #'sx-question-mode-hide-show-section 'help-echo 'sx-question-mode--section-help-echo + 'sx-button-copy-type "Share Link" :supertype 'sx-button) (define-button-type 'sx-button-link |