summaryrefslogtreecommitdiff
path: root/lisp/simple.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2018-05-01 07:50:48 -0700
committerGlenn Morris <rgm@gnu.org>2018-05-01 07:50:48 -0700
commit62032f699a4969ffacd9b8ea9dccd3ce6b10051f (patch)
tree357983c747ff7af985339027113adbc942f0edcd /lisp/simple.el
parentb3b4697ff8b9093cef2cc3842dab731f37c9e2e1 (diff)
parent71be806d01c4e135f067bc842a9d684e594b4f35 (diff)
downloademacs-62032f699a4969ffacd9b8ea9dccd3ce6b10051f.tar.gz
emacs-62032f699a4969ffacd9b8ea9dccd3ce6b10051f.tar.bz2
emacs-62032f699a4969ffacd9b8ea9dccd3ce6b10051f.zip
Merge from origin/emacs-26
71be806 ; * etc/DEBUG: Minor clarification. 4403f89 Update the Emacs FAQ 40b3317 * etc/DEBUG: Minor copyedits. 850ff18 Clarify wording of NS drag n drop documentation 343d70b1 Improve kill-related documentation (bug#31209) 0b43224 * lisp/simple.el (region-extract-function): Don't hide the 'n... d6e2c59 Fix pre- and post-command-hook errors in term.el 6cf83131e * doc/lispref/display.texi (Glyphless Chars): Fix grammar. 88d178c Fix macOS drag n drop event documentation
Diffstat (limited to 'lisp/simple.el')
-rw-r--r--lisp/simple.el47
1 files changed, 25 insertions, 22 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 863547a76ba..5446159d319 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1067,14 +1067,14 @@ instead of deleted."
(t
(filter-buffer-substring (region-beginning) (region-end) method)))))
"Function to get the region's content.
-Called with one argument METHOD.
-If METHOD is `delete-only', then delete the region; the return value
-is undefined. If METHOD is nil, then return the content as a string.
-If METHOD is `bounds', then return the boundaries of the region
-as a list of cons cells of the form (START . END).
-If METHOD is anything else, delete the region and return its content
-as a string, after filtering it with `filter-buffer-substring', which
-is called with METHOD as its 3rd argument.")
+Called with one argument METHOD which can be:
+- nil: return the content as a string.
+- `delete-only': delete the region; the return value is undefined.
+- `bounds': return the boundaries of the region as a list of cons
+ cells of the form (START . END).
+- anything else: delete the region and return its content
+ as a string, after filtering it with `filter-buffer-substring', which
+ is called with METHOD as its 3rd argument.")
(defvar region-insert-function
(lambda (lines)
@@ -4355,12 +4355,11 @@ ring directly.")
"The tail of the kill ring whose car is the last thing yanked.")
(defcustom save-interprogram-paste-before-kill nil
- "Save clipboard strings into kill ring before replacing them.
-When one selects something in another program to paste it into Emacs,
-but kills something in Emacs before actually pasting it,
-this selection is gone unless this variable is non-nil,
-in which case the other program's selection is saved in the `kill-ring'
-before the Emacs kill and one can still paste it using \\[yank] \\[yank-pop]."
+ "Save existing clipboard text into kill ring before replacing it.
+A non-nil value ensures that Emacs kill operations do not
+irrevocably overwrite existing clipboard text by saving it to the
+`kill-ring' prior to the kill. Such text can subsequently be
+retrieved via \\[yank] \\[yank-pop]]."
:type 'boolean
:group 'killing
:version "23.2")
@@ -4380,7 +4379,7 @@ Optional second argument REPLACE non-nil means that STRING will replace
the front of the kill ring, rather than being added to the list.
When `save-interprogram-paste-before-kill' and `interprogram-paste-function'
-are non-nil, saves the interprogram paste string(s) into `kill-ring' before
+are non-nil, save the interprogram paste string(s) into `kill-ring' before
STRING.
When the yank handler has a non-nil PARAM element, the original STRING
@@ -4416,20 +4415,24 @@ argument should still be a \"useful\" string for such uses."
(if interprogram-cut-function
(funcall interprogram-cut-function string)))
-;; It has been argued that this should work similar to `self-insert-command'
-;; which merges insertions in undo-list in groups of 20 (hard-coded in cmds.c).
+;; It has been argued that this should work like `self-insert-command'
+;; which merges insertions in `buffer-undo-list' in groups of 20
+;; (hard-coded in `undo-auto-amalgamate').
(defcustom kill-append-merge-undo nil
- "Whether appending to kill ring also makes \\[undo] restore both pieces of text simultaneously."
+ "Amalgamate appending kills with the last kill for undo.
+When non-nil, appending or prepending text to the last kill makes
+\\[undo] restore both pieces of text simultaneously."
:type 'boolean
:group 'killing
:version "25.1")
(defun kill-append (string before-p)
"Append STRING to the end of the latest kill in the kill ring.
-If BEFORE-P is non-nil, prepend STRING to the kill.
-Also removes the last undo boundary in the current buffer,
- depending on `kill-append-merge-undo'.
-If `interprogram-cut-function' is set, pass the resulting kill to it."
+If BEFORE-P is non-nil, prepend STRING to the kill instead.
+If `interprogram-cut-function' is non-nil, call it with the
+resulting kill.
+If `kill-append-merge-undo' is non-nil, remove the last undo
+boundary in the current buffer."
(let* ((cur (car kill-ring)))
(kill-new (if before-p (concat string cur) (concat cur string))
(or (= (length cur) 0)