+2014-01-18 Jan Djärv <jan.h.d@swipnet.se>
+
+ * term/common-win.el (saved-region-selection): Defvar it.
+ (x-select-text): Set saved-region-selection (Bug#16382).
+
2014-01-18 Glenn Morris <rgm@gnu.org>
* emacs-lisp/authors.el (authors-aliases)
(defvar x-select-enable-primary) ; x-win.el
(defvar x-last-selected-text-primary)
(defvar x-last-selected-text-clipboard)
+(defvar saved-region-selection) ; simple.el
(defun x-select-text (text)
"Select TEXT, a string, according to the window system.
(x-set-selection 'PRIMARY text)
(setq x-last-selected-text-primary text))
(when x-select-enable-clipboard
+ ;; When cutting, the selection is cleared and PRIMARY set to
+ ;; the empty string. Prevent that, PRIMARY should not be reset
+ ;; by cut (Bug#16382).
+ (setq saved-region-selection text)
(x-set-selection 'CLIPBOARD text)
(setq x-last-selected-text-clipboard text))))))