Commit 169d6004 authored by Glenn Morris's avatar Glenn Morris
Browse files

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.
parent 3fcfc4ee
2014-01-26 Glenn Morris <rgm@gnu.org>
* killing.texi (Deletion): Mention delete-duplicate-lines.
2014-01-24 Glenn Morris <rgm@gnu.org> 2014-01-24 Glenn Morris <rgm@gnu.org>
* ack.texi (Acknowledgments): No longer mention obsolete xesam.el, * ack.texi (Acknowledgments): No longer mention obsolete xesam.el,
......
...@@ -136,6 +136,17 @@ the current line). On a solitary blank line, it deletes that line. ...@@ -136,6 +136,17 @@ the current line). On a solitary blank line, it deletes that line.
previous line, by deleting a newline and all surrounding spaces, usually previous line, by deleting a newline and all surrounding spaces, usually
leaving a single space. @xref{Indentation,M-^}. leaving a single space. @xref{Indentation,M-^}.
@c Not really sure where to put this...
@findex delete-duplicate-lines
The command @code{delete-duplicate-lines} searches the region for
identical lines, and removes all but one copy of each. Normally it
keeps the first instance of each repeated line, but with a @kbd{C-u}
prefix argument it keeps the last. With a @kbd{C-u C-u} prefix
argument, it only searches for adjacent identical lines. This is a
more efficient mode of operation, useful when the lines have already
been sorted. With a @kbd{C-u C-u C-u} prefix argument, it retains
repeated blank lines.
@node Killing by Lines @node Killing by Lines
@subsection Killing by Lines @subsection Killing by Lines
......
...@@ -312,12 +312,10 @@ macros in registers. ...@@ -312,12 +312,10 @@ macros in registers.
*** New command `C-x r f' (`frameset-to-register'). *** New command `C-x r f' (`frameset-to-register').
See Changes in Emacs 24.4, above. See Changes in Emacs 24.4, above.
+++
** New command `delete-duplicate-lines'. ** New command `delete-duplicate-lines'.
When its arg ADJACENT is non-nil (when called interactively with C-u This searches the region for identical lines, and removes all but one
C-u) it works like the utility `uniq'. Otherwise by default it copy of each repeated line. The lines need not be sorted.
deletes duplicate lines everywhere in the region without regard to
adjacency. When its arg KEEP-BLANKS is non-nil (when called
interactively with C-u C-u C-u), duplicate blank lines are preserved.
* Changes in Specialized Modes and Packages in Emacs 24.4 * Changes in Specialized Modes and Packages in Emacs 24.4
......
2014-01-26 Glenn Morris <rgm@gnu.org>
* sort.el (delete-duplicate-lines): Doc fix.
2014-01-25 Rüdiger Sonderfeld <ruediger@c-plusplus.de> 2014-01-25 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
* progmodes/ada-mode.el (ada): * progmodes/ada-mode.el (ada):
......
...@@ -570,25 +570,23 @@ From a program takes two point or marker arguments, BEG and END." ...@@ -570,25 +570,23 @@ From a program takes two point or marker arguments, BEG and END."
;;;###autoload ;;;###autoload
(defun delete-duplicate-lines (beg end &optional reverse adjacent keep-blanks (defun delete-duplicate-lines (beg end &optional reverse adjacent keep-blanks
interactive) interactive)
"Delete duplicate lines in the region between BEG and END. "Delete all but one copy of any identical lines in the region.
Non-interactively, arguments BEG and END delimit the region.
If REVERSE is nil, search and delete duplicates forward keeping the first Normally it searches forwards, keeping the first instance of
occurrence of duplicate lines. If REVERSE is non-nil (when called each identical line. If REVERSE is non-nil (interactively, with
interactively with C-u prefix), search and delete duplicates backward a C-u prefix), it searches backwards and keeps the last instance of
keeping the last occurrence of duplicate lines. each repeated line.
If ADJACENT is non-nil (when called interactively with two C-u prefixes), Identical lines need not be adjacent, unless the argument
delete repeated lines only if they are adjacent. It works like the utility ADJACENT is non-nil (interactively, with a C-u C-u prefix).
`uniq' and is useful when lines are already sorted in a large file since This is a more efficient mode of operation, and may be useful
this is more efficient in performance and memory usage than when ADJACENT on large regions that have already been sorted.
is nil that uses additional memory to remember previous lines.
If the argument KEEP-BLANKS is non-nil (interactively, with a
If KEEP-BLANKS is non-nil (when called interactively with three C-u prefixes), C-u C-u C-u prefix), it retains repeated blank lines.
duplicate blank lines are preserved.
Returns the number of deleted lines. Interactively, or if INTERACTIVE
When called from Lisp and INTERACTIVE is omitted or nil, return the number is non-nil, it also prints a message describing the number of deletions."
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."
(interactive (interactive
(progn (progn
(barf-if-buffer-read-only) (barf-if-buffer-read-only)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment