Subject: Re: bug#67937: 30.0.50; auth-source-pass relies on epa-file being enabled

From: Arsen Arsenović <[email-masked]>
Date: Sat, 23 Dec 2023 20:44:21 +0100

Hi Michael,

Michael Albinus <[email-masked]> writes:

> Arsen Arsenović <[email-masked]> writes:
>
> Hi,
>
>>>> This happens due to the call of `epa-file-disable' mentioned in the
>>>> initial recipe.
>>>
>>> IIUC, the call in question was only included in the recipe to simulate
>>> the effect of the entry disappearing, and Arsen is still trying to
>>> pinpoint the actual cause.
>>
>> Indeed.  That's a topic for a different bug report, though ;P
>
> Do you have a recipe for the problem w/o calling epa-disble-file?

No.

This patch/bug report addresses a real problem that exists independently
of what triggered it in my case.

> My gut feeling tells me that this could be the real problem, and we
> need to solve this instead of bypassing the problem with another
> patch, which could introduce further problems.

Your gut's nearly certainly right here :-)  I am still hunting for the
cause of that issue.

Regardless, what I said initially holds true ultimately: either epa-file
should not be relied on, or a-s-p should ensure it is present.  I
gravitate towards the former, as it reduces the complexity of getting a
password-store entry.

> Hunting for this problem I recommend to use
> (debug-on-variable-change 'file-name-handler-alist)

That is too verbose.  The following appears to work well, though:

--8<---------------cut here---------------start------------->8---
(add-variable-watcher
 'file-name-handler-alist
 (lambda (symbol newval operation where)
   (cl-flet ((hefh (val)
	       (seq-some (lambda (x) (equal (cdr x) 'epa-file-handler))
			 val)))
     (let ((hb (hefh file-name-handler-alist))
	   (ha (hefh newval)))
       (cond
	((and hb (not ha))
	 (debug--implement-debug-watch symbol newval operation where))
	((and (not hb) ha)
	 (message "epa-file added")))))))
--8<---------------cut here---------------end--------------->8---

Have a lovely day!

> I haven't followed the whole discussion, so forgive me if this has been
> discussed already.
>
>> Arsen Arsenović
>
> Best regards, Michael.

--
Arsen Arsenović