* bug#21058: 25.0.50; delete-dups doesn't delete all duplicates
@ 2015-07-15 5:40 Ari Roponen
2015-07-15 6:14 ` Vaidheeswaran C
2015-07-16 14:55 ` Paul Eggert
0 siblings, 2 replies; 3+ messages in thread
From: Ari Roponen @ 2015-07-15 5:40 UTC (permalink / raw)
To: 21058
Tags: patch
Function delete-dups doesn't delete all duplicates from long
lists:
(delete-dups (mapcar (lambda (x) (% x 3)) (number-sequence 0 102)))
=> (0 1 2 1 0 2 1 0 2 1 0 2 ...)
The following patch seems to fix the problem.
* lisp/subr.el (delete-dups): Fix paren typo.
diff --git a/lisp/subr.el b/lisp/subr.el
index 5bd4bb4..e2c1bae 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -426,8 +426,8 @@ one is kept."
(let ((elt (car retail)))
(if (gethash elt hash)
(setcdr tail (cdr retail))
- (puthash elt t hash)))
- (setq tail retail)))
+ (puthash elt t hash)
+ (setq tail retail)))))
(let ((tail list))
(while tail
(setcdr tail (delete (car tail) (cdr tail)))
In GNU Emacs 25.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.17.4)
of 2015-07-14 on arirop
Repository revision: 6a7e718916d00dbacaa765669f389b86f33075f5
Windowing system distributor `Fedora Project', version 11.0.11702000
System Description: Fedora release 23 (Rawhide)
--
Ari Roponen
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#21058: 25.0.50; delete-dups doesn't delete all duplicates
2015-07-15 5:40 bug#21058: 25.0.50; delete-dups doesn't delete all duplicates Ari Roponen
@ 2015-07-15 6:14 ` Vaidheeswaran C
2015-07-16 14:55 ` Paul Eggert
1 sibling, 0 replies; 3+ messages in thread
From: Vaidheeswaran C @ 2015-07-15 6:14 UTC (permalink / raw)
To: Ari Roponen, 21058
On Wednesday 15 July 2015 11:10 AM, Ari Roponen wrote:
> Tags: patch
>
> Function delete-dups doesn't delete all duplicates from long
> lists:
I had issues with delete-dups as well.
See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20721#26
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#21058: 25.0.50; delete-dups doesn't delete all duplicates
2015-07-15 5:40 bug#21058: 25.0.50; delete-dups doesn't delete all duplicates Ari Roponen
2015-07-15 6:14 ` Vaidheeswaran C
@ 2015-07-16 14:55 ` Paul Eggert
1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggert @ 2015-07-16 14:55 UTC (permalink / raw)
To: Ari Roponen; +Cc: 21058-done
Thanks for the bug report and patch. I installed it in your name as master
commit 572cd26f3f03995dbb3689b8a6f0a575ec9b9cb6.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-16 14:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-15 5:40 bug#21058: 25.0.50; delete-dups doesn't delete all duplicates Ari Roponen
2015-07-15 6:14 ` Vaidheeswaran C
2015-07-16 14:55 ` Paul Eggert
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).