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

Madhu enometh at meer.net
Mon Dec 11 05:07:48 UTC 2006


[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 at 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 at ai.mit.edu>

	    enometh at 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








More information about the slime-devel mailing list