aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/simple.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/simple.el')
-rw-r--r--lisp/simple.el31
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.
4323When one selects something in another program to paste it into Emacs, 4323A non-nil value ensures that Emacs kill operations do not
4324but kills something in Emacs before actually pasting it, 4324irrevocably overwrite existing clipboard text by saving it to the
4325this selection is gone unless this variable is non-nil, 4325`kill-ring' prior to the kill. Such text can subsequently be
4326in which case the other program's selection is saved in the `kill-ring' 4326retrieved via \\[yank] \\[yank-pop]]."
4327before 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
4344the front of the kill ring, rather than being added to the list. 4343the front of the kill ring, rather than being added to the list.
4345 4344
4346When `save-interprogram-paste-before-kill' and `interprogram-paste-function' 4345When `save-interprogram-paste-before-kill' and `interprogram-paste-function'
4347are non-nil, saves the interprogram paste string(s) into `kill-ring' before 4346are non-nil, save the interprogram paste string(s) into `kill-ring' before
4348STRING. 4347STRING.
4349 4348
4350When the yank handler has a non-nil PARAM element, the original STRING 4349When 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.
4386When 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.
4392If BEFORE-P is non-nil, prepend STRING to the kill. 4394If BEFORE-P is non-nil, prepend STRING to the kill instead.
4393Also removes the last undo boundary in the current buffer, 4395If `interprogram-cut-function' is non-nil, call it with the
4394 depending on `kill-append-merge-undo'. 4396resulting kill.
4395If `interprogram-cut-function' is set, pass the resulting kill to it." 4397If `kill-append-merge-undo' is non-nil, remove the last undo
4398boundary 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)