]> git.eshelyaron.com Git - emacs.git/commit
(derived-mode-all-parents): Fix handling of cycles
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 12 Nov 2023 16:37:38 +0000 (11:37 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 12 Nov 2023 16:37:38 +0000 (11:37 -0500)
commitb86dcea37c86a3b9cb9fc6c4656b481b2ad1c1e5
treef970fa6143d822ad5031f1e4319325c76c31c23b
parentfbb897b7af53cdb43e18322c5cdfbfef7cdda1ee
(derived-mode-all-parents): Fix handling of cycles

* lisp/subr.el (derived-mode-all-parents): Fix the handling of cycles
so that it doesn't fill the cache with incorrect results.
(merge-ordered-lists): Improve docstring.
(provided-mode-derived-p): Swap the loops since `modes` is usually
shorter than `ps`.

* test/lisp/subr-tests.el (subr-tests--parent-mode): Simplify.
(subr-tests--mode-A, subr-tests--mode-B, subr-tests--mode-C): New funs.
(subt-tests--derived-mode-add-parents): New test.
lisp/subr.el
test/lisp/subr-tests.el