Subject: bug#67008: 30.0.50; Multiple major mode parents

From: Mattias Engdegård <[email-masked]>
Date: Sat, 11 Nov 2023 11:14:47 +0100

Thank you, I can see how this would be useful.

>     * lisp/subr.el (merge-ordered-lists): New function. 

That's nice to have, indeed.
The implementation is a bit imperative (and quadratic?) but I assume it was tuned for performance (on small inputs).

> +  "Merge LISTS in a consistent order.
> +LISTS is a list of lists of elements.
> +Merge them into a single list containing the same elements (removing
> +duplicates) and obeying their relative positions in each list.

I think the doc string should mention C3, and that we use `eq` as equivalence predicate here.

> +If a consistent order does not exist, call ERROR-FUNCTION with
> +the remaining lists.
> +It should return the candidate to use to continue the merge
> +By default we choose the first element of the first list."

It's not obvious from the text what the arguments to such an error-function would look like and what the return value should be. None of the existing three callers seem to use this argument, for that matter.
Given that `eieio--c3-merge-lists` raises an error if there is no total order, shouldn't the new code do so?

And we definitely should have tests (I completely understand that you didn't bothered writing any for something that may or may not actually be used).

(Really wish we could hive off the whole CEDET tree to ELPA one day.)