diff options
| -rw-r--r-- | doc/emacs/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/emacs/killing.texi | 11 | ||||
| -rw-r--r-- | etc/NEWS | 8 | ||||
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/sort.el | 36 |
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 @@ | |||
| 1 | 2014-01-26 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * killing.texi (Deletion): Mention delete-duplicate-lines. | ||
| 4 | |||
| 1 | 2014-01-24 Glenn Morris <rgm@gnu.org> | 5 | 2014-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. | |||
| 136 | previous line, by deleting a newline and all surrounding spaces, usually | 136 | previous line, by deleting a newline and all surrounding spaces, usually |
| 137 | leaving a single space. @xref{Indentation,M-^}. | 137 | leaving 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 | ||
| 142 | identical lines, and removes all but one copy of each. Normally it | ||
| 143 | keeps the first instance of each repeated line, but with a @kbd{C-u} | ||
| 144 | prefix argument it keeps the last. With a @kbd{C-u C-u} prefix | ||
| 145 | argument, it only searches for adjacent identical lines. This is a | ||
| 146 | more efficient mode of operation, useful when the lines have already | ||
| 147 | been sorted. With a @kbd{C-u C-u C-u} prefix argument, it retains | ||
| 148 | repeated 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 | ||
| @@ -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'). |
| 313 | See Changes in Emacs 24.4, above. | 313 | See Changes in Emacs 24.4, above. |
| 314 | 314 | ||
| 315 | +++ | ||
| 315 | ** New command `delete-duplicate-lines'. | 316 | ** New command `delete-duplicate-lines'. |
| 316 | When its arg ADJACENT is non-nil (when called interactively with C-u | 317 | This searches the region for identical lines, and removes all but one |
| 317 | C-u) it works like the utility `uniq'. Otherwise by default it | 318 | copy of each repeated line. The lines need not be sorted. |
| 318 | deletes duplicate lines everywhere in the region without regard to | ||
| 319 | adjacency. When its arg KEEP-BLANKS is non-nil (when called | ||
| 320 | interactively 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 @@ | |||
| 1 | 2014-01-26 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * sort.el (delete-duplicate-lines): Doc fix. | ||
| 4 | |||
| 1 | 2014-01-25 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de> | 5 | 2014-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 | 574 | Non-interactively, arguments BEG and END delimit the region. | |
| 575 | If REVERSE is nil, search and delete duplicates forward keeping the first | 575 | Normally it searches forwards, keeping the first instance of |
| 576 | occurrence of duplicate lines. If REVERSE is non-nil (when called | 576 | each identical line. If REVERSE is non-nil (interactively, with |
| 577 | interactively with C-u prefix), search and delete duplicates backward | 577 | a C-u prefix), it searches backwards and keeps the last instance of |
| 578 | keeping the last occurrence of duplicate lines. | 578 | each repeated line. |
| 579 | 579 | ||
| 580 | If ADJACENT is non-nil (when called interactively with two C-u prefixes), | 580 | Identical lines need not be adjacent, unless the argument |
| 581 | delete repeated lines only if they are adjacent. It works like the utility | 581 | ADJACENT 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 | 582 | This is a more efficient mode of operation, and may be useful |
| 583 | this is more efficient in performance and memory usage than when ADJACENT | 583 | on large regions that have already been sorted. |
| 584 | is nil that uses additional memory to remember previous lines. | 584 | |
| 585 | 585 | If the argument KEEP-BLANKS is non-nil (interactively, with a | |
| 586 | If KEEP-BLANKS is non-nil (when called interactively with three C-u prefixes), | 586 | C-u C-u C-u prefix), it retains repeated blank lines. |
| 587 | duplicate blank lines are preserved. | 587 | |
| 588 | 588 | Returns the number of deleted lines. Interactively, or if INTERACTIVE | |
| 589 | When called from Lisp and INTERACTIVE is omitted or nil, return the number | 589 | is non-nil, it also prints a message describing the number of deletions." |
| 590 | of deleted duplicate lines, do not print it; if INTERACTIVE is t, the | ||
| 591 | function 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) |