summaryrefslogtreecommitdiff
path: root/lisp/sort.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2014-01-25 17:10:18 -0800
committerGlenn Morris <rgm@gnu.org>2014-01-25 17:10:18 -0800
commit169d6004f9b348bec93f4feb6f3b06ce5c3f116c (patch)
treeeff2d340fd322c875efe64a3bf425fa04af943d3 /lisp/sort.el
parent3fcfc4ee802d2a6f041bd624876ac37fda830304 (diff)
downloademacs-169d6004f9b348bec93f4feb6f3b06ce5c3f116c.tar.gz
Some doc for delete-duplicate-lines
* doc/emacs/killing.texi (Deletion): Mention delete-duplicate-lines. * lisp/sort.el (delete-duplicate-lines): Doc fix. * etc/NEWS: Related edit.
Diffstat (limited to 'lisp/sort.el')
-rw-r--r--lisp/sort.el36
1 files changed, 17 insertions, 19 deletions
diff --git a/lisp/sort.el b/lisp/sort.el
index 9e89d0089b2..152345083fb 100644
--- a/lisp/sort.el
+++ b/lisp/sort.el
@@ -570,25 +570,23 @@ From a program takes two point or marker arguments, BEG and END."
;;;###autoload
(defun delete-duplicate-lines (beg end &optional reverse adjacent keep-blanks
interactive)
- "Delete duplicate lines in the region between BEG and END.
-
-If REVERSE is nil, search and delete duplicates forward keeping the first
-occurrence of duplicate lines. If REVERSE is non-nil (when called
-interactively with C-u prefix), search and delete duplicates backward
-keeping the last occurrence of duplicate lines.
-
-If ADJACENT is non-nil (when called interactively with two C-u prefixes),
-delete repeated lines only if they are adjacent. It works like the utility
-`uniq' and is useful when lines are already sorted in a large file since
-this is more efficient in performance and memory usage than when ADJACENT
-is nil that uses additional memory to remember previous lines.
-
-If KEEP-BLANKS is non-nil (when called interactively with three C-u prefixes),
-duplicate blank lines are preserved.
-
-When called from Lisp and INTERACTIVE is omitted or nil, return the number
-of deleted duplicate lines, do not print it; if INTERACTIVE is t, the
-function behaves in all respects as if it had been called interactively."
+ "Delete all but one copy of any identical lines in the region.
+Non-interactively, arguments BEG and END delimit the region.
+Normally it searches forwards, keeping the first instance of
+each identical line. If REVERSE is non-nil (interactively, with
+a C-u prefix), it searches backwards and keeps the last instance of
+each repeated line.
+
+Identical lines need not be adjacent, unless the argument
+ADJACENT is non-nil (interactively, with a C-u C-u prefix).
+This is a more efficient mode of operation, and may be useful
+on large regions that have already been sorted.
+
+If the argument KEEP-BLANKS is non-nil (interactively, with a
+C-u C-u C-u prefix), it retains repeated blank lines.
+
+Returns the number of deleted lines. Interactively, or if INTERACTIVE
+is non-nil, it also prints a message describing the number of deletions."
(interactive
(progn
(barf-if-buffer-read-only)