[Top][All Lists]

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

[elpa] externals/xclip 84b363d 15/18: * xclip.el (xclip-get-selection):

From: Stefan Monnier
Subject: [elpa] externals/xclip 84b363d 15/18: * xclip.el (xclip-get-selection): Tell wl-paste not to add a newline
Date: Sat, 28 Nov 2020 14:27:57 -0500 (EST)

branch: externals/xclip
commit 84b363d8857de0c279bf84313143ec8c65ce411d
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * xclip.el (xclip-get-selection): Tell wl-paste not to add a newline
    Suggested by Nolan Wright <nolan@nolanwright.dev>.
 xclip.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/xclip.el b/xclip.el
index 1713bf7..ead5111 100644
--- a/xclip.el
+++ b/xclip.el
@@ -185,7 +185,12 @@ See also `x-set-selection'."
                   (replace-regexp-in-string "\\(.*\\)copy" "\\1paste"
                                             xclip-program 'fixedcase)
                   nil standard-output nil
-                  (if (memq type '(primary PRIMARY)) '("-p")))))
+                  ;; From wl-paste's doc:
+                  ;;   -n, --no-newline  Do not append a newline character
+                  ;;    after the pasted clipboard content. This option is
+                  ;;    automatically enabled for non-text content types and
+                  ;;    when using the --watch mode.
+                  "-n" (if (memq type '(primary PRIMARY)) '("-p")))))
          (when (memq type '(clipboard CLIPBOARD))
            (call-process xclip-program nil standard-output nil)))

reply via email to

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