GNU logs - #7604, boring messages


Message sent to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#7604: `loop', PATCH: loop, cl-parse-loop-clause, cl-map-intervals -- being the intervals of
Resent-From: MON KEY <monkey@HIDDEN>
Original-Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Resent-To: owner <at> debbugs.gnu.org
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 10 Dec 2010 01:25:02 +0000
Resent-Message-ID: <handler.7604.B.129194425220721 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 7604
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 7604 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.129194425220721
          (code B ref -1); Fri, 10 Dec 2010 01:25:02 +0000
Received: (at submit) by debbugs.gnu.org; 10 Dec 2010 01:24:12 +0000
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1PQriV-0005O9-PU
	for submit <at> debbugs.gnu.org; Thu, 09 Dec 2010 20:24:12 -0500
Received: from eggs.gnu.org ([140.186.70.92])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <stan@HIDDEN>) id 1PQriT-0005Nw-Ox
	for submit <at> debbugs.gnu.org; Thu, 09 Dec 2010 20:24:10 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <stan@HIDDEN>) id 1PQroH-0006S8-Ah
	for submit <at> debbugs.gnu.org; Thu, 09 Dec 2010 20:30:11 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW
	autolearn=unavailable version=3.3.1
Received: from lists.gnu.org ([199.232.76.165]:56392)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <stan@HIDDEN>) id 1PQroH-0006S4-7x
	for submit <at> debbugs.gnu.org; Thu, 09 Dec 2010 20:30:09 -0500
Received: from [140.186.70.92] (port=45018 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1PQroF-000803-85
	for bug-gnu-emacs@HIDDEN; Thu, 09 Dec 2010 20:30:09 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <stan@HIDDEN>) id 1PQroD-0006RD-S9
	for bug-gnu-emacs@HIDDEN; Thu, 09 Dec 2010 20:30:06 -0500
Received: from mail-ww0-f49.google.com ([74.125.82.49]:57313)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <stan@HIDDEN>) id 1PQroD-0006Qy-MJ
	for bug-gnu-emacs@HIDDEN; Thu, 09 Dec 2010 20:30:05 -0500
Received: by wwb17 with SMTP id 17so3109880wwb.30
	for <bug-gnu-emacs@HIDDEN>; Thu, 09 Dec 2010 17:30:03 -0800 (PST)
MIME-Version: 1.0
Received: by 10.216.159.207 with SMTP id s57mr201626wek.43.1291944603722; Thu,
	09 Dec 2010 17:30:03 -0800 (PST)
Received: by 10.216.70.212 with HTTP; Thu, 9 Dec 2010 17:30:03 -0800 (PST)
Date: Thu, 9 Dec 2010 20:30:03 -0500
X-Google-Sender-Auth: X99cVPn9WBk--0Rgk7d4Bn6Fqdg
Message-ID: <AANLkTimXrkuKmQeUdSbyaAEJsxq9KTX5VSW1jSpDUumr@HIDDEN>
From: MON KEY <monkey@HIDDEN>
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Spam-Score: -5.2 (-----)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/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: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -5.2 (-----)

Current through BZR-102620 there is a bug around `loop',
`cl-parse-loop-clause', and `cl-map-intervals' which put them in
conflict with the manual (which is unclear w/re intended usage):

 ,----
 | `for VAR being the intervals [of BUFFER] ...'
 |  This clause iterates over all intervals of a buffer with constant
 |  text properties.  The variable VAR will be bound to conses of
 |  start and end positions, where one start position is always equal
 |  to the previous end position.  The clause allows `of', `from',
 |  `to', and `property' terms, where the latter term restricts the
 |  search to just the specified property.  The `of' term may specify
 |  either a buffer or a string.
 `----

(loop for <VAR> being the intervals of property <PROP> from <INT> to <INT>
      collecting <VAR>)

The above works (by accident).

