[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gpastel 8444716 5/9: Send Emacs text to GPaste when in
From: |
Damien Cassou |
Subject: |
[elpa] externals/gpastel 8444716 5/9: Send Emacs text to GPaste when in a terminal |
Date: |
Sat, 29 Dec 2018 09:09:14 -0500 (EST) |
branch: externals/gpastel
commit 844471659bb8d96472899c292ea054505fef04db
Author: Stefan Monnier <address@hidden>
Commit: Damien Cassou <address@hidden>
Send Emacs text to GPaste when in a terminal
---
gpastel.el | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/gpastel.el b/gpastel.el
index 5889006..1074ae7 100644
--- a/gpastel.el
+++ b/gpastel.el
@@ -160,5 +160,26 @@ all text in the GPaste clipboard."
(gpastel--start-listening)
(gpastel--stop-listening)))
+(cl-defmethod gui-backend-set-selection (selection-symbol value
+ &context
(window-system nil))
+ (if (not (and gpastel-mode (eq selection-symbol 'CLIPBOARD)))
+ (cl-call-next-method)
+ (gpastel-dbus-call #'dbus-call-method "Add" value)))
+
+;; BIG UGLY HACK!
+;; xterm.el has a defmethod to use some (poorly supported) escape
+;; sequences (code named OSC 52) for clipboard interaction, and enables
+;; it by default.
+;; Problem is, that its defmethod takes precedence over our defmethod,
+;; so we need to disable it in order to be called.
+(cl-defmethod gui-backend-set-selection :extra "gpastel-override"
+ (selection-symbol value
+ &context (window-system nil)
+ ((terminal-parameter nil 'xterm--set-selection) (eql t)))
+ ;; Disable this method which doesn't work anyway in 99% of the cases!
+ (setf (terminal-parameter nil 'xterm--set-selection) nil)
+ ;; Try again!
+ (gui-backend-set-selection selection-symbol value))
+
(provide 'gpastel)
;;; gpastel.el ends here
- [elpa] externals/gpastel updated (6241ad0 -> 8a5522b), Damien Cassou, 2018/12/29
- [elpa] externals/gpastel 5c62ffe 7/9: Upgrade Emacs requirement to at least 25, Damien Cassou, 2018/12/29
- [elpa] externals/gpastel 8444716 5/9: Send Emacs text to GPaste when in a terminal,
Damien Cassou <=
- [elpa] externals/gpastel f0aa34e 6/9: Use package-lint from the master branch, Damien Cassou, 2018/12/29
- [elpa] externals/gpastel d13d03f 3/9: Make 2 functions private, Damien Cassou, 2018/12/29
- [elpa] externals/gpastel 6e8e858 4/9: Remove useless :group properties, Damien Cassou, 2018/12/29
- [elpa] externals/gpastel c937091 8/9: * gpastel.el (gpastel-mode): Remove useless :require, Damien Cassou, 2018/12/29
- [elpa] externals/gpastel 184539c 2/9: Merge pull request #3 from clemera/master, Damien Cassou, 2018/12/29
- [elpa] externals/gpastel 8a5522b 9/9: * gpastel.el: Release v0.5.0, Damien Cassou, 2018/12/29
- [elpa] externals/gpastel c32e57f 1/9: Add `gpastel-update-hook`, Damien Cassou, 2018/12/29