diff options
Diffstat (limited to 'lisp/simple.el')
| -rw-r--r-- | lisp/simple.el | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index aa266fd36ba..9483170a0b6 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -4319,12 +4319,11 @@ ring directly.") | |||
| 4319 | "The tail of the kill ring whose car is the last thing yanked.") | 4319 | "The tail of the kill ring whose car is the last thing yanked.") |
| 4320 | 4320 | ||
| 4321 | (defcustom save-interprogram-paste-before-kill nil | 4321 | (defcustom save-interprogram-paste-before-kill nil |
| 4322 | "Save clipboard strings into kill ring before replacing them. | 4322 | "Save existing clipboard text into kill ring before replacing it. |
| 4323 | When one selects something in another program to paste it into Emacs, | 4323 | A non-nil value ensures that Emacs kill operations do not |
| 4324 | but kills something in Emacs before actually pasting it, | 4324 | irrevocably overwrite existing clipboard text by saving it to the |
| 4325 | this selection is gone unless this variable is non-nil, | 4325 | `kill-ring' prior to the kill. Such text can subsequently be |
| 4326 | in which case the other program's selection is saved in the `kill-ring' | 4326 | retrieved via \\[yank] \\[yank-pop]]." |
| 4327 | before the Emacs kill and one can still paste it using \\[yank] \\[yank-pop]." | ||
| 4328 | :type 'boolean | 4327 | :type 'boolean |
| 4329 | :group 'killing | 4328 | :group 'killing |
| 4330 | :version "23.2") | 4329 | :version "23.2") |
| @@ -4344,7 +4343,7 @@ Optional second argument REPLACE non-nil means that STRING will replace | |||
| 4344 | the front of the kill ring, rather than being added to the list. | 4343 | the front of the kill ring, rather than being added to the list. |
| 4345 | 4344 | ||
| 4346 | When `save-interprogram-paste-before-kill' and `interprogram-paste-function' | 4345 | When `save-interprogram-paste-before-kill' and `interprogram-paste-function' |
| 4347 | are non-nil, saves the interprogram paste string(s) into `kill-ring' before | 4346 | are non-nil, save the interprogram paste string(s) into `kill-ring' before |
| 4348 | STRING. | 4347 | STRING. |
| 4349 | 4348 | ||
| 4350 | When the yank handler has a non-nil PARAM element, the original STRING | 4349 | When the yank handler has a non-nil PARAM element, the original STRING |
| @@ -4379,20 +4378,24 @@ argument should still be a \"useful\" string for such uses." | |||
| 4379 | (if interprogram-cut-function | 4378 | (if interprogram-cut-function |
| 4380 | (funcall interprogram-cut-function string))) | 4379 | (funcall interprogram-cut-function string))) |
| 4381 | 4380 | ||
| 4382 | ;; It has been argued that this should work similar to `self-insert-command' | 4381 | ;; It has been argued that this should work like `self-insert-command' |
| 4383 | ;; which merges insertions in undo-list in groups of 20 (hard-coded in cmds.c). | 4382 | ;; which merges insertions in `buffer-undo-list' in groups of 20 |
| 4383 | ;; (hard-coded in `undo-auto-amalgamate'). | ||
| 4384 | (defcustom kill-append-merge-undo nil | 4384 | (defcustom kill-append-merge-undo nil |
| 4385 | "Whether appending to kill ring also makes \\[undo] restore both pieces of text simultaneously." | 4385 | "Amalgamate appending kills with the last kill for undo. |
| 4386 | When non-nil, appending or prepending text to the last kill makes | ||
| 4387 | \\[undo] restore both pieces of text simultaneously." | ||
| 4386 | :type 'boolean | 4388 | :type 'boolean |
| 4387 | :group 'killing | 4389 | :group 'killing |
| 4388 | :version "25.1") | 4390 | :version "25.1") |
| 4389 | 4391 | ||
| 4390 | (defun kill-append (string before-p) | 4392 | (defun kill-append (string before-p) |
| 4391 | "Append STRING to the end of the latest kill in the kill ring. | 4393 | "Append STRING to the end of the latest kill in the kill ring. |
| 4392 | If BEFORE-P is non-nil, prepend STRING to the kill. | 4394 | If BEFORE-P is non-nil, prepend STRING to the kill instead. |
| 4393 | Also removes the last undo boundary in the current buffer, | 4395 | If `interprogram-cut-function' is non-nil, call it with the |
| 4394 | depending on `kill-append-merge-undo'. | 4396 | resulting kill. |
| 4395 | If `interprogram-cut-function' is set, pass the resulting kill to it." | 4397 | If `kill-append-merge-undo' is non-nil, remove the last undo |
| 4398 | boundary in the current buffer." | ||
| 4396 | (let* ((cur (car kill-ring))) | 4399 | (let* ((cur (car kill-ring))) |
| 4397 | (kill-new (if before-p (concat string cur) (concat cur string)) | 4400 | (kill-new (if before-p (concat string cur) (concat cur string)) |
| 4398 | (or (= (length cur) 0) | 4401 | (or (= (length cur) 0) |