What should work (but doesn't) is:

(loop for <VAR> being the intervals in <BUFFER> of property <PROP>
from <INT> to <INT>
      collecting <VAR>)

The `intervals' feature is an extension to the Common Lisp `loop'
macro but is not in keeping with the syntax.

My understanding of the above is following should work (it doesn't):

(loop for <VAR> being the intervals of <BUFFER> of property <PROP>
from <INT> to <INT>
      collecting tp)

Additionally, the source provides that `in' may be used in the same
manner as `of':

(loop for <VAR> being the intervals in <BUFFER> property <PROP> from
<INT> to <INT>
      collecting tp)

So, I would also expect either of these to work as well (they don't):

(loop for <VAR> being the intervals in <BUFFER> of property <PROP>
from <INT> to <INT>
      collecting tp)

(loop for <VAR> being the intervals of <BUFFER> in property <PROP>
from <INT> to <INT>
      collecting tp)

There should be an additional infix filler word preceding `property'
as their is with the hash-table loop clauses, and he right fix IMO
would be to add a `using' syntax instead of and/or in addition to
testing for `property' which is pretty clearly (of itself) NTRT.
Such an addtion would allow for:

(loop for <VAR> being the intervals in <BUFFER> using property <PROP>
from <INT> to <INT>
      collecting tp)

Regardless, the ttached patch is current w/ BZR-102620. It fixes the
problem and remains backwards compatable with the existing behaviour
in Emacs 23.

rgrep says nothing in core uses this loop idiom so it should be a
fairly clean fix.

--- /ediff25130lIS	2010-12-09 20:06:14.727993830 -0500
+++ /lisp/emacs-lisp/cl-macs.el	2010-12-09 19:54:51.992860000 -0500
@@ -916,17 +916,23 @@
 			  (lambda (,var ,(make-symbol "--cl-var--"))
 			    (progn . --cl-map) nil)
 			  ,buf ,from ,to))))
-
+
 	       ((memq word '(interval intervals))
 		(let ((buf nil) (prop nil) (from nil) (to nil)
 		      (var1 (make-symbol "--cl-var1--"))
 		      (var2 (make-symbol "--cl-var2--")))
-		  (while (memq (car loop-args) '(in of property from to))
-		    (cond ((eq (car loop-args) 'from) (setq from (cl-pop2 loop-args)))
-			  ((eq (car loop-args) 'to) (setq to (cl-pop2 loop-args)))
-			  ((eq (car loop-args) 'property)
-			   (setq prop (cl-pop2 loop-args)))
-			  (t (setq buf (cl-pop2 loop-args)))))
+                  (while (memq (car loop-args) '(in of property from to))
+                    (cond ((eq (car loop-args) 'from) (setq from
(cl-pop2 loop-args)))
+                          ((eq (car loop-args) 'to) (setq to (cl-pop2
loop-args)))
+                          ((eq (car loop-args) 'property) (setq prop
(cl-pop2 loop-args)))
+                          ((memq (car loop-args) '(in of))
+                           (or (and (eq (cadr loop-args) 'property)
+                                    (pop loop-args)
+                                    (setq prop (cl-pop2 loop-args)))
+                               (setq buf (cl-pop2 loop-args))))
+                          (t (or (and (or (stringp (car loop-args))
(bufferp (car loop-args)))
+                                      (setq buf (car loop-args)))
+                                 (error "Expected buffer or string")))))
 		  (if (and (consp var) (symbolp (car var)) (symbolp (cdr var)))
 		      (setq var1 (car var) var2 (cdr var))
 		    (push (list var (list 'cons var1 var2)) loop-for-sets))

--
/s_P\




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: MON KEY <monkey@HIDDEN>
Subject: bug#7604: Acknowledgement (`loop', PATCH: loop, cl-parse-loop-clause,
 cl-map-intervals -- being the intervals of)
Message-ID: <handler.7604.B.129194425220721.ack <at> debbugs.gnu.org>
References: <AANLkTimXrkuKmQeUdSbyaAEJsxq9KTX5VSW1jSpDUumr@HIDDEN>
X-Gnu-PR-Message: ack 7604
X-Gnu-PR-Package: emacs
Reply-To: 7604 <at> debbugs.gnu.org
Date: Fri, 10 Dec 2010 01:25:02 +0000

Thank you for filing a new bug report with GNU.

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 7604 <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
7604: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D7604
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message received at control <at> debbugs.gnu.org:


Received: (at control) by debbugs.gnu.org; 10 Apr 2012 10:06:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 10 06:06:55 2012
Received: from localhost ([127.0.0.1]:48052 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1SHXyQ-0000Sg-FD
	for submit <at> debbugs.gnu.org; Tue, 10 Apr 2012 06:06:54 -0400
Received: from hermes.netfonds.no ([80.91.224.195]:50654)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <larsi@HIDDEN>) id 1SHXyN-0000ST-4b
	for control <at> debbugs.gnu.org; Tue, 10 Apr 2012 06:06:53 -0400
Received: from cm-84.215.51.58.getinternet.no ([84.215.51.58]
	helo=stories.gnus.org)
	by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.72) (envelope-from <larsi@HIDDEN>) id 1SHXxE-00050T-Oq
	for control <at> debbugs.gnu.org; Tue, 10 Apr 2012 12:05:40 +0200
Date: Tue, 10 Apr 2012 12:05:40 +0200
Message-Id: <m3d37fj40b.fsf@HIDDEN>
To: control <at> debbugs.gnu.org
From: Lars Magne Ingebrigtsen <larsi@HIDDEN>
Subject: control message for bug #7604
X-MailScanner-ID: 1SHXxE-00050T-Oq
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi@HIDDEN
MailScanner-NULL-Check: 1334657140.93504@uGXKMx/E8GtriHvLz/i8Hg
X-Spam-Status: No
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: control
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://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: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

tags 7604 patch




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#7604: `loop', PATCH: loop, cl-parse-loop-clause, cl-map-intervals -- being the intervals of
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 26 Feb 2016 06:29:01 +0000
Resent-Message-ID: <handler.7604.B7604.145646809832484 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 7604
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: MON KEY <monkey@HIDDEN>
Cc: 7604 <at> debbugs.gnu.org
Received: via spool by 7604-submit <at> debbugs.gnu.org id=B7604.145646809832484
          (code B ref 7604); Fri, 26 Feb 2016 06:29:01 +0000
Received: (at 7604) by debbugs.gnu.org; 26 Feb 2016 06:28:18 +0000
Received: from localhost ([127.0.0.1]:46653 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aZBsv-0008Rr-QJ
	for submit <at> debbugs.gnu.org; Fri, 26 Feb 2016 01:28:17 -0500
Received: from hermes.netfonds.no ([80.91.224.195]:37115)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <larsi@HIDDEN>) id 1aZBst-0008Rj-V2
 for 7604 <at> debbugs.gnu.org; Fri, 26 Feb 2016 01:28:16 -0500
Received: from [175.103.25.178] (helo=mouse)
 by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.72) (envelope-from <larsi@HIDDEN>)
 id 1aZBsW-0005KB-Ld; Fri, 26 Feb 2016 07:27:53 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <AANLkTimXrkuKmQeUdSbyaAEJsxq9KTX5VSW1jSpDUumr@HIDDEN>
