[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#53178: ert should use existing explainers for aliases
From: |
Lars Ingebrigtsen |
Subject: |
bug#53178: ert should use existing explainers for aliases |
Date: |
Thu, 13 Jan 2022 09:48:56 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Stefan Kangas <stefan@marxist.se> writes:
> There exists an ert explainer for `string-equal', but it is not used if
> `string=' (an alias for `string-equal') is used in the test.
>
> This should be fixed such that an existing explainer is always used for
> an alias.
I started implementing this, but then I ran into the problem of possible
defalias loops. I thought we had a function somewhere that would just
return the defalias chain, but I can't find it anywhere. And indeed:
(defalias 'a 'b)
(defalias 'b 'a)
And then `C-h f a RET' will infloop because
(defun help-fns--analyze-function (function)
[...]
((and aliased (not (subrp def)))
(let ((f real-function))
(while (and (fboundp f)
(symbolp (symbol-function f)))
(setq f (symbol-function f)))
f))
So I've now added a new function for this, fixed the infloop in
help-fns, and fixed the explainer lookup in ert.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no