GNU bug report logs - #53178
ert should use existing explainers for aliases

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Tue, 11 Jan 2022 05:18:01 UTC

Severity: minor

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 53178 <at> debbugs.gnu.org
Subject: bug#53178: ert should use existing explainers for aliases
Date: Thu, 13 Jan 2022 09:48:56 +0100
Stefan Kangas <stefan <at> 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




This bug report was last modified 3 years and 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.