diff options
-rw-r--r-- | lisp/simple.el | 23 |
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." :version "24.1") (defvar region-extract-function - (lambda (delete) + (lambda (method) (when (region-beginning) (cond - ((eq delete 'bounds) + ((eq method 'bounds) (list (cons (region-beginning) (region-end)))) - ((eq delete 'delete-only) + ((eq method 'delete-only) (delete-region (region-beginning) (region-end))) (t - (filter-buffer-substring (region-beginning) (region-end) delete))))) + (filter-buffer-substring (region-beginning) (region-end) method))))) "Function to get the region's content. -Called with one argument DELETE. -If DELETE is `delete-only', then only delete the region and the return value -is undefined. If DELETE is nil, just return the content as a string. -If DELETE is `bounds', then don't delete, but just return the -boundaries of the region as a list of (START . END) positions. -If anything else, delete the region and return its content as a string, -after filtering it with `filter-buffer-substring'.") +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 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.") (defvar region-insert-function (lambda (lines) |