diff options
| author | Richard M. Stallman | 2007-12-25 20:19:13 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2007-12-25 20:19:13 +0000 |
| commit | 4496b02bedf7bf5c98249ae486ca80bd049fa9f0 (patch) | |
| tree | de7b14cf273cda56e6ae195641a249855307931c | |
| parent | 63571b5a84eaec1b14768d284f4613502810a1d7 (diff) | |
| download | emacs-4496b02bedf7bf5c98249ae486ca80bd049fa9f0.tar.gz emacs-4496b02bedf7bf5c98249ae486ca80bd049fa9f0.zip | |
(yank-pop-change-selection): New option.
(current-kill): Obey it.
| -rw-r--r-- | etc/NEWS | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/simple.el | 25 |
3 files changed, 27 insertions, 4 deletions
| @@ -165,6 +165,10 @@ makes the new region into the primary selection (for interaction with | |||
| 165 | other window applications). If you enable this, you might want to bind | 165 | other window applications). If you enable this, you might want to bind |
| 166 | `mouse-yank-primary' to Mouse-2. | 166 | `mouse-yank-primary' to Mouse-2. |
| 167 | 167 | ||
| 168 | ** If `yank-pop-change-selection' is t, rotating the kill ring | ||
| 169 | also updates the selection or clipboard to the current yank, | ||
| 170 | just as M-w would do so with the text it copies to the kill ring. | ||
| 171 | |||
| 168 | ** Minibuffer changes: | 172 | ** Minibuffer changes: |
| 169 | 173 | ||
| 170 | *** In C-x d, if you type M-n you get the visited file name of the | 174 | *** In C-x d, if you type M-n you get the visited file name of the |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 27a302d7d01..0c80dccccf1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | * simple.el (select-active-regions): New option. | 3 | * simple.el (select-active-regions): New option. |
| 4 | (set-mark): Obey it. | 4 | (set-mark): Obey it. |
| 5 | (yank-pop-change-selection): New option. | ||
| 6 | (current-kill): Obey it. | ||
| 5 | 7 | ||
| 6 | 2007-12-25 David Golden <david.delaharpe.golden@gmail.com> (tiny change) | 8 | 2007-12-25 David Golden <david.delaharpe.golden@gmail.com> (tiny change) |
| 7 | 9 | ||
diff --git a/lisp/simple.el b/lisp/simple.el index f4a5b51a68c..3a17af8a3d3 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -2659,13 +2659,26 @@ If `interprogram-cut-function' is set, pass the resulting kill to it." | |||
| 2659 | (equal yank-handler (get-text-property 0 'yank-handler cur))) | 2659 | (equal yank-handler (get-text-property 0 'yank-handler cur))) |
| 2660 | yank-handler))) | 2660 | yank-handler))) |
| 2661 | 2661 | ||
| 2662 | (defcustom yank-pop-change-selection nil | ||
| 2663 | "If non-nil, rotating the kill ring changes the window system selection." | ||
| 2664 | :type 'boolean | ||
| 2665 | :group 'killing | ||
| 2666 | :version "23.1") | ||
| 2667 | |||
| 2662 | (defun current-kill (n &optional do-not-move) | 2668 | (defun current-kill (n &optional do-not-move) |
| 2663 | "Rotate the yanking point by N places, and then return that kill. | 2669 | "Rotate the yanking point by N places, and then return that kill. |
| 2664 | If N is zero, `interprogram-paste-function' is set, and calling it returns a | 2670 | If N is zero, `interprogram-paste-function' is set, and calling it returns a |
| 2665 | string or list of strings, then that string (or list) is added to the front | 2671 | string or list of strings, then that string (or list) is added to the front |
| 2666 | of the kill ring and the string (or first string in the list) is returned as | 2672 | of the kill ring and the string (or first string in the list) is returned as |
| 2667 | the latest kill. If optional arg DO-NOT-MOVE is non-nil, then don't | 2673 | the latest kill. |
| 2668 | actually move the yanking point; just return the Nth kill forward." | 2674 | |
| 2675 | If N is not zero, and if `yank-pop-change-selection' is | ||
| 2676 | non-nil, use `interprogram-cut-function' to transfer the | ||
| 2677 | kill at the new yank point into the window system selection. | ||
| 2678 | |||
| 2679 | If optional arg DO-NOT-MOVE is non-nil, then don't actually | ||
| 2680 | move the yanking point; just return the Nth kill forward." | ||
| 2681 | |||
| 2669 | (let ((interprogram-paste (and (= n 0) | 2682 | (let ((interprogram-paste (and (= n 0) |
| 2670 | interprogram-paste-function | 2683 | interprogram-paste-function |
| 2671 | (funcall interprogram-paste-function)))) | 2684 | (funcall interprogram-paste-function)))) |
| @@ -2684,8 +2697,12 @@ actually move the yanking point; just return the Nth kill forward." | |||
| 2684 | (nthcdr (mod (- n (length kill-ring-yank-pointer)) | 2697 | (nthcdr (mod (- n (length kill-ring-yank-pointer)) |
| 2685 | (length kill-ring)) | 2698 | (length kill-ring)) |
| 2686 | kill-ring))) | 2699 | kill-ring))) |
| 2687 | (or do-not-move | 2700 | (unless do-not-move |
| 2688 | (setq kill-ring-yank-pointer ARGth-kill-element)) | 2701 | (setq kill-ring-yank-pointer ARGth-kill-element) |
| 2702 | (when (and yank-pop-change-selection | ||
| 2703 | (> n 0) | ||
| 2704 | interprogram-cut-function) | ||
| 2705 | (funcall interprogram-cut-function (car ARGth-kill-element)))) | ||
| 2689 | (car ARGth-kill-element))))) | 2706 | (car ARGth-kill-element))))) |
| 2690 | 2707 | ||
| 2691 | 2708 | ||