unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Irelan <rirelan@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Michael Heerdegen <michael_heerdegen@web.de>,
	51140@debbugs.gnu.org, Stefan Kangas <stefan@marxist.se>,
	Andrea Corallo <akrl@sdf.org>
Subject: bug#51140: 28.0.50; cl-letf appears not to work with native-comp (at least for process-exit-status and other builtins)
Date: Tue, 13 Sep 2022 20:22:36 -0700	[thread overview]
Message-ID: <CAJUyYjr1n_Bvi7_HsYiqgejRhJSikvOT6noQqb5Mtkz-96JmTw@mail.gmail.com> (raw)
In-Reply-To: <87y1uo7qyp.fsf@gnus.org>

[-- Attachment #1: Type: text/plain, Size: 1914 bytes --]

I can't reproduce this anymore on 28.1 either:

> (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 0) 0 code)))))
>       (apply fn args))))
> (defun my-test-exit-status-advised ()
>   (my-test-exit-status))
> (defun my-test-exit-status ()
>   (let ((proc (start-process "my-test-exit-status" nil "false")))
>     (while (not (eq (process-status proc) 'exit))
>       (sit-for 0.05))
>     (process-exit-status proc)))
> (advice-add #'my-test-exit-status-advised :around
#'+ivy--always-return-zero-exit-code-a)
> (my-test-exit-status-advised)           ; => 0
> (my-test-exit-status)                   ; => 1

So let's close this.

On Mon, Sep 12, 2022 at 4:49 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Robert Irelan <rirelan@gmail.com> 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?
>


-- 
Robert Irelan
rirelan@gmail.com

[-- Attachment #2: Type: text/html, Size: 2840 bytes --]

  reply	other threads:[~2022-09-14  3:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11 22:37 bug#51140: 28.0.50; cl-letf appears not to work with native-comp (at least for process-exit-status and other builtins) Robert Irelan
2021-10-12  2:30 ` Michael Heerdegen
2021-10-12  2:40   ` Robert Irelan
2021-10-12  2:50     ` Michael Heerdegen
2021-10-12  2:57       ` Robert Irelan
2021-10-12 22:35         ` Stefan Kangas
2021-10-13  5:13           ` Robert Irelan
2021-10-19  5:31             ` Stefan Kangas
2021-11-30 16:22               ` Andrea Corallo
2022-09-12 11:49             ` Lars Ingebrigtsen
2022-09-14  3:22               ` Robert Irelan [this message]
2022-09-14 12:41                 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJUyYjr1n_Bvi7_HsYiqgejRhJSikvOT6noQqb5Mtkz-96JmTw@mail.gmail.com \
    --to=rirelan@gmail.com \
    --cc=51140@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=larsi@gnus.org \
    --cc=michael_heerdegen@web.de \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).