From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tomas Hlavaty Newsgroups: gmane.emacs.help Subject: Re: Workshop to save M$ Windows users - help needed Date: Mon, 04 Oct 2021 20:29:50 +0200 Message-ID: <87ee90y76p.fsf@logand.com> References: <837deua1sd.fsf@gnu.org> <834k9y9ysj.fsf@gnu.org> <87r1d151x1.fsf@logand.com> <87h7dwy9qh.fsf@logand.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22420"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Eduardo Ochs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 04 20:32:17 2021 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 1mXSl6-0005aa-Pw for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 04 Oct 2021 20:32:16 +0200 Original-Received: from localhost ([::1]:40060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXSl5-0005Nx-8C for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 04 Oct 2021 14:32:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXSiq-0005LR-Jj for help-gnu-emacs@gnu.org; Mon, 04 Oct 2021 14:29:56 -0400 Original-Received: from logand.com ([37.48.87.44]:35398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXSio-0006BB-R7 for help-gnu-emacs@gnu.org; Mon, 04 Oct 2021 14:29:56 -0400 Original-Received: by logand.com (Postfix, from userid 1001) id AC66C19EB31; Mon, 4 Oct 2021 20:29:52 +0200 (CEST) X-Mailer: emacs 27.2 (via feedmail 11-beta-1 I) In-Reply-To: <87h7dwy9qh.fsf@logand.com> Received-SPF: pass client-ip=37.48.87.44; envelope-from=tom@logand.com; helo=logand.com 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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:133544 Archived-At: url-retrieve-synchronously2 had a bug this works and should dispose the nework buffer properly: (defun url-retrieve-synchronously7 (url filename) (let (z (again t)) (url-retrieve url (lambda (status) (setq again nil) (when status (setq z status) (let ((coding-system-for-write 'raw-text-unix)) (write-region (point-min) (point-max) filename))) (kill-buffer))) (while again (sleep-for 1)) z)) (url-retrieve-synchronously7 "https://logand.com" "/tmp/e7") (url-retrieve-synchronously7 "https://logand.com1" "/tmp/e7") /tmp/e7 There is a comment in url-retrieve-synchronously about sleep-for and similar suggesting that that might not always work but it works for me. Not sure about windows. I think url-retrieve-synchronously should not ignore the status but return it instead. What other issue did you have with url-retrieve-synchronously apart from not being able to detect errors? Your link to the thread discussed only preference for libcurl. I did not find what is wrong with url-retrieve-synchronously there. Another thing wrong with that is probably that the network buffer is returned but iirc buffers are not garbage collected, or something like that. That's why I put kill-buffer there.