diff options
| author | Sam Steingold | 2015-12-22 12:02:30 -0500 |
|---|---|---|
| committer | Sam Steingold | 2015-12-22 12:02:30 -0500 |
| commit | 1dcf9a5d2a727913bc53c68756bdaf6db5573671 (patch) | |
| tree | 4d0ae5c5d108d42f2902f172862c0c28249086aa | |
| parent | 18689543204ab43bab72cffa8ba730660ddd9951 (diff) | |
| download | emacs-1dcf9a5d2a727913bc53c68756bdaf6db5573671.tar.gz emacs-1dcf9a5d2a727913bc53c68756bdaf6db5573671.zip | |
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.
| -rw-r--r-- | 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 42f48c784e1..b22c1eab907 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -535,19 +535,25 @@ | |||
| 535 | (defun clipboard-yank () | 535 | (defun clipboard-yank () |
| 536 | "Insert the clipboard contents, or the last stretch of killed text." | 536 | "Insert the clipboard contents, or the last stretch of killed text." |
| 537 | (interactive "*") | 537 | (interactive "*") |
| 538 | (let ((gui-select-enable-clipboard t)) | 538 | (let ((gui-select-enable-clipboard t) |
| 539 | (interprogram-paste-function (or interprogram-paste-function | ||
| 540 | #'gui-selection-value))) | ||
| 539 | (yank))) | 541 | (yank))) |
| 540 | 542 | ||
| 541 | (defun clipboard-kill-ring-save (beg end &optional region) | 543 | (defun clipboard-kill-ring-save (beg end &optional region) |
| 542 | "Copy region to kill ring, and save in the GUI's clipboard." | 544 | "Copy region to kill ring, and save in the GUI's clipboard." |
| 543 | (interactive "r\np") | 545 | (interactive "r\np") |
| 544 | (let ((gui-select-enable-clipboard t)) | 546 | (let ((gui-select-enable-clipboard t) |
| 547 | (interprogram-cut-function (or interprogram-cut-function | ||
| 548 | #'gui-select-text))) | ||
| 545 | (kill-ring-save beg end region))) | 549 | (kill-ring-save beg end region))) |
| 546 | 550 | ||
| 547 | (defun clipboard-kill-region (beg end &optional region) | 551 | (defun clipboard-kill-region (beg end &optional region) |
| 548 | "Kill the region, and save it in the GUI's clipboard." | 552 | "Kill the region, and save it in the GUI's clipboard." |
| 549 | (interactive "r\np") | 553 | (interactive "r\np") |
| 550 | (let ((gui-select-enable-clipboard t)) | 554 | (let ((gui-select-enable-clipboard t) |
| 555 | (interprogram-cut-function (or interprogram-cut-function | ||
| 556 | #'gui-select-text))) | ||
| 551 | (kill-region beg end region))) | 557 | (kill-region beg end region))) |
| 552 | 558 | ||
| 553 | (defun menu-bar-enable-clipboard () | 559 | (defun menu-bar-enable-clipboard () |