From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.help Subject: Re: functions to download mailing list archives Date: Mon, 13 Jun 2022 01:04:34 +0200 Message-ID: <878rq1cwl9.fsf@telefonica.net> References: <87r13tikgn.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30398"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Help GNU Emacs To: GH Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 13 01:05:12 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o0Wds-0007h8-8i for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 13 Jun 2022 01:05:12 +0200 Original-Received: from localhost ([::1]:59896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0Wdr-0008OG-7N for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 12 Jun 2022 19:05:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0WdP-0008O2-Jt for help-gnu-emacs@gnu.org; Sun, 12 Jun 2022 19:04:43 -0400 Original-Received: from relayout02-redir.e.movistar.es ([86.109.101.202]:19629) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0WdM-0001Bt-Tr for help-gnu-emacs@gnu.org; Sun, 12 Jun 2022 19:04:43 -0400 Original-Received: from sky (104.red-81-39-17.dynamicip.rima-tde.net [81.39.17.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: 981711563@telefonica.net) by relayout02.e.movistar.es (Postfix) with ESMTPSA id 4LLqyp57jCzdb7F; Mon, 13 Jun 2022 01:04:34 +0200 (CEST) In-Reply-To: <87r13tikgn.fsf@gnu.org> (GH's message of "Mon, 13 Jun 2022 00:30:00 +0200") X-TnetOut-Country: IP: 81.39.17.104 | Country: ES X-TnetOut-Information: AntiSPAM and AntiVIRUS on relayout02 X-TnetOut-MsgID: 4LLqyp57jCzdb7F.A848D X-TnetOut-SpamCheck: no es spam, clean X-TnetOut-From: ofv@wanadoo.es X-TnetOut-Watermark: 1655679875.53158@goWK5zNgMh99taIMW9uhzw Received-SPF: softfail client-ip=86.109.101.202; envelope-from=ofv@wanadoo.es; helo=relayout02-redir.e.movistar.es X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:137751 Archived-At: GH writes: > so Im writing functions to interact with ~lists.gnu.org~ http interfaces > > For example this function to download lists mbox archives: [snip] > But sadly the recursion stop with this warning: > > file-local-name: Lisp nesting exceeds `max-lisp-eval-depth' > > any idea to fix? Instead of a recursive function use a recursive data structure: a list. The outer function puts in the list the initial URL, and then, in a loop, pops from the list a URL, downloads it, adds to the list the referenced URLs and repeats until the list is empty or some other condition is met. Some complications may remain: for instance, you need to detect cycles (the failure on your posted code probably comes from that). A list also comes handy for that, if you walk the list with dolist instead of popping elements and add new ones with add-to-list, which omits elements which are already in the list.