emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 0137930: xclip.el: Add support for termux-clipboard-get/se


From: Stefan Monnier
Subject: [elpa] master 0137930: xclip.el: Add support for termux-clipboard-get/set
Date: Tue, 2 Jul 2019 00:38:13 -0400 (EDT)

branch: master
commit 01379303e3584f22eec0b211855c630a5026c4e7
Author: Sacha Chua <address@hidden>
Commit: Stefan Monnier <address@hidden>

    xclip.el: Add support for termux-clipboard-get/set
    
    * packages/xclip/xclip.el (xclip-method): Add termux-clipboard-get.
    (xclip-set-selection): Use termux-clipboard-set if specified.
    (xclip-get-selection): Use termux-clipboard-get if specified.
---
 packages/xclip/xclip.el | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/packages/xclip/xclip.el b/packages/xclip/xclip.el
index 2c7be8c..28c8327 100644
--- a/packages/xclip/xclip.el
+++ b/packages/xclip/xclip.el
@@ -32,6 +32,7 @@
 ;;   http://www.vergenet.net/~conrad/software/xsel/ respectively).
 ;; - MacOS: `pbpaste/pbcopy'
 ;; - Cygwin: `getclip/putclip'
+;; - Termux: `termux-clipboard-get/termux-clipboard-set'
 ;; - Emacs: It can also use Emacs's built-in GUI support to talk to the GUI.
 ;;   This requires an Emacs built with GUI support.
 ;;   It uses `make-frame-on-display' which has been tested to work under X11,
@@ -75,6 +76,7 @@ If non-nil `xclip-program' is ignored.")
    (and (executable-find "xclip") 'xclip)
    (and (executable-find "xsel") 'xsel)
    (and (executable-find "wl-copy") 'wl-copy) ;github.com/bugaevc/wl-clipboard
+   (and (executable-find "termux-clipboard-get") 'termux-clipboard-get) 
;github.com/bugaevc/wl-clipboard
    (and (fboundp 'x-create-frame) (getenv "DISPLAY") 'emacs)
    'xclip)
   "Method to use to access the GUI's clipboard.
@@ -86,6 +88,7 @@ and `getclip' under Cygwin, or `emacs' to use Emacs's GUI 
code for that."
           (const :tag "X11: xclip" xclip)
           (const :tag "X11: xsel" xsel)
           (const :tag "Wayland: wl-copy" wl-copy)
+          (const :tag "Termux: termux-clipboard-get/termux-clipboard-set" 
termux-clipboard-get)
           (const :tag "X11: Emacs" emacs)))
 
 (defcustom xclip-program (symbol-name xclip-method)
@@ -136,6 +139,12 @@ See also `x-set-selection'."
                  (apply #'start-process
                         "wl-copy" nil xclip-program
                         (if (memq type '(primary PRIMARY)) '("-p")))))
+              (`termux-clipboard-get
+               (start-process "termux-clipboard-set" nil
+                              (replace-regexp-in-string
+                               "\\(.*\\)termux-clipboard-get"
+                               "\\1termux-clipboard-set"
+                               xclip-program 'fixedcase)))
               (method (error "Unknown `xclip-method': %S" method)))))
       (when proc
         (process-send-string proc data)
@@ -176,6 +185,8 @@ See also `x-set-selection'."
                                             xclip-program 'fixedcase)
                   nil standard-output nil
                   (if (memq type '(primary PRIMARY)) '("-p")))))
+        (`termux-clipboard-get
+         (call-process xclip-program nil standard-output nil))
         (method (error "Unknown `xclip-method': %S" method))))))
 
 ;;;###autoload



reply via email to

[Prev in Thread] Current Thread [Next in Thread]