]> code.delx.au - gnu-emacs-elpa/blobdiff - xsel.el
multishell - migrate few away from obsolete multishell-buffer-name-history
[gnu-emacs-elpa] / xsel.el
diff --git a/xsel.el b/xsel.el
index a69a81d8cab43dd008f25070ca697e57c71f7166..8e958d9040a9f00e9ae59b22e281cb1f12e3f35f 100644 (file)
--- a/xsel.el
+++ b/xsel.el
@@ -29,14 +29,17 @@ Returns the resulting value for DISPLAY."
   (when (or arg (not (getenv "DISPLAY")))
     (setenv "DISPLAY"
             (read-from-minibuffer "DISPLAY: "
-                                  (or (getenv "DISPLAY") "localhost:10.0"))))
+                                  (or (getenv "DISPLAY") ":10.0"))))
   (getenv "DISPLAY")
   )
 
 (defun klm:xsel-copy (from to)
-  "Place contents of region in X copy/paste buffer, using shell command."
+  "Place contents of region in X copy/paste buffer, using shell command.
+
+With universal argument, prompt to set DISPLAY."
+
   (interactive "r")
-  (when (klm:xsel-check-get-DISPLAY)
+  (when (klm:xsel-check-get-DISPLAY current-prefix-arg)
     (let ((command (cond ((eq system-type 'darwin) "pbcopy")
                          ((eq system-type 'cygwin) "putclip")
                          ;; Linux &c:
@@ -48,10 +51,11 @@ Returns the resulting value for DISPLAY."
 (defun klm:xsel-paste ()
   "Place contents of region in X copy/paste buffer, using shell command."
   (interactive "")
-  (when (klm:xsel-check-get-DISPLAY)
+  (when (klm:xsel-check-get-DISPLAY current-prefix-arg)
     (let ((command (cond ((eq system-type 'darwin) "pbpaste")
                          ((eq system-type 'cygwin) "getclip")
                          ;; Linux &c:
                          (t "xsel --output --clipboard"))))
       (shell-command command 1)
+      (exchange-point-and-mark)
       )))