aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/select.el15
2 files changed, 22 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2067128fbe8..ef35353bb0f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12011-05-27 Chong Yidong <cyd@stupidchicken.com>
2
3 * select.el: Support clipboard managers with built-in function
4 x-clipboard-manager-save, via delete-frame-functions and
5 kill-emacs-hook.
6 (xselect-convert-to-targets): Add MULTIPLE target to list.
7 (xselect-convert-to-save-targets): New function.
8
12011-05-27 Kenichi Handa <handa@m17n.org> 92011-05-27 Kenichi Handa <handa@m17n.org>
2 10
3 * mail/sendmail.el (mail-encode-header): Avoid double encoding by 11 * mail/sendmail.el (mail-encode-header): Avoid double encoding by
diff --git a/lisp/select.el b/lisp/select.el
index 1f5191e86c1..5abbf8f795d 100644
--- a/lisp/select.el
+++ b/lisp/select.el
@@ -289,7 +289,9 @@ two markers or an overlay. Otherwise, it is nil."
289 289
290(defun xselect-convert-to-targets (_selection _type _value) 290(defun xselect-convert-to-targets (_selection _type _value)
291 ;; return a vector of atoms, but remove duplicates first. 291 ;; return a vector of atoms, but remove duplicates first.
292 (let* ((all (cons 'TIMESTAMP (mapcar 'car selection-converter-alist))) 292 (let* ((all (cons 'TIMESTAMP
293 (cons 'MULTIPLE
294 (mapcar 'car selection-converter-alist))))
293 (rest all)) 295 (rest all))
294 (while rest 296 (while rest
295 (cond ((memq (car rest) (cdr rest)) 297 (cond ((memq (car rest) (cdr rest))
@@ -365,6 +367,12 @@ This function returns the string \"emacs\"."
365(defun xselect-convert-to-identity (_selection _type value) ; used internally 367(defun xselect-convert-to-identity (_selection _type value) ; used internally
366 (vector value)) 368 (vector value))
367 369
370;; Null target that tells clipboard managers we support SAVE_TARGETS
371;; (see freedesktop.org Clipboard Manager spec).
372(defun xselect-convert-to-save-targets (selection _type _value)
373 (when (eq selection 'CLIPBOARD)
374 'NULL))
375
368(setq selection-converter-alist 376(setq selection-converter-alist
369 '((TEXT . xselect-convert-to-string) 377 '((TEXT . xselect-convert-to-string)
370 (COMPOUND_TEXT . xselect-convert-to-string) 378 (COMPOUND_TEXT . xselect-convert-to-string)
@@ -384,8 +392,13 @@ This function returns the string \"emacs\"."
384 (NAME . xselect-convert-to-name) 392 (NAME . xselect-convert-to-name)
385 (ATOM . xselect-convert-to-atom) 393 (ATOM . xselect-convert-to-atom)
386 (INTEGER . xselect-convert-to-integer) 394 (INTEGER . xselect-convert-to-integer)
395 (SAVE_TARGETS . xselect-convert-to-save-targets)
387 (_EMACS_INTERNAL . xselect-convert-to-identity))) 396 (_EMACS_INTERNAL . xselect-convert-to-identity)))
388 397
398(when (fboundp 'x-clipboard-manager-save)
399 (add-hook 'delete-frame-functions 'x-clipboard-manager-save)
400 (add-hook 'kill-emacs-hook 'x-clipboard-manager-save))
401
389(provide 'select) 402(provide 'select)
390 403
391;;; select.el ends here 404;;; select.el ends here