unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: [elpa] externals/debbugs b8c84dbe4b: Improve needed advice
Date: Thu, 12 Sep 2024 15:52:08 -0400	[thread overview]
Message-ID: <jwv5xr0hctd.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20240912143335.15DACC41F2A@vcs2.savannah.gnu.org> (Michael Albinus via's message of "Thu, 12 Sep 2024 10:33:34 -0400 (EDT)")

Hi Michael,

> +(defvar debbugs-compat-url-http-attempt-keepalives nil
> +  "Temporary storage for `'.")
> +(defun debbugs-compat-add-debbugs-advice ()
> +  (with-no-warnings
> +    (setq debbugs-compat-url-http-attempt-keepalives
> +          url-http-attempt-keepalives))
> +  (advice-add
> +   'url-http-create-request :around
> +   (lambda (orig-fun)
> +     "Set `url-http-attempt-keepalives' to nil."
> +     (with-no-warnings (setq url-http-attempt-keepalives nil))
> +     (funcall orig-fun))
> +   '(name debbugs-advice)))
> +
> +(defun debbugs-compat-remove-debbugs-advice ()
> +  (advice-remove 'url-http-create-request 'debbugs-advice)
> +  (with-no-warnings
> +    (setq url-http-attempt-keepalives
> +          debbugs-compat-url-http-attempt-keepalives)))
[...]
> +(defun debbugs-soap-invoke (operation-name &rest parameters)
> +  "Invoke the SOAP connection.
> +OPERATION-NAME and PARAMETERS are as described in `soap-invoke'."
> +  (debbugs-compat-add-debbugs-advice)
> +  (prog1
> +      (apply #'soap-invoke operation-name parameters)
> +    (debbugs-compat-remove-debbugs-advice)))

I wonder you're doing it this way instead of the "more obvious":

    (defun debbugs-soap-invoke (operation-name &rest parameters)
      "Invoke the SOAP connection.
    OPERATION-NAME and PARAMETERS are as described in `soap-invoke'."
      (let ((url-http-attempt-keepalives nil))
        (apply #'soap-invoke operation-name parameters)))


- Stefan




       reply	other threads:[~2024-09-12 19:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <172615161464.14411.6152144440040360858@vcs2.savannah.gnu.org>
     [not found] ` <20240912143335.15DACC41F2A@vcs2.savannah.gnu.org>
2024-09-12 19:52   ` Stefan Monnier [this message]
2024-09-13  7:16     ` [elpa] externals/debbugs b8c84dbe4b: Improve needed advice Michael Albinus
2024-09-13 14:23       ` Stefan Monnier
2024-09-13 15:51         ` Michael Albinus

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=jwv5xr0hctd.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    /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).