Commit a8e1414c authored by Stephen Berman's avatar Stephen Berman
Browse files

Fix delete-duplicate-lines

* lisp/sort.el (delete-duplicate-lines): Delete duplicate
first line when operating backward (bug#23863).
parent ff0ec6fd
......@@ -596,7 +596,7 @@ is non-nil, it also prints a message describing the number of deletions."
(equal current-prefix-arg '(64))
t)))
(let ((lines (unless adjacent (make-hash-table :test 'equal)))
line prev-line
line prev-line first-line
(count 0)
(beg (copy-marker beg))
(end (copy-marker end)))
......@@ -604,8 +604,9 @@ is non-nil, it also prints a message describing the number of deletions."
(goto-char (if reverse end beg))
(if (and reverse (bolp)) (forward-char -1))
(while (if reverse
(and (> (point) beg) (not (bobp)))
(not first-line)
(and (< (point) end) (not (eobp))))
(setq first-line (and reverse (or (<= (point) beg) (bobp))))
(setq line (buffer-substring-no-properties
(line-beginning-position) (line-end-position)))
(if (and keep-blanks (string= "" line))
......
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