Subject: bug#15139: 24.3; Error in section 11.9.3 of the Elisp Reference Manual

From: Sian Mountbatten <[email-masked]>
Date: Tue, 20 Aug 2013 09:54:58 +0100

In section 11.9.3 Lexical Binding of the Elisp Reference Manual, the
following forms are given:

(defvar my-ticker nil)  ; comment

(let ((x 0))
     (setq my-ticker (lambda ()
                       (setq x (1+ x)))))

(funcall my-ticker)

The manual says that the 3rd form (funcall...) yields `1'. When these
forms are evaluated using C-xC-e, the 3rd form enters the debugger with
the error `void variable x'.

In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.8.2)
 of 2013-06-25 on sochi, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
System Description:	Debian GNU/Linux unstable (sid)

Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-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/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars'
 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
 'LDFLAGS=-Wl,-z,relro' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_ALL: eo.UTF-8
  value of $LC_COLLATE: eo.UTF-8
  value of $LC_CTYPE: eo.UTF-8
  value of $LC_MESSAGES: eo.UTF-8
  value of $LC_MONETARY: eo.UTF-8
  value of $LC_NUMERIC: eo.UTF-8
  value of $LC_TIME: eo.UTF-8
  value of $LANG: eo.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Info

Minor modes in effect:
  desktop-save-mode: t
  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-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
n o w SPC a l m o s t SPC w o r k i n g SPC s a t i 
s f a c t o r i l y . SPC A l l SPC t h a t ' s SPC 
m i s s i n g SPC i s SPC a SPC D e b i a n SPC m e 
n u . <backspace> , SPC b u t SPC t h a t SPC w i l 
l SPC c o m e . < / P <backspace> p > <return> C-x 
C-s C-x k <return> <help-echo> <help-echo> <help-echo> 
<help-echo> C-x C-f s r c / h t m l / g w m <tab> - 
<tab> <backspace> - m a n <tab> <return> C-s p r o 
v i d e s C-s C-s C-s <right> <left> <backspace> C-s 
C-s <right> <left> <backspace> C-s C-s <right> <left> 
<backspace> C-s C-s C-s C-s <up> C-x C-s <help-echo> 
C-x k <return> C-x o SPC <tab> <return> <help-echo> 
<help-echo> <help-echo> <down-mouse-5> <mouse-5> <help-echo> 
<down-mouse-5> <mouse-5> <down-mouse-5> <mouse-5> <help-echo> 
l SPC SPC <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <up> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> C-h f C-g <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> C-x C-e <down> 
<down> <down> <down> C-x C-e q <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <menu-bar> 
<help-menu> <send-emacs-bug-report>

Recent messages:
Saving file /home/sian/Retejo/blog/engblog.html...
Wrote /home/sian/Retejo/blog/engblog.html
Making completion list...
Mark saved where search started [4 times]
Saving file /home/sian/src/html/gwm-2.0-manual.html...
Wrote /home/sian/src/html/gwm-2.0-manual.html
Quit
(lambda nil (setq x (1+ x)))
Entering debugger...
Back to top level.

Load-path shadows:
/usr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.3/lisp/textmodes/ispell
/usr/share/emacs24/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.3/lisp/textmodes/flyspell

Features:
(shadow sort gnus-util mail-extr emacsbug message cl-macs gv format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils skeleton sgml-mode debug make-mode
help-fns bookmark pp misearch multi-isearch cc-langs cl cl-lib cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs etags ring help-mode apropos dired jka-compr info easymenu
desktop time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar 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 minibuffer loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)

-- 
Sian Mountbatten (home web-site http://www.poenikatu.co.uk/>)
Learning C++11 from the C++ Primer 5th edition.
I'm an associate FSF member (no. 10888).
Help us support software freedom! http://www.fsf.org/jf?referrer=10888