bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#67008: 30.0.50; Multiple major mode parents


From: Mattias Engdegård
Subject: bug#67008: 30.0.50; Multiple major mode parents
Date: Mon, 13 Nov 2023 13:45:59 +0100

12 nov. 2023 kl. 17.41 skrev Stefan Monnier <monnier@iro.umontreal.ca>:

> I improved the docstring to try and clarify.

Thank you, but the new text,

> +The order of the (sub)lists determines the final order in those cases where
> +the order within the sublists does not impose a unique choice.

still doesn't explain how the sublist order affects the choice of linearisation.

Since I'm here:

>      (while (cdr (setq lists (delq nil lists)))

When this loop is entered the first time, `lists` still holds the argument 
which probably shouldn't be mutated even if it's for removing empty lists 
inside. (In later iterations it seems to be a copy.)

+(ert-deftest subt-tests--merge-ordered-lists ()
                 ^
                 r

+  (should (equal (merge-ordered-lists
+                  '((B A) (C A) (D B) (E D C)))
+                 '(E D B C A)))
+  (should (equal (merge-ordered-lists
+                  '((E D C) (B A) (C A) (D B)))
+                 '(E D C B A)))
+  (should-error (merge-ordered-lists
+                 '((E C D) (B A) (A C) (D B))
+                 (lambda (_) (error "cycle")))))

All calls should error on cycles, not just the one that actually contains one.

Maybe the default value for the `error-function` argument should be one that 
raises an error, so that callers need to specify something explicitly if they 
want a different behaviour?






reply via email to

[Prev in Thread] Current Thread [Next in Thread]