Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy result to clipboard #144

Open
matheusfillipe opened this issue Aug 15, 2021 · 2 comments
Open

Copy result to clipboard #144

matheusfillipe opened this issue Aug 15, 2021 · 2 comments

Comments

@matheusfillipe
Copy link

I think it would be nice or desirable to optionally store the translation result to the clipboard. On linux I am currently doing that with this patch:

diff --git a/google-translate-core-ui.el b/google-translate-core-ui.el
index 9752409..17fb193 100644
--- a/google-translate-core-ui.el
+++ b/google-translate-core-ui.el
@@ -813,6 +813,7 @@ http://www.gnu.org/software/emacs/manual/html_node/elisp/The-Echo-Area.html)"
         (target-language (gtos-target-language gtos))
         (auto-detected-language (gtos-auto-detected-language gtos))
         (text (gtos-text gtos)))
+    (gui-set-selection 'CLIPBOARD translation)
     (insert
      (google-translate--translation-title gtos "Translate from %s to %s:\n")
      "\n"
@stardiviner
Copy link
Collaborator

  1. Not just Emacs GUI clipboard support, you might consider also support Emacs clipboard API clipboard-kill-region.
  2. Also, I think this might is not just the only function to add support for this.
  3. I suggest you fork and create Pull Request for your patch. That will be more simpler.

@carwin
Copy link

carwin commented Jan 23, 2022

👍 This would be very useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants