GNU bug report logs - #16671
24.3; cl-lib from ELPA defadvices cl-position into infinite loop

Previous Next

Package: emacs;

Reported by: Noam Postavsky <npostavs <at> users.sourceforge.net>

Date: Thu, 6 Feb 2014 17:46:01 UTC

Severity: normal

Merged with 16857

Found in versions 24.3, 24.3.50

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16671 in the body.
You can then email your comments to 16671 AT debbugs.gnu.org in the normal way.

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#16671; Package emacs. (Thu, 06 Feb 2014 17:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Noam Postavsky <npostavs <at> users.sourceforge.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 06 Feb 2014 17:46:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; cl-lib from ELPA defadvices cl-position into infinite loop
Date: Thu, 6 Feb 2014 12:44:18 -0500
emacs -Q --eval "(progn (package-initialize t) (package-install
'cl-lib) (require 'cl) (position 1 '(1)))"

*Messages* buffer contains

  apply: Variable binding depth exceeds max-specpdl-size


In GNU Emacs 24.3.1 (i386-mingw-nt6.0.6002)
 of 2013-03-17 on MARVIN

See also: https://github.com/capitaomorte/yasnippet/issues/457 (user
upgrades to 24.3 and doesn't think to uninstall cl-lib, so they hit
this bug).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16671; Package emacs. (Wed, 19 Feb 2014 19:39:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 16671 <at> debbugs.gnu.org
Subject: Re: bug#16671: 24.3;
 cl-lib from ELPA defadvices cl-position into infinite loop
Date: Wed, 19 Feb 2014 14:37:53 -0500
> emacs -Q --eval "(progn (package-initialize t) (package-install
> 'cl-lib) (require 'cl) (position 1 '(1)))"
> *Messages* buffer contains
>   apply: Variable binding depth exceeds max-specpdl-size

Indeed.  Could you try the patch below and confirm if it fixes the
problem for you?


        Stefan


diff --git a/packages/cl-lib/cl-lib.el b/packages/cl-lib/cl-lib.el
index 1ea22e0..cf13c56 100644
--- a/packages/cl-lib/cl-lib.el
+++ b/packages/cl-lib/cl-lib.el
@@ -318,25 +327,27 @@
           (message "%S already defined, not rebinding" new))
       (defalias new fun))))
 
-(autoload 'cl-position "cl-seq")
-(defadvice cl-position (around cl-lib (cl-item cl-seq &rest cl-keys) activate)
+(unless (symbolp (symbol-function 'position))
+  (autoload 'cl-position "cl-seq")
+  (defadvice cl-position (around cl-lib (cl-item cl-seq &rest cl-keys) activate)
   (let ((argk (ad-get-args 2)))
     (if (or (null argk) (keywordp (car argk)))
         ;; This is a call to cl-lib's `cl-position'.
         (setq ad-return-value
               (apply #'position (ad-get-arg 0) (ad-get-arg 1) argk))
       ;; Must be a call to cl's old `cl-position'.
-      ad-do-it)))
+      ad-do-it))))
 
-(autoload 'cl-delete-duplicates "cl-seq")
-(defadvice cl-delete-duplicates (around cl-lib (cl-seq &rest cl-keys) activate)
+(unless (symbolp (symbol-function 'delete-duplicates))
+  (autoload 'cl-delete-duplicates "cl-seq")
+  (defadvice cl-delete-duplicates (around cl-lib (cl-seq &rest cl-keys) activate)
   (let ((argk (ad-get-args 1)))
     (if (or (null argk) (keywordp (car argk)))
         ;; This is a call to cl-lib's `cl-delete-duplicates'.
         (setq ad-return-value
               (apply #'delete-duplicates (ad-get-arg 0) argk))
       ;; Must be a call to cl's old `cl-delete-duplicates'.
-      ad-do-it)))
+      ad-do-it))))
 
 (when (or (not (fboundp 'cl-member))
           (eq (symbol-function 'cl-member) #'memq))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16671; Package emacs. (Sat, 22 Feb 2014 19:53:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 16671 <at> debbugs.gnu.org
Subject: Re: bug#16671: 24.3; cl-lib from ELPA defadvices cl-position into
 infinite loop
Date: Sat, 22 Feb 2014 14:52:00 -0500
On Wed, Feb 19, 2014 at 2:37 PM, Stefan Monnier
<monnier <at> iro.umontreal.ca> wrote:
> Indeed.  Could you try the patch below and confirm if it fixes the
> problem for you?

Yes, looks good. All of position, cl-position, delete-duplicates, and
cl-delete-duplicates succeed with the patch.




Merged 16671 16857. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 24 Feb 2014 23:36:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16671; Package emacs. (Tue, 25 Feb 2014 21:45:03 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 16671 <at> debbugs.gnu.org
Subject: Re: bug#16671: 24.3;
 cl-lib from ELPA defadvices cl-position into infinite loop
Date: Tue, 25 Feb 2014 16:43:58 -0500
> Yes, looks good. All of position, cl-position, delete-duplicates, and
> cl-delete-duplicates succeed with the patch.

Thanks.  Should appear tomorrow as cl-lib-0.5.


        Stefan




bug closed, send any further explanations to 16671 <at> debbugs.gnu.org and Noam Postavsky <npostavs <at> users.sourceforge.net> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 26 Feb 2014 16:53:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 27 Mar 2014 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 40 days ago.

Previous Next


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