X-Loop: help-debbugs@HIDDEN Subject: bug#23430: 25.0.93; iter-defun does not support special form save-current-buffer Resent-From: Dmitry Gutov <dgutov@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 03 May 2016 01:33:02 +0000 Resent-Message-ID: <handler.23430.B.14622391493924 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 23430 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 23430 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.14622391493924 (code B ref -1); Tue, 03 May 2016 01:33:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 May 2016 01:32:29 +0000 Received: from localhost ([127.0.0.1]:34405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1axPCO-00011D-ON for submit <at> debbugs.gnu.org; Mon, 02 May 2016 21:32:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37925) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <raaahh@HIDDEN>) id 1axPCN-00010y-QP for submit <at> debbugs.gnu.org; Mon, 02 May 2016 21:32:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <raaahh@HIDDEN>) id 1axPC9-00064Z-FI for submit <at> debbugs.gnu.org; Mon, 02 May 2016 21:32:19 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <raaahh@HIDDEN>) id 1axPC8-00063l-A7 for submit <at> debbugs.gnu.org; Mon, 02 May 2016 21:32:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57066) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <raaahh@HIDDEN>) id 1axPBw-0006hY-Aa for bug-gnu-emacs@HIDDEN; Mon, 02 May 2016 21:32:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <raaahh@HIDDEN>) id 1axPBi-0005zJ-E4 for bug-gnu-emacs@HIDDEN; Mon, 02 May 2016 21:31:52 -0400 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:38590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <raaahh@HIDDEN>) id 1axPBh-0005wl-5C for bug-gnu-emacs@HIDDEN; Mon, 02 May 2016 21:31:46 -0400 Received: by mail-wm0-x22e.google.com with SMTP id g17so13095842wme.1 for <bug-gnu-emacs@HIDDEN>; Mon, 02 May 2016 18:31:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version; bh=o8R/+eAslZiChY/5fbxtbWrwXxrYnw4ukqWEo3lAJKE=; b=wIqc6I21lkT3SKPG+OiB1LJpcpoVxvOKITCoVnlDspj0UWlWLETa/cuGjU7O/fGvLS TP4XphQduMFdL22WgQvT6BF/ZeSIdcfQlKAYenEIDNp+78qf+rwtkSTEeF0kdgf0uz4G D5Twe0Uy5Rr9tRkI8JWy9RJBu6GBxkZW46Hsj8aYIu7+YEyROws0eF57bdCWqPiH4otH W9pWAp/igY9+bi5fE7zj4chYJRDCt61UZX9Fgia7cZBYGi3MX+BKIsUHc2GSCgiOzjsE 2ExVYhPYKI/e9hCvhHi4aTCfEUMSzZucopJJ1aRq3ugeO6XU8Nw/jkXtF7bBkJDfqkJB pHIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=o8R/+eAslZiChY/5fbxtbWrwXxrYnw4ukqWEo3lAJKE=; b=JghisUdC+7cSk6tQOrYQhvEvdi0xAFKHLn/l+OXY3W1QEkYw8r5R0JdRS7awTpQj1e v4JEgCljgq26KNZ4SnNFrlPhyc+v4QLQjnS/g5Ajs5Cukmrku1zzniwq5Dma1ZG4Znub NNkdQNHD//uu8T50LSr6db/LB1Zbk6jX5f5AdBvmFx1tHS1jdwEFg/sMSgDge++ALw/O UETgWq+TT6ZEsbbWrGkOe1w1nsMvMkPup1aqj7GxNJFu2gM6FDo4UkA74/BvXxQXqLLH MVKUJcxvT5W8eLj48kOilFOCGrdevd3iVvQkmMwZyzPum9asxhjdijwqbND3XGC+uFZs gdXQ== X-Gm-Message-State: AOPr4FVrT13qERax/W106TbYvfb0LGa7EhhNcNH4cVzzph1y9RWj/+vmyJ6hEQw21uWcug== X-Received: by 10.28.148.149 with SMTP id w143mr216400wmd.10.1462239086883; Mon, 02 May 2016 18:31:26 -0700 (PDT) Received: from axl ([185.105.175.24]) by smtp.gmail.com with ESMTPSA id yr1sm960339wjc.9.2016.05.02.18.31.25 for <bug-gnu-emacs@HIDDEN> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 May 2016 18:31:26 -0700 (PDT) From: Dmitry Gutov <dgutov@HIDDEN> Date: Tue, 03 May 2016 04:31:24 +0300 Message-ID: <86k2jc2ahf.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.8 (---) Example: ;; -*- lexical-binding: t -*- (iter-defun (str buf) (with-current-buffer buf (goto-char (point-min))) (let (done) (while (not done) (with-current-buffer buf (if (search-forward str) (iter-yield (match-beginning 0)) (setq done 0)))))) ...upon evaluation, says: "special form (save-current-buffer (set-buffer buf) (if (search-forward str) (cps-internal-yield (match-beginning 0)) (setq cps-binding-done- 0))) incorrect or not supported". The above example seemed to me to be the prime use case for generator.el (e.g. lazily parsing output from an asynchronous process), so this is disappointing. In GNU Emacs 25.0.93.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9) of 2016-04-30 built on axl Repository revision: ffe701cb07cfb3584c4e4894976f0c9487d02c59 Windowing system distributor 'The X.Org Foundation', version 11.0.11803000 System Description: Ubuntu 16.04 LTS
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Dmitry Gutov <dgutov@HIDDEN> Subject: bug#23430: Acknowledgement (25.0.93; iter-defun does not support special form save-current-buffer) Message-ID: <handler.23430.B.14622391493924.ack <at> debbugs.gnu.org> References: <86k2jc2ahf.fsf@HIDDEN> X-Gnu-PR-Message: ack 23430 X-Gnu-PR-Package: emacs Reply-To: 23430 <at> debbugs.gnu.org Date: Tue, 03 May 2016 01:33:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 23430 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 23430: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D23430 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: bug#23430: 25.0.93; iter-defun does not support special form save-current-buffer Resent-From: Dmitry Gutov <dgutov@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Thu, 05 May 2016 22:48:01 +0000 Resent-Message-ID: <handler.23430.B23430.146248842425616 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 23430 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 23430 <at> debbugs.gnu.org Received: via spool by 23430-submit <at> debbugs.gnu.org id=B23430.146248842425616 (code B ref 23430); Thu, 05 May 2016 22:48:01 +0000 Received: (at 23430) by debbugs.gnu.org; 5 May 2016 22:47:04 +0000 Received: from localhost ([127.0.0.1]:40899 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ayS2y-0006f5-4j for submit <at> debbugs.gnu.org; Thu, 05 May 2016 18:47:04 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:36555) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <raaahh@HIDDEN>) id 1ayS2w-0006eb-Hn for 23430 <at> debbugs.gnu.org; Thu, 05 May 2016 18:47:02 -0400 Received: by mail-wm0-f48.google.com with SMTP id n129so37670151wmn.1 for <23430 <at> debbugs.gnu.org>; Thu, 05 May 2016 15:47:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to; bh=EaqK3pqKqR+agt1HRSoBKnz95NLii6uzmqdHMHTG91k=; b=QMVIygi2d+oDfaWpCs+vBbTqHeCOHCqcq0NNYjUx+KrGqeM1F/bqijOTW76Ol4muOr /iYy6LpYcaKarjcMBbriMMxuWVTeiOaDRD+7Je67nybtnbm/Fip3ITZhnd8POARuK5qw eQHUM5W37FkMR5IF8YjH8aVcx/aZOJlIw90fGY5T1iMOoH28lWY61CKM/UXKJMkTwb2j ie30XARueNDWv0bQce2xLda0/EtrFqWJWy1zKG4+q7CCbUir9Cvar3WRAF1BzstgGZW7 IRth4/98X8uQPLLM5fPzhu/Hh4TXQnZYDLlAVgGl8k6Mlr1MkFu1yTnOSLIemLcEkxcy QK1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to; bh=EaqK3pqKqR+agt1HRSoBKnz95NLii6uzmqdHMHTG91k=; b=EAY7E8E4MiKTHv5cIC0Y2MFnINnAXUR3331C4WF+Z/0nLLTX0KNgYF1byFYJfHPFMP TBeonnYA5o9kptpbW84Q+5mYaJBc/GwxXr3lVycioRBBXcIpHGeGLzqf+WX1Ty8vcjOE Ltzo5dTRN04P1BdpYPfkQ0mC9/5x/WU5I2dcGtIoi1OnnEMT/i8eEMpUelYPQRSkLv0Q UxBLCBQHrjMXAaX+qbr+piq4hWR3v3Ge/VBGqvK5c3uzb3DaGyTH/efOCGH0Hf0Xqpuh uTuv3XdNKdSQrJXM51KKQcLRpMpBsYZgXBQHD2rZoF3lj2SqKpxuzlCEmax9LPyakcGx oQ7Q== X-Gm-Message-State: AOPr4FV/vcrmtKVz1hSWUap62tpV7KwST+bKtrr83wOfJEdd7M6T/Gb74DJAkhugn1sFhA== X-Received: by 10.28.234.130 with SMTP id g2mr6174736wmi.42.1462488416934; Thu, 05 May 2016 15:46:56 -0700 (PDT) Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id jq1sm11873826wjc.28.2016.05.05.15.46.55 for <23430 <at> debbugs.gnu.org> (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 May 2016 15:46:56 -0700 (PDT) References: <86k2jc2ahf.fsf@HIDDEN> From: Dmitry Gutov <dgutov@HIDDEN> Message-ID: <bba9665d-c646-5ec0-3c8b-233b4007c5ec@HIDDEN> Date: Fri, 6 May 2016 01:46:54 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1 MIME-Version: 1.0 In-Reply-To: <86k2jc2ahf.fsf@HIDDEN> Content-Type: multipart/mixed; boundary="------------78EECA99810C866BEA655167" X-Spam-Score: -0.5 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.5 (/) This is a multi-part message in MIME format. --------------78EECA99810C866BEA655167 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 05/03/2016 04:31 AM, Dmitry Gutov wrote: > The above example seemed to me to be the prime use case for generator.el > (e.g. lazily parsing output from an asynchronous process), so this > is disappointing. Actually, I take this back. - generator.el doesn't seem useful for parsing output from an asynchronous process because it has no way to indicate whether the process has new output, or to return control back to Emacs while the process is still running but has no new output. It seems to call for a different abstraction. - with-current-buffer turned out not to be so essential. Nor save-excursion. I've reimplemented xref--buf-pairs-iterator using iter-lambda but couldn't get the full benefit of the package because that function also needs a way to reliably clean up resources. The result is a bit more comprehensible, but also longer, so I'm hesitant to use it (attached). So sum up, maybe this bug can be closed, but I'd like to see Daniel's opinion. Supporting with-current-buffer might turn out to be more essential in other cases. --------------78EECA99810C866BEA655167 Content-Type: text/x-patch; name="xref-gen.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xref-gen.diff" diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index f651dc9..f8b3c85 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -71,6 +71,7 @@ (require 'ring) (require 'pcase) (require 'project) +(require 'generator) (eval-when-compile (require 'semantic/symref)) ;; for hit-lines slot @@ -534,19 +535,12 @@ xref-query-replace-in-results (funcall iter :cleanup)))) (defun xref--buf-pairs-iterator (xrefs) - (let (chunk-done item next-pair file-buf pairs all-pairs) - (lambda (action) - (pcase action - (:next - (when (or xrefs next-pair) - (setq chunk-done nil) - (when next-pair - (setq file-buf (marker-buffer (car next-pair)) - pairs (list next-pair) - next-pair nil)) - (while (and (not chunk-done) - (setq item (pop xrefs))) - (save-excursion + (let* (item + file-buf pairs all-pairs + (iter + (funcall + (iter-lambda () + (while (setq item (pop xrefs)) (let* ((loc (xref-item-location item)) (beg (xref-location-marker loc)) (end (move-marker (make-marker) @@ -568,9 +562,19 @@ xref--buf-pairs-iterator ((equal file-buf (marker-buffer beg)) (push pair pairs)) (t - (setq chunk-done t - next-pair pair)))))))) - (cons file-buf (nreverse pairs)))) + (iter-yield (cons file-buf (nreverse pairs))) + (setq file-buf (marker-buffer beg) + pairs (list pair))))))) + (when (null xrefs) + (iter-yield (cons file-buf (nreverse pairs))))))))) + (lambda (action) + (pcase action + (:next + (condition-case nil + (save-excursion + (iter-next iter)) + (iter-end-of-sequence + nil))) (:cleanup (dolist (pair all-pairs) (move-marker (car pair) nil) --------------78EECA99810C866BEA655167--
X-Loop: help-debbugs@HIDDEN Subject: bug#23430: 25.0.93; iter-defun does not support special form save-current-buffer Resent-From: Michael Heerdegen <michael_heerdegen@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 06 May 2016 23:26:01 +0000 Resent-Message-ID: <handler.23430.B23430.146257715629911 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 23430 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov <dgutov@HIDDEN> Cc: 23430 <at> debbugs.gnu.org Received: via spool by 23430-submit <at> debbugs.gnu.org id=B23430.146257715629911 (code B ref 23430); Fri, 06 May 2016 23:26:01 +0000 Received: (at 23430) by debbugs.gnu.org; 6 May 2016 23:25:56 +0000 Received: from localhost ([127.0.0.1]:42112 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1ayp87-0007mN-TP for submit <at> debbugs.gnu.org; Fri, 06 May 2016 19:25:56 -0400 Received: from mout.web.de ([212.227.15.3]:51951) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <michael_heerdegen@HIDDEN>) id 1ayp85-0007mA-Sx for 23430 <at> debbugs.gnu.org; Fri, 06 May 2016 19:25:54 -0400 Received: from drachen.dragon ([90.186.2.53]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0MgO9u-1bKLqn07kM-00Nixl; Sat, 07 May 2016 01:25:47 +0200 From: Michael Heerdegen <michael_heerdegen@HIDDEN> References: <86k2jc2ahf.fsf@HIDDEN> <bba9665d-c646-5ec0-3c8b-233b4007c5ec@HIDDEN> Date: Sat, 07 May 2016 01:25:44 +0200 In-Reply-To: <bba9665d-c646-5ec0-3c8b-233b4007c5ec@HIDDEN> (Dmitry Gutov's message of "Fri, 6 May 2016 01:46:54 +0300") Message-ID: <87a8k2ahvr.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:dwrgcO0w2uYSL0HbGj42PJbRFm0nGjNlWw93lyzj/4LDa5G1dKy o7OQfNSDm/oZGe78d+JmfcTROVbqbz2KDZS/dABmp+s+w7ezSeSJs0R3zsW8ykejJuv3Nrv 2gd8Ct5pcSs8tP717p/q0FhD6xVgiWpFFoK5Ix9XcNNUswDX7EYXWZPwsJaGqHQqkot3qLP gxx/YthraFTLCM+DEpTDg== X-UI-Out-Filterresults: notjunk:1;V01:K0:3/HNVf3jRGE=:9kl3cdHhY9H03EFnRJuFYe wQddWK9Vs1/OvvoxR6Q8Xrkrm9RsWl5xdRpYd3b29lcM4YNnUiPS4clXDc+suApLaKz2BVe7R WBx6KqG4C+b5O7e9iV9hNSRXqaXve0UvSByRlk89LgwtF+Xf2bj/W8mTMB7gZqLa8H/KUef55 HTvdhwi3fy04L6hMIjgdjNX8LW8Pbnt8P0l59hXzvxTE8TsFVst1cDfTMJzSicPOGIN2NR7Jz byI/eYspZaCJO7qQvcf1CC2yiDDYSnkL5g8Z7NsCE46xOOjiE/tgsl4CZ2lccdgKcd97eZjUG FBD8/EPYnKXnUDm3oKeeNFojr4lo9m9yDqJCRNv6jfnd2tWLdX3LzzqOu8oH1j+ybXSXupM7u 7xo8RGdNvhKpxlzVrIEijAL6IHp+OrrYSPV6fTL6+o8aAvhOLYX5JZ8mR/ibEIy6y8K8QOK/A zrfndVURG+rUoxPcpzZaW1HDbm3s1OLG0UKuZ3/t8fogMwlZGmhjRFQ4ncBzj9Jq9AId1/t8o QMbK1Fvbc1cTUVkeQmCkVIgps1BiDQJ75r987MTpyTDl/1Dy0VSK+tOQF8GOPkUH0qAf/X3wv /NTi1Fr2SUvGKLwwGth0O6PDnzgrL89Ih8DQykt48f+eCFziqGo+HSt/p6rE9hwhX4GA/bNPi Vr5yS6eFgOS60Uq04x33LmRutoyAEAWiFrAM5Xe5i4QL4ih4mWaL6yEgbbSK2I6wEeZAgAcy6 EBsEn8RhGAnl0AvnYBaV5pxh7ugOc8UahCQyIv+pIaKtq0c6/g3JRNac+Hayw2q1qeYNB5Tly zteLygR X-Spam-Score: -2.8 (--) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.8 (--) Dmitry Gutov <dgutov@HIDDEN> writes: > So sum up, maybe this bug can be closed, but I'd like to see Daniel's > opinion. Supporting with-current-buffer might turn out to be more > essential in other cases. FWIW it's not crystal clear to me what the semantics of a supported `with-current-buffer' would be. In particular: would `iter-yield' "jump out" of the `with-current-buffer' and restore the previous buffer, and would a restart of the generator change the current buffer again? Regards, Michael.
X-Loop: help-debbugs@HIDDEN Subject: bug#23430: 25.0.93; iter-defun does not support special form save-current-buffer Resent-From: Dmitry Gutov <dgutov@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 06 May 2016 23:31:01 +0000 Resent-Message-ID: <handler.23430.B23430.146257742130392 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 23430 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Michael Heerdegen <michael_heerdegen@HIDDEN> Cc: 23430 <at> debbugs.gnu.org Received: via spool by 23430-submit <at> debbugs.gnu.org id=B23430.146257742130392 (code B ref 23430); Fri, 06 May 2016 23:31:01 +0000 Received: (at 23430) by debbugs.gnu.org; 6 May 2016 23:30:21 +0000 Received: from localhost ([127.0.0.1]:42116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1aypCP-0007u8-Di for submit <at> debbugs.gnu.org; Fri, 06 May 2016 19:30:21 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:38500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <raaahh@HIDDEN>) id 1aypCN-0007tw-W8 for 23430 <at> debbugs.gnu.org; Fri, 06 May 2016 19:30:20 -0400 Received: by mail-wm0-f46.google.com with SMTP id g17so99666526wme.1 for <23430 <at> debbugs.gnu.org>; Fri, 06 May 2016 16:30:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=X2+gPUyot8oFlcbw6DrzlTZGODbmNf8GYCfREx6/AXc=; b=vQEGo7ozWp2QA600dvgOslOwbctt9MXqMc9AGzg7QGnd4aCqgkO2/W7VERcostJU2J WfvJraoXbF4OyzS1xtssm70/OWUklU2fAUSZFh0V6M8l2BaAy6rXSfVlB3Qt4wQOYsq1 z5v8QW1qP2iaX1FuLh9ZDyLbeSOkrCYSKM8jWGirA+pN10vCNuHm9dSYu4rw05cpzNDE 02GUSyYT6ao/V3XOvGg9LTD5AW9qJnqImGs8MKk3IkWiUaxiZmmzW94KVjQxqEhDMYv/ +Xvi3ZDwZEOyOOD/diXe9cQNbWdytb5mvwPuZZN90Gc4gmXS+4oh+vmEvSZEP1V1FRnx j0wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=X2+gPUyot8oFlcbw6DrzlTZGODbmNf8GYCfREx6/AXc=; b=PrOQsQkzjCvUMt5Zwdgfe96J0dOdoIiKsfHtzRsYkHe6T37H6mcuORqBq1PCQF6AUj vaV0fy7jTlZBpfrC5VCDoSXIMwXKR8JEKcN6R8JpuYRAF3Edk6Escm/8cXDd3f7YluD0 cCM0YPujAjrlqkawpvXhG20AvruLPdEM01w7RCVmA5LMCpYYZqoDOGgfPzfmLlQ0/DHr 1VTScWZTySb/uMtfsnFBa5osRTBeZNSdphSjygtcgkKLrC9Zym/yWzh7T+RPiTiFoyZC e8OQrtGJ3mPdUdANjg4dwXV4SUn1f5cfiDB0COI9koqu5Pd5U75K3tmvPeXCendwVau6 pBTQ== X-Gm-Message-State: AOPr4FUUnNA/52n+TsOH7hKv5N2SCucXKWhGlV/gbMTvNitpSnROsvarY/9y6govhX2Ylg== X-Received: by 10.28.194.69 with SMTP id s66mr146342wmf.87.1462577414426; Fri, 06 May 2016 16:30:14 -0700 (PDT) Received: from [192.168.1.2] ([185.105.175.24]) by smtp.googlemail.com with ESMTPSA id b15sm10714946wmd.1.2016.05.06.16.30.13 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 06 May 2016 16:30:13 -0700 (PDT) References: <86k2jc2ahf.fsf@HIDDEN> <bba9665d-c646-5ec0-3c8b-233b4007c5ec@HIDDEN> <87a8k2ahvr.fsf@HIDDEN> From: Dmitry Gutov <dgutov@HIDDEN> Message-ID: <c09b8d48-74bf-fd84-65da-50fa0c2ffa51@HIDDEN> Date: Sat, 7 May 2016 02:30:12 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1 MIME-Version: 1.0 In-Reply-To: <87a8k2ahvr.fsf@HIDDEN> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.5 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.5 (/) On 05/07/2016 02:25 AM, Michael Heerdegen wrote: > FWIW it's not crystal clear to me what the semantics of a supported > `with-current-buffer' would be. In particular: would `iter-yield' "jump > out" of the `with-current-buffer' and restore the previous buffer, and > would a restart of the generator change the current buffer again? I think so, yeah. In the "rewritten" version of code, with-current-buffer would surround the function's body, so each time the function is called, with-current-buffer would be applied. The value of point may or may not be saved and restored (this question also seems problematic, admittedly).
Received: (at control) by debbugs.gnu.org; 12 Aug 2020 02:33:20 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Aug 11 22:33:20 2020 Received: from localhost ([127.0.0.1]:42336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1k5gZr-0001eq-Vp for submit <at> debbugs.gnu.org; Tue, 11 Aug 2020 22:33:20 -0400 Received: from mail-yb1-f176.google.com ([209.85.219.176]:34823) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1k5gZq-0001ea-Fx for control <at> debbugs.gnu.org; Tue, 11 Aug 2020 22:33:18 -0400 Received: by mail-yb1-f176.google.com with SMTP id y134so567015yby.2 for <control <at> debbugs.gnu.org>; Tue, 11 Aug 2020 19:33:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=QIYFBzjEuze3UbmghBBQXGqRb7hIp6tJrVjABeMj5uY=; b=dawe86KJ5sApTCRKBpLMNpI4vYTBFomfok2Wx5jYa0Zd5ZBWqN3CsaGcktM2yw96mp mLE1SAOwPCX6OTntooUPjN54g3wniuX9826loyUTjzN5s5piK728AgDkTa4SIXTAsAMX UKxPWniTN46BjbV3HWzZS6XHMaZReKeM06oOR/t12c7slcTg8ZGnkf6yv0oi7ax4bOxz pi5/SbypgZgUzFTnerXqX5W3HSIAvsfXkTUo8JJo5r33wy7JMIeBpg0RcbIhRvLeFH97 Bfq3IKE0eAsmjZGbLUSylCUVu6DDQRCI/2lyh/Ofh2hhSRm9S5hDKT58TTEwLiwiQnOL VBnw== X-Gm-Message-State: AOAM530zCMYaAhDcxboFpPcl55mWWivl3zwftpkNmm4a2x4bULUvQzp/ 3a+uCsKy9isbIpYDEVkf1t4Ztb2+j+MyR+OkOFQA0Axrl4nrbw== X-Google-Smtp-Source: ABdhPJz1XYalM1VjsWrVf0fonYTt4p+WRmpQuS3W6yzWwYA0h7VX2YcrNgTR2UFk53zN/F2HX4RMo7rF+s1nY9AdOJM= X-Received: by 2002:a25:7007:: with SMTP id l7mr49386743ybc.85.1597199590995; Tue, 11 Aug 2020 19:33:10 -0700 (PDT) MIME-Version: 1.0 From: Stefan Kangas <stefan@HIDDEN> Date: Wed, 12 Aug 2020 04:33:00 +0200 Message-ID: <CADwFkm=bkkipQPLEVB1aa1Vdm8cnpjB1BLoQZCX_qN=nX5Yrtw@HIDDEN> Subject: To: control <control <at> debbugs.gnu.org> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 3.0 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 23430 + moreinfo thanks Content analysis details: (3.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stefankangas[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.176 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.176 listed in wl.mailspike.net] 1.0 PDS_TONAME_EQ_TOLOCAL_VSHORT Very short body and From looks like 2 different emails 0.0 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different 2.0 BLANK_SUBJECT Subject is present but empty X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 23430 + moreinfo thanks Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.219.176 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.219.176 listed in list.dnswl.org] 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stefankangas[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 1.0 PDS_TONAME_EQ_TOLOCAL_VSHORT Very short body and From looks like 2 different emails 0.0 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different 2.0 BLANK_SUBJECT Subject is present but empty -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager tags 23430 + moreinfo thanks
X-Loop: help-debbugs@HIDDEN Subject: bug#23430: 25.0.93; iter-defun does not support special form save-current-buffer Resent-From: Stefan Kangas <stefan@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 12 Aug 2020 02:42:02 +0000 Resent-Message-ID: <handler.23430.B23430.15972001067273 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 23430 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo To: Dmitry Gutov <dgutov@HIDDEN> Cc: 23430 <at> debbugs.gnu.org Received: via spool by 23430-submit <at> debbugs.gnu.org id=B23430.15972001067273 (code B ref 23430); Wed, 12 Aug 2020 02:42:02 +0000 Received: (at 23430) by debbugs.gnu.org; 12 Aug 2020 02:41:46 +0000 Received: from localhost ([127.0.0.1]:42355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1k5gi2-0001tF-8h for submit <at> debbugs.gnu.org; Tue, 11 Aug 2020 22:41:46 -0400 Received: from mail-yb1-f174.google.com ([209.85.219.174]:45069) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1k5gi0-0001sr-VU for 23430 <at> debbugs.gnu.org; Tue, 11 Aug 2020 22:41:45 -0400 Received: by mail-yb1-f174.google.com with SMTP id x2so539700ybf.12 for <23430 <at> debbugs.gnu.org>; Tue, 11 Aug 2020 19:41:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:user-agent :mime-version:date:message-id:subject:to:cc; bh=WZOHPvkFXvBfKD61/Fwo58HoZ20zlL4rZlTmnifUXJo=; b=Iowug01NsP27rE7a2FHIECTHZWbh3mcqbWx9ZR7O+Ju5vYK3zPJuEQc+iY8AukLn+C SH5r0UMqFuGYzyAi9VH0nj4dl4GVc0rRuZBoZsUUcfYgyRx/YWyJiT7F0lkuqJM34UOj ZBXNWGK3lVOsZzF6f0NunuwXv2vt+nIYVOLfbcslHnoiCQA934QjDuny1FQb2YNFQ3+L bPEUSX1/3Pe03LhO4lKGQhtWXPM+ujkeG8Z2Y5UDhoP0mDO3R4UQ8KIBqp2QSytz3ZD5 BpHUxfyuMmhLhLF4bZOpR6Kj5+ZDiCTXsalaIgc6ny5oV6Lr8ZrQVxOaUBFsNekVJui9 nj/g== X-Gm-Message-State: AOAM530EtaQ5p7KgHpD71Zz+ruZZwpFHY6hXcogxhVTpARGqGkL61LDe 3jXIn+azhicbexSr9uxsiN/fHQf5HUISs81+sRM= X-Google-Smtp-Source: ABdhPJyGTzZJDxOFHyLEVSgHokbfIIjpWwvLnuj7EXKoGXQofrfKuNDXbUMvYrmrwJeFygQKQyIlqQI/WQD4JTJBLyg= X-Received: by 2002:a25:880e:: with SMTP id c14mr53947471ybl.181.1597200099633; Tue, 11 Aug 2020 19:41:39 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 11 Aug 2020 19:41:39 -0700 From: Stefan Kangas <stefan@HIDDEN> In-Reply-To: <bba9665d-c646-5ec0-3c8b-233b4007c5ec@HIDDEN> (Dmitry Gutov's message of "Fri, 6 May 2016 01:46:54 +0300") References: <86k2jc2ahf.fsf@HIDDEN> <bba9665d-c646-5ec0-3c8b-233b4007c5ec@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Date: Tue, 11 Aug 2020 19:41:39 -0700 Message-ID: <CADwFkmmgWb5JyWx9RLDnHZiDG99zyxvPg_+wzpq0d1VLR77q_A@HIDDEN> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi Dmitry, Dmitry Gutov <dgutov@HIDDEN> writes: > On 05/03/2016 04:31 AM, Dmitry Gutov wrote: > >> The above example seemed to me to be the prime use case for generator.el >> (e.g. lazily parsing output from an asynchronous process), so this >> is disappointing. > > Actually, I take this back. > > - generator.el doesn't seem useful for parsing output from an asynchronous > process because it has no way to indicate whether the process has new output, > or to return control back to Emacs while the process is still running but has no > new output. It seems to call for a different abstraction. > > - with-current-buffer turned out not to be so essential. Nor > save-excursion. I've reimplemented xref--buf-pairs-iterator using > iter-lambda but couldn't get the full benefit of the package because that > function also needs a way to reliably clean up resources. The result is a bit > more comprehensible, but also longer, so I'm hesitant to use it (attached). > > So sum up, maybe this bug can be closed, but I'd like to see Daniel's > opinion. Supporting with-current-buffer might turn out to be more > essential in other cases. Is this patch still relevant or should this be closed? Best regards, Stefan Kangas
X-Loop: help-debbugs@HIDDEN Subject: bug#23430: 25.0.93; iter-defun does not support special form save-current-buffer Resent-From: Dmitry Gutov <dgutov@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Wed, 12 Aug 2020 10:07:02 +0000 Resent-Message-ID: <handler.23430.B23430.15972268035023 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 23430 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo To: Stefan Kangas <stefan@HIDDEN> Cc: 23430 <at> debbugs.gnu.org Received: via spool by 23430-submit <at> debbugs.gnu.org id=B23430.15972268035023 (code B ref 23430); Wed, 12 Aug 2020 10:07:02 +0000 Received: (at 23430) by debbugs.gnu.org; 12 Aug 2020 10:06:43 +0000 Received: from localhost ([127.0.0.1]:42948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1k5ned-0001Ix-06 for submit <at> debbugs.gnu.org; Wed, 12 Aug 2020 06:06:43 -0400 Received: from mail-wm1-f41.google.com ([209.85.128.41]:50652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <raaahh@HIDDEN>) id 1k5neb-0001Ij-JS for 23430 <at> debbugs.gnu.org; Wed, 12 Aug 2020 06:06:41 -0400 Received: by mail-wm1-f41.google.com with SMTP id c80so1280789wme.0 for <23430 <at> debbugs.gnu.org>; Wed, 12 Aug 2020 03:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=IkBmZcdauM9oqkOQEC+tOJi2gUpQeuiRqNC+QIMmtI0=; b=ANh4mjRx8z9os28rbHCsEdOR2DFSoe5wrbBXy/S1EQ1GbqWvvuo1us/YdOv59e9F+9 Sow33587bPnUnWAUYY2T32BWpqN2sSqr758yrWtaAq7PksLkH4qkZ6iSZGkEIT8kDCRd lwx+IoTWM05Ihhml0UqvLSV6dFrMaLVMB2tZwhEhS1iaQitJOJuMo1KVa7U01xq+8jLc CjY7xDxtAWMKyjYhLPCnGMbl5kdSwvklQ7jrSxmVSiPaUxZdGVYkL1o26OCcQAwg+abg 0B0wvoBC1+9O8FBpttkXznyfCMwt3cxYzoX8TTLratfEyGM2hHWcfoaWCh/GzXT+SlFK +3+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=IkBmZcdauM9oqkOQEC+tOJi2gUpQeuiRqNC+QIMmtI0=; b=avFyL1Ri5e0W6kcfTWUDYhvMftmo7jCtRIyZdmCu/bOX/wC0wVm50t6nf5JwabLBcT pUdR60+hEx5ZSCeIF1hqxsGeGYwZiD6dlTnIX3euMzEw++bDEV2J83YsyzgbnzNSCCU/ 20SXywYb6M8FIFA35Exj2klaJj9H0TKI+uZeBR3k5zQ+53j2ZnzqCMjTeSPwAP0tIYWp DJ47g599IFfMDJUfAJ2dQ9pCISh547uBraBMm42/n1kupRmyGXjqELvEqVcDggqEUXCF hvriJtbkHvSMLs6BpKgh6WKeGu9KZfVHz7aS40YLp923E4PaxQMmfTgcVTmlvTe1E0Pd lQbA== X-Gm-Message-State: AOAM530/PwL8BhM1m2SWEr6fqbJni0hz4ytX9bKzdHkj89bbNhfaKool iqYGaAK7c+HmnPu0xL0fyUtCdA5f X-Google-Smtp-Source: ABdhPJyCPW8H0ZgwQvBjW4f4bfKuZyfb3ZIhHex6FXdFYgBOUQ1VadWh+rln2YKonpm/ekuIOtLv8A== X-Received: by 2002:a1c:e0d7:: with SMTP id x206mr8521424wmg.91.1597226795450; Wed, 12 Aug 2020 03:06:35 -0700 (PDT) Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id a11sm3619298wrq.0.2020.08.12.03.06.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Aug 2020 03:06:34 -0700 (PDT) References: <86k2jc2ahf.fsf@HIDDEN> <bba9665d-c646-5ec0-3c8b-233b4007c5ec@HIDDEN> <CADwFkmmgWb5JyWx9RLDnHZiDG99zyxvPg_+wzpq0d1VLR77q_A@HIDDEN> From: Dmitry Gutov <dgutov@HIDDEN> Message-ID: <d7ae1f11-7c1e-24f8-79d4-dab73a17a64f@HIDDEN> Date: Wed, 12 Aug 2020 13:06:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <CADwFkmmgWb5JyWx9RLDnHZiDG99zyxvPg_+wzpq0d1VLR77q_A@HIDDEN> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) On 12.08.2020 05:41, Stefan Kangas wrote: > Is this patch still relevant or should this be closed? The patch was just an illustration. But problem is still there, and still seems valid. Before we close this, I'd like to hear from somebody who understands what generator.el is actually for.
X-Loop: help-debbugs@HIDDEN Subject: bug#23430: 25.0.93; iter-defun does not support special form save-current-buffer Resent-From: Michael Heerdegen <michael_heerdegen@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sun, 16 Aug 2020 13:34:02 +0000 Resent-Message-ID: <handler.23430.B23430.159758483017465 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 23430 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo To: Dmitry Gutov <dgutov@HIDDEN> Cc: 23430 <at> debbugs.gnu.org, Stefan Kangas <stefan@HIDDEN> Received: via spool by 23430-submit <at> debbugs.gnu.org id=B23430.159758483017465 (code B ref 23430); Sun, 16 Aug 2020 13:34:02 +0000 Received: (at 23430) by debbugs.gnu.org; 16 Aug 2020 13:33:50 +0000 Received: from localhost ([127.0.0.1]:57054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1k7InF-0004Xc-T0 for submit <at> debbugs.gnu.org; Sun, 16 Aug 2020 09:33:50 -0400 Received: from mout.web.de ([212.227.15.14]:35117) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <michael_heerdegen@HIDDEN>) id 1k7InC-0004XN-ER for 23430 <at> debbugs.gnu.org; Sun, 16 Aug 2020 09:33:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1597584820; bh=SS2eIwBJivBbz5dAd6NoFBmGpHdWEYHxRh/grnp3L+0=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=gxwk74IUwCZKRnLfe8NI6aB/2qb/8BfpJYj/72WqftfkIs0zvaijqy0DfLc26sls0 utzOV3AzuEc8YSXIM+zYRMwPWSl2HOPg8YtDcX4gbTsnAxi8cKtJWuweYZtO/QJYvf U4Fxe/vHY05RWf0wGkYRbKrv2mLBbvI7eH8qmWHg= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([217.247.71.68]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MVGow-1kBAwn3naQ-00YgVA; Sun, 16 Aug 2020 15:33:39 +0200 From: Michael Heerdegen <michael_heerdegen@HIDDEN> References: <86k2jc2ahf.fsf@HIDDEN> <bba9665d-c646-5ec0-3c8b-233b4007c5ec@HIDDEN> <CADwFkmmgWb5JyWx9RLDnHZiDG99zyxvPg_+wzpq0d1VLR77q_A@HIDDEN> <d7ae1f11-7c1e-24f8-79d4-dab73a17a64f@HIDDEN> Date: Sun, 16 Aug 2020 15:33:38 +0200 In-Reply-To: <d7ae1f11-7c1e-24f8-79d4-dab73a17a64f@HIDDEN> (Dmitry Gutov's message of "Wed, 12 Aug 2020 13:06:33 +0300") Message-ID: <87tux2btql.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:SwNY/zkzj/TVma/uzrGycAaX0GtxaShaJATunRluXP1hUmxWdwo /lhToE9vKFNpWLjdcpN7pwrEPsQDYbgbp8JF4keEzOArySHDPhlQFX/5EaXurGbl5VurjJR OivHnsa+dkkSxlVX7iQEaiAG8BhyZmlRzZQTEt36tK1Dc1l4biYGBXIWdCH0qHYOAHxBvKn 4BAD7jnd8Ih0TR+kV1BJQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:t01n49wZAUA=:s8iTQaVHYxRli5juRziuHH jw5lb3wJOmoGnmv59nAnrHEii5WUkP1jWCM8oFmlSWz7j5bGqcxPfyZUPAjth5uBAzM53ODMi WIyLugCskLqTUULdGW4tFkPMm5z7JlRAa87HNYoXOKJp0v9Q+Ap4fzJQH+CPPKDZhj2mFjMcV Z/ySgWMYvokf4rUP7KcRW1MKzkvUjtDppwU/eqoTiQaKiVCVjcvbE54AdDMLP7/RF6/L6odhC LJXhYKj3Vaiduec3rpso9C/lRJ7FalmOm4fAXG1+FE/kfrqiGJA1G44HzHDk8uCPs4NXOerzG L4ZLhUjpP/olaphRBypIT31N+VqTtUpmHJHVNiey5SUk9yaJwAoOSBOwyhZZZWl5NdjCqFAsR vo97pKms/ueolcp2GvyAbFQQ9vaCPakOkEkv0mBrMR+81EjKQ7Un6ZBelXFlzHcsDYbl06S4G eoA2u1JSwfBUhBwYiMsx4NTBcj4k7Ce1/kBAARitohCRRpOOuVntahTOZ+9VccRz0wxwl7iXk b/3KB9Spob/QVCq9tbpto+JJ54radECtS/lTNMpjckA+9Z6IYc+o/lLnu0eqgAWLv2fyVD8BP gdr1uzFR4owHgEfB/9wPgykTUr7G8mRdXz/9XBjWc2X/hFaMBb8tQILWjHkyfD6C4DKXUyQy5 UPO3fQEorPUK/GTZTgNUKxQP+YhSM02eywv9YaHw3bmCbVU0yW3IKiuyQv0hzYvXEQ+W1uU3Y VxGOJaUPbdGminWqXalS4PvV2JOSa24aMxX/weDlu9WRs7CbFhdDZpeD2TidH0p4QqivC8mV+ aRfMAPj7rTAPTEKOczrP1stojp1xsEvnnb0HpIJ+DnBBBNFTJsWOUeGnNSDL+YSCZrGGBa/+m ME/xsA/KINqBFCXVF3yFJIu0p9unNHFY2CfTijAB6cWvQiCXpSjhXzO9kPfUSwBwQ4JWhoO2p +3TeA2tZCNea465GQsxPpGLbA4Fv7pvtz9bWF7vdHrzZ17rIuRjf2zf7mGhOlqJidgp8YafMA kdjVX/w8zh2ZbXUIFZx7gEmAOIQPW908jVZ1ykcDSrcQNLzKtqBVL2UJ+RnGdbaQHMHL9nxVP fvavf6Tj0ceqz7UU6elc9nLUJUeSHrm6JiGb+haFTZd5xNm1GvhRYZ8a37NZNOBl2D0263lQd EwafOBoAkgFHusDmbHhvjs4kCNnbx3p6Bf35iL8LnVVgfpUdBhFZ+1PlFGI6cGWzVWc91aLSx Q3DmQb+TpOOOYZuJZndqcjGzvOo1GwmBO5Z5LjQ== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Dmitry Gutov <dgutov@HIDDEN> writes: > Before we close this, I'd like to hear from somebody who understands > what generator.el is actually for. I think it's just a straightforward implementation of generators as described here: https://en.wikipedia.org/wiki/Generator_%28computer_programming%29 I learned about them in university, and have used them once in a while. AFAIK handling asynchronous process output is not a good task for them. I think: The problem of the concept of generators in an editor is that generators are good for saving the state of a computation, but Emacs as an editor has a lot of "environment" state (current buffer, value of point, ...), and when the computation represented by the generator messes with this state (or has side effects), the concept doesn't fit that well. When working with streams, I make the handling of the according part of the environment explicit saving it in variables (iterators are closures) and "yield" outside of any xxx-recursion, in your introductory example, that would look like this: #+begin_src emacs-lisp (require 'generator) (iter-defun my-search (str buf) (with-current-buffer buf (goto-char (point-min))) (let ((pos (point)) (yield nil) (done nil)) (while (not done) (when yield (iter-yield yield) (setq yield nil)) (with-current-buffer buf (goto-char pos) (if (search-forward str) (setq yield (match-beginning 0) pos (point)) (setq done 0)))))) #+end_src I guess it would be nice if that could work implicitly in some way, but that would probably require the introduction of new special forms adapted to the situation, like `iterator-save-buffer-and-point' or so. Just extrapolating my university knowledge however... Michael.
X-Loop: help-debbugs@HIDDEN Subject: bug#23430: 25.0.93; iter-defun does not support special form save-current-buffer Resent-From: Michael Heerdegen <michael_heerdegen@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Tue, 18 Aug 2020 12:09:01 +0000 Resent-Message-ID: <handler.23430.B23430.159775253324867 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 23430 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo To: Dmitry Gutov <dgutov@HIDDEN> Cc: 23430 <at> debbugs.gnu.org, Daniel Colascione <dancol@HIDDEN>, Stefan Kangas <stefan@HIDDEN> Received: via spool by 23430-submit <at> debbugs.gnu.org id=B23430.159775253324867 (code B ref 23430); Tue, 18 Aug 2020 12:09:01 +0000 Received: (at 23430) by debbugs.gnu.org; 18 Aug 2020 12:08:53 +0000 Received: from localhost ([127.0.0.1]:34422 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1k80Q9-0006T1-Dh for submit <at> debbugs.gnu.org; Tue, 18 Aug 2020 08:08:53 -0400 Received: from mout.web.de ([212.227.17.12]:57213) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <michael_heerdegen@HIDDEN>) id 1k80Q7-0006Sn-GT for 23430 <at> debbugs.gnu.org; Tue, 18 Aug 2020 08:08:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1597752520; bh=+yZsZuS5SfIrRwoGSwNfqX0I6oZJbDIPPjvv/QBly90=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=hcezBLfsBZynTKX9PU4dBr63gKwc4uNdrOkZgO1zGI6PwQMmWXVMMwQO2S311ojZS KiTKABQ5E2GClAzk+adDYJqz3L3+NSp2PkQdf0X1vwZdTBrzcV+cgUdQomC2aJ/AyS MGhKalgGaV4CRDjBa/ErXWwK4VBszOf3rpeqh8xU= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([217.247.71.68]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MXoYQ-1kBICS0CgW-00YMF6; Tue, 18 Aug 2020 14:08:40 +0200 From: Michael Heerdegen <michael_heerdegen@HIDDEN> References: <86k2jc2ahf.fsf@HIDDEN> <bba9665d-c646-5ec0-3c8b-233b4007c5ec@HIDDEN> <CADwFkmmgWb5JyWx9RLDnHZiDG99zyxvPg_+wzpq0d1VLR77q_A@HIDDEN> <d7ae1f11-7c1e-24f8-79d4-dab73a17a64f@HIDDEN> Date: Tue, 18 Aug 2020 14:08:38 +0200 In-Reply-To: <d7ae1f11-7c1e-24f8-79d4-dab73a17a64f@HIDDEN> (Dmitry Gutov's message of "Wed, 12 Aug 2020 13:06:33 +0300") Message-ID: <87zh6sdum1.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:d+0itOXuPcSpbFW0yJvYS7SuyL7pzS+U+i8EotEmJlDdjI27Xr7 5mR8KE3yxdGP3PSO3ik0MZ0V4+riaG+EIakar4+BMxfQzChFoPsB7CZYvNk4Lk0MD+JumhQ uO+6uDKNeIBhcAHTCaXGM6bPO64CbRtrt9h8LPHhspzVdnhuHbOPIKvVwdeZfzkUrH7H7U3 MxnGZJ8MciYDq9sv1erkA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:7TQsrQOo2Ak=:uWjzO1dEo2N5UNIHVV8z+a JBLxhsF7m18wS644wiv8S4TYgfXSYq6P0nuJ3V1gDPhB0SA95ld+644D7vP+SaPqAKvVD+B4o wF9y56pDrHvLJyMQFulljALcThWQYZiA6frNSOsqSbjvXVIjnrapkFvtgWWvVimB3iA+fmelG 9LRI1S4WSskxcIJCtwZ1Mv2uVfg2EVMM5IdKPTe7vcL8mDpXNKbkcKygeulesmpM709xAWCNw wRzrqS8aBSLQJbYcelV1oGoVgX1lNuTNIWLwMEYsPb2gRu8iK466AOZk6+K0iOp8iYyrQqXi9 vmcRCSeLyip/DNH1yFGUdaIGx2DrvrVN06p4zABGXLDkpkVbwC6qfCn7fW238CWd//Wgtne12 5IPMxBAoADC07XOtntb3UnD9kWMqlsrgKvN1N6IHKLpxJFEClWSy0Qu+Na4aYcULucMXyCO+S 1DaUpxhfNuwiJRkNH/NN41Ysn21hxdjjIg5lAWotVakbf2zKU/EvVXjPfEjKm6TkoEVrfQyIn nmj0y9VyyWljF4ez9sNI5u8ZAOfd3ifL5UuJRHJqEnBtTUpGvYVDOFaD2ruBELFbYwKecfGqL dxfyhxFGoKFrZBip6tPeTNhsmak9n24uDvLiSJrO3LIM5HeHFjE3xGcpyGPBrgAkb4ySSPuWV TFtPeTufxnVNTXGVG37j0sv1lnewfYnuqGDF7EIaDoLkU8Gb+xqVmFPKTgXg3obAUQG2X4kv/ Bpvpl+jWWzpOMyFOXZInVaaSaahznLyVaQlGrpEeB9SXIytYKvst9KJtIAoVfn66x0dmH7brn qddci96njv/sdHmhJiXO3egJU05pAlud7p5ZIuEQrqbSB74m+/NFTaG9DM0puIAvZ4bvPyI4x oyLi14PFuWWQhUKtu8iBJRMXchV5T2lfMnjaErjWpEDhiwWGzudhZkbBBf1GIkCZRXsKORCz+ +jWIUjJ0PCuIm75xq71h4wtxZ0NslpTCu7uD1geMnS5r8UYZlpTJUy1+AGKgjnfECUhU88td2 6HnhEQbb7YWIHAtTb5L4pND479YGw6XkbR66IpE6p+13R3F3G+PpA/xG9Qmhxwc2sXHxp4nLX B7BgKch8dsnj5kWz8sv981/RVYSreOTF51lg3KEhEfLD0LxaCUNtzDvqsVG9eEZfR0hESu2vs Lof1R7C8p9oCZH4JMEYdWrhp/u9xCeCBmTWz8wUflUJP7kIIXKYf4fJlPdSagCDbDWaHxeMaQ HI6B5qPRz6MATKlRaYOq5WUryowKaHD/1P4Nb6w== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) Dmitry Gutov <dgutov@HIDDEN> writes: > But problem is still there, and still seems valid. > > Before we close this, I'd like to hear from somebody who understands > what generator.el is actually for. I've just CC'd Daniel assuming he may has missed this bug report. Michael.
X-Loop: help-debbugs@HIDDEN Subject: bug#23430: 25.0.93; iter-defun does not support special form save-current-buffer Resent-From: Dmitry Gutov <dgutov@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 22 Aug 2020 00:19:02 +0000 Resent-Message-ID: <handler.23430.B23430.159805549811312 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 23430 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo To: Michael Heerdegen <michael_heerdegen@HIDDEN> Cc: 23430 <at> debbugs.gnu.org, Stefan Kangas <stefan@HIDDEN> Received: via spool by 23430-submit <at> debbugs.gnu.org id=B23430.159805549811312 (code B ref 23430); Sat, 22 Aug 2020 00:19:02 +0000 Received: (at 23430) by debbugs.gnu.org; 22 Aug 2020 00:18:18 +0000 Received: from localhost ([127.0.0.1]:48525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1k9HEg-0002wO-J4 for submit <at> debbugs.gnu.org; Fri, 21 Aug 2020 20:18:18 -0400 Received: from mail-lf1-f53.google.com ([209.85.167.53]:45339) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <raaahh@HIDDEN>) id 1k9HEe-0002wA-EK for 23430 <at> debbugs.gnu.org; Fri, 21 Aug 2020 20:18:17 -0400 Received: by mail-lf1-f53.google.com with SMTP id b30so1727532lfj.12 for <23430 <at> debbugs.gnu.org>; Fri, 21 Aug 2020 17:18:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=rL98Eb/QSsDe+qxYbd/KW/o1cfeLryHxgYA4Lucpebs=; b=SU+/kVQxlVWK6TrjGl2VtLaVrP6tes5uX0ewGuShkzSXP7CQDElyTydqxXK6B6Fvyj z+q39Otjs85h+7d986KDtNHL4MPSH/1jjGkAiv9UDKkdhTTLlSSzaY8tjUH0F44qyh8h s7Jl59w1bssOHTPb8AvE/2RR5ri930MEyGZZvXHxP0ywtgDDo14pGstER4lmq8H3nhQa wZBMgkMg62nZ8dc/li2Dcz29vMP5g2dBq21bDlIZD6u5m3FyLpD2a0FwLcgOPsuSr4qw 1cCpfx7OP2sbjrTYbkxVydnpc+RxhkX5muJbC+6dezQNG9rNSHyxfHOlA9soG8ivY14E bIKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=rL98Eb/QSsDe+qxYbd/KW/o1cfeLryHxgYA4Lucpebs=; b=MhO5l33ZarIjPIuRhzlJUPaaFv14Us9l5GeCKL3FMUF79IhOfSsQ+yu5BtGi5GnLiL GgmJTd0CkEeZa1NK9xy8Y8k7PKIqN9Rs5YQHTkAi0YY7d2lsEipDSIHcapDI17aiRP5/ 8YcM7n1fvU9F8p2358fZOfIYnFxMxF4vmGZptFwrWLvccSVNuK/VdZhfOc1BwA/fyD20 pIqqCbuN3jil0qYcBEaYb+MfcPG00P3TpygylWg/uZrncZOww3h+ackCudrxMQG5D6cG q8F/4fErf5ps5ESd8gxzHCp8zqMP5RyJlGp4lTFxiSg84e+GZn7M6lQoXzdYbeUwU7pZ t+nw== X-Gm-Message-State: AOAM531B0lB6nPaPfNiHYaWgLRlmICoUvBLSFi+ifNRIlP2UGbYAdMWL S7SLtZOR9vk5QkEfPeQk2m4= X-Google-Smtp-Source: ABdhPJwBDSJIYhzf027LWJCklCTu1zVA4ni/OwC054NT4BKMY3gYCMdiFWHTbNKROcBn+nKeLgoBaw== X-Received: by 2002:a19:f808:: with SMTP id a8mr2474871lff.62.1598055490403; Fri, 21 Aug 2020 17:18:10 -0700 (PDT) Received: from [192.168.0.104] ([94.229.108.16]) by smtp.googlemail.com with ESMTPSA id u10sm678091lju.113.2020.08.21.17.18.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Aug 2020 17:18:09 -0700 (PDT) References: <86k2jc2ahf.fsf@HIDDEN> <bba9665d-c646-5ec0-3c8b-233b4007c5ec@HIDDEN> <CADwFkmmgWb5JyWx9RLDnHZiDG99zyxvPg_+wzpq0d1VLR77q_A@HIDDEN> <d7ae1f11-7c1e-24f8-79d4-dab73a17a64f@HIDDEN> <87tux2btql.fsf@HIDDEN> From: Dmitry Gutov <dgutov@HIDDEN> Message-ID: <87fd8e2a-6566-b451-48af-e1966ce1f8eb@HIDDEN> Date: Sat, 22 Aug 2020 03:18:08 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <87tux2btql.fsf@HIDDEN> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.6 (--) On 16.08.2020 16:33, Michael Heerdegen wrote: > Dmitry Gutov <dgutov@HIDDEN> writes: > >> Before we close this, I'd like to hear from somebody who understands >> what generator.el is actually for. > > I think it's just a straightforward implementation of generators as > described here: > > https://en.wikipedia.org/wiki/Generator_%28computer_programming%29 > > I learned about them in university, and have used them once in a while. Right. I was really wondering, though, whether we can/should use them more often. > AFAIK handling asynchronous process output is not a good task for them. Perhaps if we also used a separate thread for waiting for the output to come... > I think: The problem of the concept of generators in an editor is that > generators are good for saving the state of a computation, but Emacs as > an editor has a lot of "environment" state (current buffer, value of > point, ...), and when the computation represented by the generator > messes with this state (or has side effects), the concept doesn't fit > that well. > > When working with streams, I make the handling of the according part of > the environment explicit saving it in variables (iterators are closures) > and "yield" outside of any xxx-recursion, in your introductory example, > that would look like this: > > #+begin_src emacs-lisp > (require 'generator) > > (iter-defun my-search (str buf) > (with-current-buffer buf > (goto-char (point-min))) > (let ((pos (point)) > (yield nil) > (done nil)) > (while (not done) > (when yield > (iter-yield yield) > (setq yield nil)) > (with-current-buffer buf > (goto-char pos) > (if (search-forward str) > (setq yield (match-beginning 0) > pos (point)) > (setq done 0)))))) > #+end_src Thanks. I think this is fairly close to the approach I showed in the patch. Problem is, it's no shorter than an implementation one can write using plain functions. Longer, usually. > I guess it would be nice if that could work implicitly in some way, but > that would probably require the introduction of new special forms > adapted to the situation, like `iterator-save-buffer-and-point' or so. Perhaps.
Received: (at control) by debbugs.gnu.org; 24 Nov 2020 08:44:45 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 24 03:44:45 2020 Received: from localhost ([127.0.0.1]:57519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1khTwL-0002iW-1A for submit <at> debbugs.gnu.org; Tue, 24 Nov 2020 03:44:45 -0500 Received: from quimby.gnus.org ([95.216.78.240]:51234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <larsi@HIDDEN>) id 1khTwJ-0002iG-J1 for control <at> debbugs.gnu.org; Tue, 24 Nov 2020 03:44:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=LN8BK7qqlDW6W0TukdqOCC4WGHigalOJN70yPNSyKPs=; b=CQTPsjeFJ4nVSr5cwiqi22X5tC mllflpebJv0wI5MuireClhm+yFIlSAjeYEeeRNsD9g1Pz6cHWBJSMFgweV/iONJcACsnvMgBqF8vf A6UBIJhzY1bWGt9dSdkTLNgYo4NITiOVdAgGpTGr6lZaKl/G4Zp/W5ovFAeK/gsoYj9U=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <larsi@HIDDEN>) id 1khTwB-0001OY-Sf for control <at> debbugs.gnu.org; Tue, 24 Nov 2020 09:44:37 +0100 Date: Tue, 24 Nov 2020 09:44:34 +0100 Message-Id: <87lfer5ekt.fsf@HIDDEN> To: control <at> debbugs.gnu.org From: Lars Ingebrigtsen <larsi@HIDDEN> Subject: control message for bug #23430 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 23430 - moreinfo quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) tags 23430 - moreinfo quit
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.