Subject: Re: bug#51140: 28.0.50; cl-letf appears not to work with native-comp (at least for process-exit-status and other builtins)

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 12 Sep 2022 13:49:18 +0200

Robert Irelan <[email-masked]> writes:

>     (defun +ivy--always-return-zero-exit-code-a (fn &rest args)
>       (let ((process-exit-status-orig
>              (symbol-function 'process-exit-status)))
>         (cl-letf* (((symbol-function 'process-exit-status)
>                     (lambda (_proc)
>                       (let ((code (funcall process-exit-status-orig _proc)))
>                         (if (= code 2) 0 code)))))
>           (apply fn args)))
>     (advice-add #'counsel-rg :around #'+ivy--always-return-zero-exit-code-a)

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

Andrea was apparently unable to reproduce the problem here on the
current "master" branch.  Robert, would it be possible for you to test
this on that branch and see whether this works better there?