GNU bug report logs - #64543
[PATCH] package-report-bug: don't fail on custom groups defined by eval

Previous Next

Package: emacs;

Reported by: sbaugh <at> catern.com

Date: Sun, 9 Jul 2023 17:09:02 UTC

Severity: normal

Tags: patch

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Philip Kaludercic <philipk <at> posteo.net>
To: Spencer Baugh <sbaugh <at> janestreet.com>
Cc: sbaugh <at> catern.com, 'Eli Zaretskii' <eliz <at> gnu.org>, 64543 <at> debbugs.gnu.org
Subject: bug#64543: [PATCH] package-report-bug: don't fail on custom groups defined by eval
Date: Fri, 14 Jul 2023 19:44:15 +0000
Spencer Baugh <sbaugh <at> janestreet.com> writes:

> Philip Kaludercic <philipk <at> posteo.net> writes:
>
>> sbaugh <at> catern.com writes:
>>> Good point.  I was just copying the last condition in the and.  Lifted
>>> them both out of the loop:
>>>
>>> From 2873d4c482acfd1ced749d593fd512c408e0a578 Mon Sep 17 00:00:00 2001
>>> From: Spencer Baugh <sbaugh <at> catern.com>
>>> Date: Sun, 9 Jul 2023 22:21:03 -0400
>>> Subject: [PATCH] Support transforming the dirname used by uniquify
>>
>> Wrong patch?
> Oops! Here's the right one:
>
> From fb31777bcc1935de351eaa35c1ed679c66d24a92 Mon Sep 17 00:00:00 2001
> From: Spencer Baugh <sbaugh <at> catern.com>
> Date: Sun, 9 Jul 2023 12:59:50 -0400
> Subject: [PATCH] package-report-bug: don't fail on custom groups defined by
>  eval
>
> Previously we just assumed that the car of an element of
> custom-current-group-alist was a filename.  But actually it can be nil
> if a custom group was defined by just evaling Lisp.
>
> * lisp/emacs-lisp/package.el (package-report-bug): Don't fail when a
> custom group was defined by eval.
> ---
>  lisp/emacs-lisp/package.el | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index 3e6acd9b388..58ca19f7fe2 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -4637,13 +4637,14 @@ package-report-bug
>          vars)
>      (dolist-with-progress-reporter (group custom-current-group-alist)
>          "Scanning for modified user options..."
> -      (dolist (ent (get (cdr group) 'custom-group))
> -        (when (and (custom-variable-p (car ent))
> -                   (boundp (car ent))
> -                   (not (eq (custom--standard-value (car ent))
> -                            (default-toplevel-value (car ent))))
> -                   (file-in-directory-p (car group) (package-desc-dir desc)))
> -          (push (car ent) vars))))
> +      (when (and (car group)
> +                 (file-in-directory-p (car group) (package-desc-dir desc)))
> +        (dolist (ent (get (cdr group) 'custom-group))
> +          (when (and (custom-variable-p (car ent))
> +                     (boundp (car ent))
> +                     (not (eq (custom--standard-value (car ent))
> +                              (default-toplevel-value (car ent)))))
> +            (push (car ent) vars)))))
>      (dlet ((reporter-prompt-for-summary-p t))
>        (reporter-submit-bug-report maint name vars))))

LGTM.

Eli, would it be OK to push this to emacs-29, as this is a bug in the
existing code?  Most of the changes are indentation/whitespace changes
anyway.




This bug report was last modified 1 year and 310 days ago.

Previous Next


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