unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16671: 24.3; cl-lib from ELPA defadvices cl-position into infinite loop
@ 2014-02-06 17:44 Noam Postavsky
  2014-02-19 19:37 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Noam Postavsky @ 2014-02-06 17:44 UTC (permalink / raw)
  To: 16671

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).





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#16671: 24.3; cl-lib from ELPA defadvices cl-position into infinite loop
  2014-02-06 17:44 bug#16671: 24.3; cl-lib from ELPA defadvices cl-position into infinite loop Noam Postavsky
@ 2014-02-19 19:37 ` Stefan Monnier
  2014-02-22 19:52   ` Noam Postavsky
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2014-02-19 19:37 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 16671

> 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))





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#16671: 24.3; cl-lib from ELPA defadvices cl-position into infinite loop
  2014-02-19 19:37 ` Stefan Monnier
@ 2014-02-22 19:52   ` Noam Postavsky
  2014-02-25 21:43     ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Noam Postavsky @ 2014-02-22 19:52 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 16671

On Wed, Feb 19, 2014 at 2:37 PM, Stefan Monnier
<monnier@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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#16671: 24.3; cl-lib from ELPA defadvices cl-position into infinite loop
  2014-02-22 19:52   ` Noam Postavsky
@ 2014-02-25 21:43     ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2014-02-25 21:43 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 16671

> 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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-25 21:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-06 17:44 bug#16671: 24.3; cl-lib from ELPA defadvices cl-position into infinite loop Noam Postavsky
2014-02-19 19:37 ` Stefan Monnier
2014-02-22 19:52   ` Noam Postavsky
2014-02-25 21:43     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).