Subject: bug#79186: 31.0.50; Make dynamic binding of url-max-redirections work

From: "Peder O. Klingenberg" <[email-masked]>
Date: Thu, 07 Aug 2025 20:14:26 +0200

On Thu, 2025-08-07 10:24:33 +0200, Robert Pluim wrote:

> I tried to apply this, but it failed because you quoted `like this`,
> which our commit hooks reject. Best is to quote 'like this' in commit
> messages and resubmit (this also gives you the chance to add
> (Bug#79186) somewhere in the commit message 😀).

Thanks for the feedback.  All these quoting standards are so confusing.
We should all decide on a new standard that will subsume all previous
standards.  (Cue XKCD classic)

Anyway.  Updated patch attached.

...Peder...
-- 
This must be Thursday.  I never could get the hang of Thursdays.

>From 245b1935fdb9337b0e59932eefe6c62158eeff3d Mon Sep 17 00:00:00 2001
From: "Peder O. Klingenberg" <[email-masked]>
Date: Wed, 6 Aug 2025 21:55:38 +0200
Subject: [PATCH] Emulate dynamic binding of url-max-redirections

* lisp/url/url-http.el (url-http): Make url-max-redirections
buffer-local in request buffers, to make dynamic binding over
'url-retrieve' work as expected.

(Bug#79186)
---
 lisp/url/url-http.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index a230a37e9ff..04fee189cfa 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -1372,7 +1372,8 @@ url-http
          (httpver url-http-version)
          (httpkeepalive url-http-attempt-keepalives)
          (user-agent url-user-agent)
-         (privacy-level url-privacy-level))
+         (privacy-level url-privacy-level)
+         (max-redirections url-max-redirections))
     (if (not connection)
 	;; Failed to open the connection for some reason
 	(progn
@@ -1418,6 +1419,7 @@ url-http
                        url-http-extensions-header
                        url-user-agent
                        url-privacy-level
+                       url-max-redirections
                        nsm-noninteractive))
 	  (set (make-local-variable var) nil))
 
@@ -1447,6 +1449,7 @@ url-http
               url-http-extensions-header url-extensions-header
               url-user-agent user-agent
               url-privacy-level privacy-level
+              url-max-redirections max-redirections
               nsm-noninteractive noninteractive-p)
 
 	(set-process-buffer connection buffer)
-- 
2.25.1