From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Janne Nykopp Newsgroups: gmane.emacs.bugs Subject: bug#11811: 23.2; Macro pushnew in cl.el captures variable x Date: Thu, 28 Jun 2012 23:45:24 +0300 Message-ID: <20120628204524.GC925@kekkonen.niksula.hut.fi> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1340918394 5109 80.91.229.3 (28 Jun 2012 21:19:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 28 Jun 2012 21:19:54 +0000 (UTC) To: 11811@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 28 23:19:54 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SkM81-0002rd-Nx for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Jun 2012 23:19:53 +0200 Original-Received: from localhost ([::1]:60179 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkM81-0001c3-LO for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Jun 2012 17:19:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkM7y-0001bv-I1 for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2012 17:19:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SkM7w-0007Gy-IC for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2012 17:19:50 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkM7w-0007Gn-Ec for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2012 17:19:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SkMC1-0006ED-Vc for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2012 17:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Janne Nykopp Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Jun 2012 21:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11811 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.134091858823873 (code B ref -1); Thu, 28 Jun 2012 21:24:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Jun 2012 21:23:08 +0000 Original-Received: from localhost ([127.0.0.1]:35856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SkMB9-0006Cz-U9 for submit@debbugs.gnu.org; Thu, 28 Jun 2012 17:23:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48873) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SkLf2-0005SY-0b for submit@debbugs.gnu.org; Thu, 28 Jun 2012 16:49:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SkLau-0004yy-6N for submit@debbugs.gnu.org; Thu, 28 Jun 2012 16:45:41 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:40198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkLau-0004yr-2x for submit@debbugs.gnu.org; Thu, 28 Jun 2012 16:45:40 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkLas-0007yD-6L for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2012 16:45:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SkLap-0004wH-Lq for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2012 16:45:37 -0400 Original-Received: from dusk.niksula.hut.fi ([130.233.40.6]:40869 helo=mail.niksula.hut.fi) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkLap-0004tr-Br for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2012 16:45:35 -0400 Original-Received: by mail.niksula.hut.fi (Postfix, from userid 60001) id 7A47F8BB3E; Thu, 28 Jun 2012 23:45:32 +0300 (EEST) Original-Received: from kekkonen.cs.hut.fi (kekkonen.cs.hut.fi [130.233.41.50]) by mail.niksula.hut.fi (Postfix) with ESMTP id 3DBEB8BB3C for ; Thu, 28 Jun 2012 23:45:25 +0300 (EEST) Original-Received: (from jnykopp@localhost) by kekkonen.cs.hut.fi (8.14.3+Sun/8.14.3/Submit) id q5SKjO4W005662 for bug-gnu-emacs@gnu.org; Thu, 28 Jun 2012 23:45:24 +0300 (EEST) Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Thu, 28 Jun 2012 17:23:06 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61387 Archived-At: Evaluating the following forms triggers a lisp error: (require 'cl) (let ((x (list 1 2 3))) (pushnew 'a x)) Evaluating in *scratch* buffer results in the following debugger backtrace: Debugger entered--Lisp error: (wrong-type-argument listp a) memql(a a) (if (memql x x) x (setq x (cons x x))) (let ((x ...)) (if (memql x x) x (setq x ...))) (pushnew (quote a) x) (let ((x ...)) (pushnew (quote a) x)) eval((let ((x ...)) (pushnew (quote a) x))) eval-last-sexp-1(t) eval-last-sexp(t) eval-print-last-sexp() call-interactively(eval-print-last-sexp nil nil) The macro `pushnew' seems to capture variable x when no keyword arguments are given: (macroexpand '(pushnew 'a x)) => (let ((x (quote a))) (if (memql x x) x (setq x (cons x x)))) This bug still exists in emacs-24 developer branch cl.el revision 108062 (latest version at the time of writing). Information collected by M-x report-emacs-bug follows. In GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-12-11 on raven, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.10707000 configured using `configure '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.2/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.utf8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: ( r e q u i r e SPC ' c l ) C-j ( l e t SPC ( ( x SPC ( l i s t SPC 1 SPC 3 SPC 4 2 SPC 4 ) 3 ) ) ) ( p u s h n e w SPC ' a SPC x ) ) C-j q M-x r e p o r t - Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Entering debugger... Back to top level. Load-path shadows: /usr/share/emacs/23.2/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup /usr/share/emacs/23.2/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/23.2/lisp/textmodes/ispell /usr/share/emacs/23.2/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/23.2/lisp/textmodes/flyspell Features: (shadow sort mail-extr message sendmail regexp-opt ecomplete rfc822 mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock sha1 hex-util hashcash mail-utils emacsbug help-mode easymenu view debug cl cl-19 tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind system-font-setting font-render-setting gtk x-toolkit x multi-tty emacs)