* bug#11811: 23.2; Macro pushnew in cl.el captures variable x
@ 2012-06-28 20:45 Janne Nykopp
2012-06-28 21:39 ` Drew Adams
2012-06-28 23:06 ` Juanma Barranquero
0 siblings, 2 replies; 3+ messages in thread
From: Janne Nykopp @ 2012-06-28 20:45 UTC (permalink / raw)
To: 11811
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:
<help-echo> <help-echo> ( r e q u i r e SPC ' c l )
<return> <backspace> C-j ( l e t SPC ( ( x SPC ( l
i s t SPC 1 SPC 3 SPC 4 <backspace> <backspace> <backspace>
2 SPC 4 ) <backspace> <backspace> 3 ) ) ) <return>
<tab> ( p u s h n e w SPC ' a SPC x ) ) C-j q M-x r
e p o r t - <tab> <return>
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)
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#11811: 23.2; Macro pushnew in cl.el captures variable x
2012-06-28 20:45 bug#11811: 23.2; Macro pushnew in cl.el captures variable x Janne Nykopp
@ 2012-06-28 21:39 ` Drew Adams
2012-06-28 23:06 ` Juanma Barranquero
1 sibling, 0 replies; 3+ messages in thread
From: Drew Adams @ 2012-06-28 21:39 UTC (permalink / raw)
To: 'Janne Nykopp', 11811
Seems to be a regression introduced in Emacs 22.
Works OK (wrt this bug) in Emacs 21 and 20, but not in 22+.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#11811: 23.2; Macro pushnew in cl.el captures variable x
2012-06-28 20:45 bug#11811: 23.2; Macro pushnew in cl.el captures variable x Janne Nykopp
2012-06-28 21:39 ` Drew Adams
@ 2012-06-28 23:06 ` Juanma Barranquero
1 sibling, 0 replies; 3+ messages in thread
From: Juanma Barranquero @ 2012-06-28 23:06 UTC (permalink / raw)
To: Janne Nykopp; +Cc: 11811-done
On Thu, Jun 28, 2012 at 10:45 PM, Janne Nykopp <janne.nykopp@iki.fi> wrote:
> 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))))
Yes.
> This bug still exists in emacs-24 developer branch cl.el revision
> 108062 (latest version at the time of writing).
Should be fixed in the trunk, in revno:108794.
Juanma
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-06-28 23:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-28 20:45 bug#11811: 23.2; Macro pushnew in cl.el captures variable x Janne Nykopp
2012-06-28 21:39 ` Drew Adams
2012-06-28 23:06 ` Juanma Barranquero
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.