GNU bug report logs - #54343
28.0.91; find-function goes to a wrong place for erc

Previous Next

Package: emacs;

Reported by: Lin Jian <jlin.dev <at> outlook.com>

Date: Fri, 11 Mar 2022 20:19:01 UTC

Severity: normal

Found in version 28.0.91

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: "J.P." <jp <at> neverwas.me>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Lin Jian <jlin.dev <at> outlook.com>, 54343 <at> debbugs.gnu.org
Subject: bug#54343: 28.0.91; find-function goes to a wrong place for erc
Date: Sun, 13 Mar 2022 13:12:12 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> So I've now added that in Emacs 29, too.

Looks like the "def" part is missing from "defgeneric":

  diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
  index 777334a7a7..208d68d1ab 100644
  --- a/lisp/emacs-lisp/find-func.el
  +++ b/lisp/emacs-lisp/find-func.el
  @@ -61,7 +61,7 @@ find-function-regexp
   [...]
  -cl-\\(?:defun\\|defmethod\\)\\|\
  +cl-\\(?:defun\\|defmethod\\|generic\\)\\|\
                               ~~~~~~~

I'd used both in back-to-back examples (both def- and plain generic),
which was clearly a typo landmine (sorry).

> so perhaps longer term it would be nice if it was rewritten. And
> perhaps the logic should be "first look for these things, and if we
> don't find them, then look for these other things". That is, a
> priority thing.)

I was thinking much the same, albeit in a less evolved manner. The
alternate function form for the CDRs of `find-function-regexp-alist'
members may prove useful to do the prioritizing. Perhaps it'd even be
worthwhile to incorporate more refined strategies, when available, such
as the finders provided by cl-generic.el[1].

>> Just a benign optimization involving some culling of redundant code in
>> `erc--switch-to-buffer'. This email contains the latest version, with a
>> slightly revised commit message:
>>
>>   https://lists.gnu.org/archive/html/bug-gnu-emacs/2022-01/msg02081.html
>
> I think that makes sense?  But I haven't tested the patch.

I'm testing it indirectly (in yet another bug) but will add a unit test
for good measure and ping you in the other thread. Thanks.


[1] https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/emacs-lisp/cl-generic.el?id=dd91aac5#n995




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

Previous Next


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