Date: Fri, 26 Feb 2016 16:57:48 +1030
In-Reply-To: <AANLkTimXrkuKmQeUdSbyaAEJsxq9KTX5VSW1jSpDUumr@HIDDEN>
 (MON KEY's message of "Thu, 9 Dec 2010 20:30:03 -0500")
Message-ID: <8760xcugt7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-MailScanner-ID: 1aZBsW-0005KB-Ld
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi@HIDDEN
MailScanner-NULL-Check: 1457072874.15872@oLIkFntVaPVmtdpQPXUU4A
X-Spam-Status: No
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: 0.0 (/)

MON KEY <monkey@HIDDEN> writes:

> Current through BZR-102620 there is a bug around `loop',
> `cl-parse-loop-clause', and `cl-map-intervals' which put them in
> conflict with the manual (which is unclear w/re intended usage):
>
>  ,----
>  | `for VAR being the intervals [of BUFFER] ...'
>  |  This clause iterates over all intervals of a buffer with constant
>  |  text properties.  The variable VAR will be bound to conses of
>  |  start and end positions, where one start position is always equal
>  |  to the previous end position.  The clause allows `of', `from',
>  |  `to', and `property' terms, where the latter term restricts the
>  |  search to just the specified property.  The `of' term may specify
>  |  either a buffer or a string.
>  `----

[...]

> There should be an additional infix filler word preceding `property'
> as their is with the hash-table loop clauses, and he right fix IMO
> would be to add a `using' syntax instead of and/or in addition to
> testing for `property' which is pretty clearly (of itself) NTRT.
> Such an addtion would allow for:
>
> (loop for <VAR> being the intervals in <BUFFER> using property <PROP>
> from <INT> to <INT>
>       collecting tp)
>
> Regardless, the ttached patch is current w/ BZR-102620. It fixes the
> problem and remains backwards compatable with the existing behaviour
> in Emacs 23.
>
> rgrep says nothing in core uses this loop idiom so it should be a
> fairly clean fix.

Since nothing uses it, and it's a non-standard Emacs extension to loop,
perhaps we should just remove the intervals stuff from cl-loop?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





Last modified: Fri, 26 Feb 2016 06:30:02 UTC

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