emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 1dcf9a5: clipboard should still work even if interp


From: Sam Steingold
Subject: [Emacs-diffs] master 1dcf9a5: clipboard should still work even if interprogram-* is disabled
Date: Tue, 22 Dec 2015 17:05:52 +0000

branch: master
commit 1dcf9a5d2a727913bc53c68756bdaf6db5573671
Author: Sam Steingold <address@hidden>
Commit: Sam Steingold <address@hidden>

    clipboard should still work even if interprogram-* is disabled
    
    (clipboard-yank): When `interprogram-cut-function' is nil,
    bind it to `gui-selection-value' - the default value.
    (clipboard-kill-region, clipboard-kill-ring-save): When
    `interprogram-paste-function' is nil, bind it to `gui-select-text' -
    the default value.
---
 lisp/menu-bar.el |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 42f48c7..b22c1ea 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -535,19 +535,25 @@
 (defun clipboard-yank ()
   "Insert the clipboard contents, or the last stretch of killed text."
   (interactive "*")
-  (let ((gui-select-enable-clipboard t))
+  (let ((gui-select-enable-clipboard t)
+        (interprogram-paste-function (or interprogram-paste-function
+                                         #'gui-selection-value)))
     (yank)))
 
 (defun clipboard-kill-ring-save (beg end &optional region)
   "Copy region to kill ring, and save in the GUI's clipboard."
   (interactive "r\np")
-  (let ((gui-select-enable-clipboard t))
+  (let ((gui-select-enable-clipboard t)
+        (interprogram-cut-function (or interprogram-cut-function
+                                       #'gui-select-text)))
     (kill-ring-save beg end region)))
 
 (defun clipboard-kill-region (beg end &optional region)
   "Kill the region, and save it in the GUI's clipboard."
   (interactive "r\np")
-  (let ((gui-select-enable-clipboard t))
+  (let ((gui-select-enable-clipboard t)
+        (interprogram-cut-function (or interprogram-cut-function
+                                       #'gui-select-text)))
     (kill-region beg end region)))
 
 (defun menu-bar-enable-clipboard ()



reply via email to

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