(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:
(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)
)))