GNU bug report logs - #79186
31.0.50; Make dynamic binding of url-max-redirections work

Previous Next

Package: emacs;

Reported by: "Peder O. Klingenberg" <peder <at> klingenberg.no>

Date: Wed, 6 Aug 2025 20:51:02 UTC

Severity: normal

Tags: patch

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

To reply to this bug, email your comments to 79186 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#79186; Package emacs. (Wed, 06 Aug 2025 20:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Peder O. Klingenberg" <peder <at> klingenberg.no>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 06 Aug 2025 20:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Peder O. Klingenberg" <peder <at> klingenberg.no>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; Make dynamic binding of url-max-redirections work
Date: Wed, 06 Aug 2025 22:28:18 +0200
[Message part 1 (text/plain, inline)]
Following on from bug#61916, there was one variable I missed that should
also have a faux-dynamic binding: url-max-redirections.

To demonstrate:

(setq url-debug t) ;; and follow the results in the *URL-DEBUG* buffer
(setq url-max-redirections 30) ;; the default

(let ((url-max-redirections 0))
  (url-retrieve "http://httpbin.org/redirect/5"
    #'(lambda (&rest _args)
        (message "done"))))

This will cause 5 redirections to be followed by url-http.el, because it
still sees url-max-redirections as 30.

With the attached patch it stops after the first redirection.

-- 
...Peder...

[0001-Emulate-dynamic-binding-of-url-max-redirections.patch (text/x-diff, attachment)]

Added tag(s) patch. Request was from "Peder O. Klingenberg" <peder <at> klingenberg.no> to control <at> debbugs.gnu.org. (Wed, 06 Aug 2025 21:20:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79186; Package emacs. (Thu, 07 Aug 2025 08:25:01 GMT) Full text and rfc822 format available.

Message #10 received at 79186 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: "Peder O. Klingenberg" <peder <at> klingenberg.no>
Cc: 79186 <at> debbugs.gnu.org
Subject: Re: bug#79186: 31.0.50; Make dynamic binding of
 url-max-redirections work
Date: Thu, 07 Aug 2025 10:24:33 +0200
>>>>> On Wed, 06 Aug 2025 22:28:18 +0200, "Peder O. Klingenberg" <peder <at> klingenberg.no> said:

    Peder> Following on from bug#61916, there was one variable I missed that should
    Peder> also have a faux-dynamic binding: url-max-redirections.

    Peder> To demonstrate:

    Peder> (setq url-debug t) ;; and follow the results in the *URL-DEBUG* buffer
    Peder> (setq url-max-redirections 30) ;; the default

    Peder> (let ((url-max-redirections 0))
    Peder>   (url-retrieve "http://httpbin.org/redirect/5"
    Peder>     #'(lambda (&rest _args)
    Peder>         (message "done"))))

    Peder> This will cause 5 redirections to be followed by url-http.el, because it
    Peder> still sees url-max-redirections as 30.

    Peder> With the attached patch it stops after the first redirection.

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 😀).

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79186; Package emacs. (Thu, 07 Aug 2025 18:15:02 GMT) Full text and rfc822 format available.

Message #13 received at 79186 <at> debbugs.gnu.org (full text, mbox):

From: "Peder O. Klingenberg" <peder <at> klingenberg.no>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 79186 <at> debbugs.gnu.org
Subject: Re: bug#79186: 31.0.50; Make dynamic binding of
 url-max-redirections work
Date: Thu, 07 Aug 2025 20:14:26 +0200
[Message part 1 (text/plain, inline)]
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.

[0001-Emulate-dynamic-binding-of-url-max-redirections-v2.patch (text/x-diff, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 09 Aug 2025 12:49:02 GMT) Full text and rfc822 format available.

Notification sent to "Peder O. Klingenberg" <peder <at> klingenberg.no>:
bug acknowledged by developer. (Sat, 09 Aug 2025 12:49:02 GMT) Full text and rfc822 format available.

Message #18 received at 79186-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Peder O. Klingenberg" <peder <at> klingenberg.no>
Cc: rpluim <at> gmail.com, 79186-done <at> debbugs.gnu.org
Subject: Re: bug#79186: 31.0.50;
 Make dynamic binding of url-max-redirections work
Date: Sat, 09 Aug 2025 15:48:19 +0300
> Cc: 79186 <at> debbugs.gnu.org
> From: "Peder O. Klingenberg" <peder <at> klingenberg.no>
> 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.

Thanks, installed on master, and closing the bug.




This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.