GNU bug report logs - #79356
31.0.50; 'C-x p r' fails when there are .gpg files EPA can't decrypt

Previous Next

Package: emacs;

Reported by: Sean Whitton <spwhitton <at> spwhitton.name>

Date: Sun, 31 Aug 2025 16:26:02 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 31.1

Done: Sean Whitton <spwhitton <at> spwhitton.name>

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: 79356 <at> debbugs.gnu.org
Subject: bug#79356: 31.0.50; 'C-x p r' fails when there are .gpg files EPA can't decrypt
Date: Mon, 01 Sep 2025 00:00:01 -0400
> --8<---------------cut here---------------start------------->8---
> diff --git a/lisp/fileloop.el b/lisp/fileloop.el
> index d7d2aa7e0d5..fd749353753 100644
> --- a/lisp/fileloop.el
> +++ b/lisp/fileloop.el
> @@ -121,10 +121,17 @@ fileloop-next-file
>          (kill-all-local-variables)
>          (erase-buffer)
>          (setq new next)
> -        (condition-case nil
> +        (condition-case err
>              (insert-file-contents new nil)
>            (file-missing
> -           (fileloop-next-file novisit))))
> +           (fileloop-next-file novisit))
> +          (file-error
> +           (unless
> +               (and (equal (caddr err) "Can't decrypt")
> +                    (y-or-n-p (substitute-quotes
> +                               (format "Couldn't decrypt `%s'; skip it?"
> +                                       (abbreviate-file-name new)))))
> +             (signal (car err) (cdr err))))))
>        new)))

The (equal (caddr err) "Can't decrypt") is rather hideous and brittle,
especially given that `fileloop` is a generic operation that shouldn't
know about EPA.

How 'bout we just prompt for all `file-error`s?  After all, the same
kind of reasoning applies to invalid .gz files, or files for which we
don't have read access, ...


        Stefan





This bug report was last modified 4 days ago.

Previous Next


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