aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/emacs/ChangeLog4
-rw-r--r--doc/emacs/killing.texi11
-rw-r--r--etc/NEWS8
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/sort.el36
5 files changed, 39 insertions, 24 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 7e42d0fcaba..ac8c13ddf1d 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,7 @@
12014-01-26 Glenn Morris <rgm@gnu.org>
2
3 * killing.texi (Deletion): Mention delete-duplicate-lines.
4
12014-01-24 Glenn Morris <rgm@gnu.org> 52014-01-24 Glenn Morris <rgm@gnu.org>
2 6
3 * ack.texi (Acknowledgments): No longer mention obsolete xesam.el, 7 * ack.texi (Acknowledgments): No longer mention obsolete xesam.el,
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi
index 52adbb85431..1da226971eb 100644
--- a/doc/emacs/killing.texi
+++ b/doc/emacs/killing.texi
@@ -136,6 +136,17 @@ the current line). On a solitary blank line, it deletes that line.
136previous line, by deleting a newline and all surrounding spaces, usually 136previous line, by deleting a newline and all surrounding spaces, usually
137leaving a single space. @xref{Indentation,M-^}. 137leaving a single space. @xref{Indentation,M-^}.
138 138
139@c Not really sure where to put this...
140@findex delete-duplicate-lines
141 The command @code{delete-duplicate-lines} searches the region for
142identical lines, and removes all but one copy of each. Normally it
143keeps the first instance of each repeated line, but with a @kbd{C-u}
144prefix argument it keeps the last. With a @kbd{C-u C-u} prefix
145argument, it only searches for adjacent identical lines. This is a
146more efficient mode of operation, useful when the lines have already
147been sorted. With a @kbd{C-u C-u C-u} prefix argument, it retains
148repeated blank lines.
149
139@node Killing by Lines 150@node Killing by Lines
140@subsection Killing by Lines 151@subsection Killing by Lines
141 152
diff --git a/etc/NEWS b/etc/NEWS
index db79daec851..f913b80da86 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -312,12 +312,10 @@ macros in registers.
312*** New command `C-x r f' (`frameset-to-register'). 312*** New command `C-x r f' (`frameset-to-register').
313See Changes in Emacs 24.4, above. 313See Changes in Emacs 24.4, above.
314 314
315+++
315** New command `delete-duplicate-lines'. 316** New command `delete-duplicate-lines'.
316When its arg ADJACENT is non-nil (when called interactively with C-u 317This searches the region for identical lines, and removes all but one
317C-u) it works like the utility `uniq'. Otherwise by default it 318copy of each repeated line. The lines need not be sorted.
318deletes duplicate lines everywhere in the region without regard to
319adjacency. When its arg KEEP-BLANKS is non-nil (when called
320interactively with C-u C-u C-u), duplicate blank lines are preserved.
321 319
322 320
323* Changes in Specialized Modes and Packages in Emacs 24.4 321* Changes in Specialized Modes and Packages in Emacs 24.4
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b9e79743b3c..cded7bcb0fc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12014-01-26 Glenn Morris <rgm@gnu.org>
2
3 * sort.el (delete-duplicate-lines): Doc fix.
4
12014-01-25 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de> 52014-01-25 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de>
2 6
3 * progmodes/ada-mode.el (ada): 7 * progmodes/ada-mode.el (ada):
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."
570;;;###autoload 570;;;###autoload
571(defun delete-duplicate-lines (beg end &optional reverse adjacent keep-blanks 571(defun delete-duplicate-lines (beg end &optional reverse adjacent keep-blanks
572 interactive) 572 interactive)
573 "Delete duplicate lines in the region between BEG and END. 573 "Delete all but one copy of any identical lines in the region.
574 574Non-interactively, arguments BEG and END delimit the region.
575If REVERSE is nil, search and delete duplicates forward keeping the first 575Normally it searches forwards, keeping the first instance of
576occurrence of duplicate lines. If REVERSE is non-nil (when called 576each identical line. If REVERSE is non-nil (interactively, with
577interactively with C-u prefix), search and delete duplicates backward 577a C-u prefix), it searches backwards and keeps the last instance of
578keeping the last occurrence of duplicate lines. 578each repeated line.
579 579
580If ADJACENT is non-nil (when called interactively with two C-u prefixes), 580Identical lines need not be adjacent, unless the argument
581delete repeated lines only if they are adjacent. It works like the utility 581ADJACENT is non-nil (interactively, with a C-u C-u prefix).
582`uniq' and is useful when lines are already sorted in a large file since 582This is a more efficient mode of operation, and may be useful
583this is more efficient in performance and memory usage than when ADJACENT 583on large regions that have already been sorted.
584is nil that uses additional memory to remember previous lines. 584
585 585If the argument KEEP-BLANKS is non-nil (interactively, with a
586If KEEP-BLANKS is non-nil (when called interactively with three C-u prefixes), 586C-u C-u C-u prefix), it retains repeated blank lines.
587duplicate blank lines are preserved. 587
588 588Returns the number of deleted lines. Interactively, or if INTERACTIVE
589When called from Lisp and INTERACTIVE is omitted or nil, return the number 589is non-nil, it also prints a message describing the number of deletions."
590of deleted duplicate lines, do not print it; if INTERACTIVE is t, the
591function behaves in all respects as if it had been called interactively."
592 (interactive 590 (interactive
593 (progn 591 (progn
594 (barf-if-buffer-read-only) 592 (barf-if-buffer-read-only)