[Top][All Lists]

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

[elpa] master e17a785: * packages/xclip/xclip.el: Tweak last patch

From: Stefan Monnier
Subject: [elpa] master e17a785: * packages/xclip/xclip.el: Tweak last patch
Date: Tue, 2 Jul 2019 00:46:41 -0400 (EDT)

branch: master
commit e17a78597cee72d685fe8d6e8593a72d1e88d96f
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * packages/xclip/xclip.el: Tweak last patch
    (xclip-method): Shorten tag.
    (xclip-set-selection, xclip-get-selection): Only use termux-clipboard
    when `type` is `clipboard`.
 packages/xclip/xclip.el | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/packages/xclip/xclip.el b/packages/xclip/xclip.el
index 28c8327..1713bf7 100644
--- a/packages/xclip/xclip.el
+++ b/packages/xclip/xclip.el
@@ -5,7 +5,7 @@
 ;; Author: Leo Liu <address@hidden>
 ;; Keywords: convenience, tools
 ;; Created: 2007-12-30
-;; Version: 1.8
+;; Version: 1.9
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -32,7 +32,8 @@
 ;;   http://www.vergenet.net/~conrad/software/xsel/ respectively).
 ;; - MacOS: `pbpaste/pbcopy'
 ;; - Cygwin: `getclip/putclip'
-;; - Termux: `termux-clipboard-get/termux-clipboard-set'
+;; - Under Wayland: `wl-clipboard' (https://github.com/bugaevc/wl-clipboard)
+;; - Termux: `termux-clipboard-get/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,
@@ -76,7 +77,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) 
+   (and (executable-find "termux-clipboard-get") 'termux-clipboard-get)
    (and (fboundp 'x-create-frame) (getenv "DISPLAY") 'emacs)
   "Method to use to access the GUI's clipboard.
@@ -88,7 +89,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" 
+          (const :tag "Termux: termux-clipboard-get/set" termux-clipboard-get)
           (const :tag "X11: Emacs" emacs)))
 (defcustom xclip-program (symbol-name xclip-method)
@@ -140,11 +141,11 @@ See also `x-set-selection'."
                         "wl-copy" nil xclip-program
                         (if (memq type '(primary PRIMARY)) '("-p")))))
-               (start-process "termux-clipboard-set" nil
-                              (replace-regexp-in-string
-                               "\\(.*\\)termux-clipboard-get"
-                               "\\1termux-clipboard-set"
-                               xclip-program 'fixedcase)))
+               (when (memq type '(clipboard CLIPBOARD))
+                 (start-process "termux-clipboard-set" nil
+                                (replace-regexp-in-string
+                                 "\\(.*\\)get" "\\1set"
+                                 xclip-program 'fixedcase))))
               (method (error "Unknown `xclip-method': %S" method)))))
       (when proc
         (process-send-string proc data)
@@ -186,7 +187,8 @@ See also `x-set-selection'."
                   nil standard-output nil
                   (if (memq type '(primary PRIMARY)) '("-p")))))
-         (call-process xclip-program nil standard-output nil))
+         (when (memq type '(clipboard CLIPBOARD))
+           (call-process xclip-program nil standard-output nil)))
         (method (error "Unknown `xclip-method': %S" method))))))

reply via email to

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