Subject: bug#79158: 31.0.50; epa-dired is not tramp-aware

From: Ankit Gadiya <[email-masked]>
Date: Sat, 2 Aug 2025 23:05:56 +0530

On Sat, 2 Aug 2025 at 22:38, Michael Albinus <[email-masked]> wrote:
>
> Ankit Gadiya via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <[email-masked]> writes:
>
> Hi,
>
> > The epa-dired commands like epa-dired-do-decrypt do not work in the
> > dired buffer under tramp.
> >
> > Steps to reproduce:
> >
> > 1. Open the dired buffer over tramp using
> >    /ssh:user@hostname:/path/to/directory
> > 2. Mark the file with the .gpg extension in the dired buffer using
> >    dired-mark.
> > 3. Call the M-x epa-dired-do-decrypt command.
> >
> > Behavior:
> >
> > It appears like epa-dired is passing the tramp-path verbatim to the gpg.
> > I've updated the tramp-path to remove identifiers.
> >
> > Error while decrypting with "/opt/homebrew/bin/gpg":
> >
> > gpg: can't open '/ssh:user@hostname:/path/to/file.gpg': No such file
> > or directory
> > gpg: decrypt_message failed: No such file or directory
> >
> > Expected Behavior:
> >
> > I expected the command to be aware of Tramp paths. In case of Tramp
> > files:
> > 1. Write the file to a temporary local file
> > 2. Decrypt it using local GPG keys.
> > 3. Write the decrypted file back to the remote location with the file name
> >    accepted as the input.
>
> Alternatively, we could let gpg run on the remote host.
>
> Best regards, Michael.

In my use-case, I don't have the GPG keys configured on the remote host. The
remote host may not even have GPG installed.

Potentially, it can be exposed as a flag in the function to determine which GPG
to use.

-- 
Ankit