aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/simple.el23
1 files changed, 12 insertions, 11 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 3d23fc35596..e3d86abe87a 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -996,23 +996,24 @@ instead of deleted."
996 :version "24.1") 996 :version "24.1")
997 997
998(defvar region-extract-function 998(defvar region-extract-function
999 (lambda (delete) 999 (lambda (method)
1000 (when (region-beginning) 1000 (when (region-beginning)
1001 (cond 1001 (cond
1002 ((eq delete 'bounds) 1002 ((eq method 'bounds)
1003 (list (cons (region-beginning) (region-end)))) 1003 (list (cons (region-beginning) (region-end))))
1004 ((eq delete 'delete-only) 1004 ((eq method 'delete-only)
1005 (delete-region (region-beginning) (region-end))) 1005 (delete-region (region-beginning) (region-end)))
1006 (t 1006 (t
1007 (filter-buffer-substring (region-beginning) (region-end) delete))))) 1007 (filter-buffer-substring (region-beginning) (region-end) method)))))
1008 "Function to get the region's content. 1008 "Function to get the region's content.
1009Called with one argument DELETE. 1009Called with one argument METHOD.
1010If DELETE is `delete-only', then only delete the region and the return value 1010If METHOD is `delete-only', then delete the region; the return value
1011is undefined. If DELETE is nil, just return the content as a string. 1011is undefined. If METHOD is nil, then return the content as a string.
1012If DELETE is `bounds', then don't delete, but just return the 1012If METHOD is `bounds', then return the boundaries of the region
1013boundaries of the region as a list of (START . END) positions. 1013as a list of the form (START . END).
1014If anything else, delete the region and return its content as a string, 1014If METHOD is anything else, delete the region and return its content
1015after filtering it with `filter-buffer-substring'.") 1015as a string, after filtering it with `filter-buffer-substring', which
1016is called with METHOD as its 3rd argument.")
1016 1017
1017(defvar region-insert-function 1018(defvar region-insert-function
1018 (lambda (lines) 1019 (lambda (lines)