[slime-devel] slime.el (slime-repl-merge-histories)

[Reported to the author 060520] Currently the function slime-repl-merge-histories appears to be buggy in not deleting duplicates, and maintaining order. For example: ELISP> (slime-repl-merge-histories '(1 2 3 4 5) '(2 3 4 8)) (8 1 5 2 3 4) ELISP> (slime-repl-merge-histories '(1 2 3 4 5 1 2 3 4 5) '(2 3 4 8)) (8 1 5 1 5 2 3 4) I believe the desired result is: (2 3 4 8 1 5) so M-p in a fresh repl will pick the last (latest) item from the previous repl session. I believe the following Changelog entry applies, |2005-10-11 Stefan Kamphausen <skampi@gmx.net> and would suggest a simpler function that uses delete-duplicates (for strings): (defun slime-repl-merge-histories (old-hist new-hist) "Merge entries from OLD-HIST and NEW-HIST." (remove-duplicates (append new-hist old-hist) :test 'string= :from-end t)) -- Madhu -- ======================================================================= Open system or closed system, enlightenment or ideology, those are the questions. "John C. Mallery" <jcma@ai.mit.edu> enometh@meer.net http://www.meer.net/~enometh/ 803 Clayton St #2 San Francisco CA 94117 H:415-242-3375 W:408-343-6255 You have new mail

Currently the function slime-repl-merge-histories appears to be buggy in not deleting duplicates, and maintaining order. For example:
i've got a local change for slime-repl-merge-histories that also uses a hashtable to considerably speed up the merging (used by a new slime-repl-delete-history). i'll look into mergin back that change to cvs later today. -- - attila "- The truth is that I've been too considerate, and so became unintentionally cruel... - I understand. - No, you don't understand! We don't speak the same language!" (Ingmar Bergman - Smultronstället)
participants (2)
-
Attila Lendvai
-
Madhu