bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#12938: 24.2; Lexical binding leaks into package-install somehow


From: Magnar Sveen
Subject: bug#12938: 24.2; Lexical binding leaks into package-install somehow
Date: Mon, 19 Nov 2012 22:07:59 +0100

Create a test.el file with these contents:

    ;;; -*- lexical-binding: t -*-

    (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
    (package-initialize)
    (package-refresh-contents)
    (package-install 'multiple-cursors)

And load it. Notice that the compiler warnings includes:

    assignment to free variable `strings'

Remove multiple-cursors from .emacs.d/elpa, change lexical-binding to
nil, and load the file again.

Notice that the compiler warning about 'strings' does not show up.

In other words, the lexical binding in test.el leaks into the
installation of multiple-cursors.

Here is the code in question that generates the warning:

    (defun mc/region-strings ()
      (let ((strings (list (buffer-substring-no-properties (point) (mark)))))
        (mc/for-each-fake-cursor
         (add-to-list 'strings (buffer-substring-no-properties
                                (mc/cursor-beg cursor)
                                (mc/cursor-end cursor))))
        strings))

    (defmacro mc/for-each-fake-cursor (&rest forms)
      "Runs the body for each fake cursor, bound to the name cursor"
      `(mapc #'(lambda (cursor) ,@forms)
             (mc/all-fake-cursors)))




In GNU Emacs 24.2.1 (x86_64-apple-darwin10.8.0, NS apple-appkit-1038.36)
 of 2012-09-04 on fi-bp-202.local
Windowing system distributor `Apple', version 10.3.1038
Configured using:
 `configure '--prefix=/usr/local/Cellar/emacs/24.2' '--without-dbus'
 '--enable-locallisppath=/usr/local/share/emacs/site-lisp'
 '--infodir=/usr/local/Cellar/emacs/24.2/share/info/emacs' '--with-ns'
 '--disable-ns-self-contained' 'CC=/usr/bin/gcc-4.2' 'CFLAGS=-Os -w
 -pipe -march=core2 -msse4 -mmacosx-version-min=10.6'
 'LDFLAGS=-L/usr/local/lib''

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: nil
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  diff-auto-refine-mode: t
  elisp-slime-nav-mode: t
  show-paren-mode: t
  global-hl-line-mode: t
  ido-ubiquitous-mode: t
  wrap-region-global-mode: t
  wrap-region-mode: t
  persp-mode: t
  yas/global-mode: t
  yas/minor-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  global-subword-mode: t
  subword-mode: t
  shell-dirtrack-mode: t
  recentf-mode: t
  delete-selection-mode: t
  global-auto-revert-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <left> <C-left> <C-left> <C-left>
<C-left> <C-left> <C-left> <C-right> <right> <right>
<up> <right> <C-right> <C-right> <C-right> <C-right>
<C-right> <C-right> <C-right> <C-right> <C-left> M-w
q <up> <up> <up> <up> <return> C-y <return> C-_ C-_
C-_ <down> <down> <up> <up> <return> C-y C-_ C-_ <down>
<up> <return> C-y <return> <up> <up> M-j <down> C-k
<down> <down> <down> C-x C-s C-x C-f e l p <backspace>
<backspace> <backspace> . e m <return> e l <return>
C-d <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
D y y <up> <up> <up> q <up> <up> <up> <up> <up> <left>
<left> <left> <left> <left> <backspace> n i l <down>
<down> <down> <down> <down> <down> C-x C-s M-: <up>
<return> y <S-right> C-s s t r i n g s C-s C-s C-s
<up> <up> <up> <up> <up> <home> C-x k <return> C-x
0 <up> <up> <up> <up> <up> <left> <C-left> C-d C-d
C-d t <down> <down> <down> <down> <down> <down> <down>
<up> <up> <up> <up> <up> <up> <backspace> n i l C-x
C-s <down> <down> <down> <down> <down> C-x f e l p
C-g C-x C-f <return> <return> C-d g <down> <down> <down>
<up> <down> D y y q <down> C-x C-s M-: <down> <up>
<return> y <S-right> <end> <home> <end> <home> C-s
s t r i n g s C-s C-s C-s <down> <down> <up> <up> C-x
k y <backspace> <return> C-x 0 <up> <up> <up> <up>
<up> <C-left> M-d t C-x C-s <down> <down> <down> <down>
C-x C-f <return> <return> C-d f q g <up> D y y q M-:
<up> <return> y <S-right> q <down> <down> C-SPC <C-up>
<C-up> M-w <down> <down> <down> <down> <down> <down>
<down> M-x r e p o r t - <return>

Recent messages:
Compiling /Users/fimasvee/.emacs.d/elpa/multiple-cursors-20121118.2110/multiple-cursors.el...done
Wrote /Users/fimasvee/.emacs.d/elpa/multiple-cursors-20121118.2110/multiple-cursors.elc
Checking /Users/fimasvee/.emacs.d/elpa/multiple-cursors-20121118.2110...
Compiling /Users/fimasvee/.emacs.d/elpa/multiple-cursors-20121118.2110/rectangular-region-mode.el...done
Wrote /Users/fimasvee/.emacs.d/elpa/multiple-cursors-20121118.2110/rectangular-region-mode.elc
Checking /Users/fimasvee/.emacs.d/elpa/multiple-cursors-20121118.2110...
Done (Total of 7 files compiled, 1 skipped)
Loading /Users/fimasvee/test.el (source)...done
t
Mark set
line-move-visual: End of buffer

Load-path shadows:
/Users/fimasvee/.emacs.d/elpa/php-mode-20121015.6/php-mode hides /Users/fimasvee/.emacs.d/site-lisp/php-mode/php-mode
/Users/fimasvee/.emacs.d/elpa/multiple-cursors-20121118.2110/rectangular-region-mode hides /Users/fimasvee/.emacs.d/site-lisp/multiple-cursors/rectangular-region-mode
/Users/fimasvee/.emacs.d/elpa/multiple-cursors-20121118.2110/multiple-cursors hides /Users/fimasvee/.emacs.d/site-lisp/multiple-cursors/multiple-cursors
/Users/fimasvee/.emacs.d/elpa/multiple-cursors-20121118.2110/multiple-cursors-pkg hides /Users/fimasvee/.emacs.d/site-lisp/multiple-cursors/multiple-cursors-pkg
/Users/fimasvee/.emacs.d/elpa/multiple-cursors-20121118.2110/multiple-cursors-core hides /Users/fimasvee/.emacs.d/site-lisp/multiple-cursors/multiple-cursors-core
/Users/fimasvee/.emacs.d/elpa/multiple-cursors-20121118.2110/mc-mark-more hides /Users/fimasvee/.emacs.d/site-lisp/multiple-cursors/mc-mark-more
/Users/fimasvee/.emacs.d/elpa/multiple-cursors-20121118.2110/mc-edit-lines hides /Users/fimasvee/.emacs.d/site-lisp/multiple-cursors/mc-edit-lines
/Users/fimasvee/.emacs.d/elpa/multiple-cursors-20121118.2110/mc-cycle-cursors hides /Users/fimasvee/.emacs.d/site-lisp/multiple-cursors/mc-cycle-cursors
/Users/fimasvee/.emacs.d/site-lisp/s/examples hides /Users/fimasvee/.emacs.d/site-lisp/dash/examples
/Users/fimasvee/.emacs.d/site-lisp/s/examples-to-tests hides /Users/fimasvee/.emacs.d/site-lisp/dash/examples-to-tests
/Users/fimasvee/.emacs.d/site-lisp/s/examples-to-docs hides /Users/fimasvee/.emacs.d/site-lisp/dash/examples-to-docs
/Users/fimasvee/.emacs.d/site-lisp/s/ert hides /Users/fimasvee/.emacs.d/site-lisp/dash/ert
/Users/fimasvee/.emacs.d/site-lisp/fill-column-indicator/fill-column-indicator hides /Users/fimasvee/.emacs.d/site-lisp/fill-column-indicator
~/.emacs.d/users/fimasvee/init hides /Users/fimasvee/.emacs.d/init
/Users/fimasvee/.emacs.d/elpa/magit-20121030.2025/rebase-mode hides /usr/local/share/emacs/site-lisp/rebase-mode
/Users/fimasvee/.emacs.d/site-lisp/delsel/delsel hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/delsel
/Users/fimasvee/.emacs.d/custom hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/custom
/usr/local/share/emacs/site-lisp/trampver hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/trampver
/usr/local/share/emacs/site-lisp/tramp hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp
/usr/local/share/emacs/site-lisp/tramp-uu hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-uu
/usr/local/share/emacs/site-lisp/tramp-smb hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-smb
/usr/local/share/emacs/site-lisp/tramp-sh hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-sh
/usr/local/share/emacs/site-lisp/tramp-loaddefs hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-loaddefs
/usr/local/share/emacs/site-lisp/tramp-gw hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-gw
/usr/local/share/emacs/site-lisp/tramp-ftp hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-ftp
/usr/local/share/emacs/site-lisp/tramp-compat hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-compat
/usr/local/share/emacs/site-lisp/tramp-cmds hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-cmds
/usr/local/share/emacs/site-lisp/tramp-cache hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/net/tramp-cache
/Users/fimasvee/.emacs.d/elpa/magit-20121030.2025/.dir-locals hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/gnus/.dir-locals
/Users/fimasvee/.emacs.d/site-lisp/s/ert hides /usr/local/Cellar/emacs/24.2/share/emacs/24.2/lisp/emacs-lisp/ert

Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode
mm-bodies mailabbrev gmm-utils mailheader sendmail
multiple-cursors-autoloads tar-mode sh-script executable term ehelp
electric pp timezone cus-edit cus-start cus-load octomacs
setup-ruby-mode ruby-mode-expansions ruby-mode markdown-mode mule-util
cal-move octomacs-autoloads autoload mail-utils parse-time
network-stream starttls url-cache url-http tls url-gw url-auth url
url-proxy url-privacy url-expand url-methods url-history url-cookie
yaml-mode find-dired vc ediff-merg ediff-diff ediff-wind ediff-help
ediff-util ediff-mult ediff-init ediff vc-dispatcher rebase-mode rx
conf-mode setup-js2-mode js2-imenu-extras js2-refactor js2r-conveniences
js2r-conditionals js2r-wrapping js2r-functions js2r-vars js2r-iife
js2r-formatting js2r-helpers disp-table js2-mode-expansions js2-mode
cc-langs css-mode-expansions css-mode ibuf-ext ibuffer dired-x
zencoding-mode rename-sgml-tag crappy-jsp-mode js-mode-expansions js
newcomment cc-mode-expansions cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs jsp-expansions
html-mode-expansions sgml-mode org-wl org-w3m org-vm org-rmail org-mhe
org-mew org-irc org-jsinfo org-infojs org-html org-exp ob-exp
org-exp-blocks org-agenda org-info org-gnus org-docview org-bibtex
bibtex org-bbdb setup-org org-mode-expansions org ob-emacs-lisp
ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys
ob ob-eval org-pcomplete org-list org-faces org-compat org-entities
org-macs noutline outline cal-menu calendar cal-loaddefs hippie-exp
misearch multi-isearch tabify setup-magit magit-svn magit-bisect
magit-key-mode magit diff-mode log-edit pcvs-util add-log vc-git unsafep
elisp-slime-nav etags oppdrag-mode diminish server mac my-misc
appearance zoom-frm frame-cmds frame-fns avoid paren hl-line
key-bindings windmove smex setup-ido ido-ubiquitous ido browse-kill-ring
fill-column-indicator multifiles change-inner smart-forward wgrep
setup-rgrep grep compile eproject esh-var esh-io esh-cmd esh-ext
esh-proc esh-arg eldoc esh-groups eshell esh-module esh-mode esh-util
jump-char multiple-cursors rectangular-region-mode mc-mark-more
thingatpt mc-cycle-cursors mc-edit-lines multiple-cursors-core rect
inline-string-rectangle mark-more-like-this mark-multiple expand-region
text-mode-expansions expand-region-custom expand-region-core s
file-defuns imenu mode-mappings setup-paredit paredit setup-html-mode
setup-ffip find-file-in-project setup-wrap-region wrap-region
setup-perspective perspective setup-ace-jump-mode ace-jump-mode
setup-yasnippet buster-snippets buster-snippet-helpers yasnippet
dropdown-list help-mode view setup-hippie setup-shell shell-command
setup-dired dired-details dash exec-path-from-shell sane-defaults
uniquify undo-tree edmacro kmacro diff smooth-scrolling warnings subword
winner tramp-cache tramp-sh tramp tramp-compat tramp-loaddefs shell
pcomplete comint ansi-color ring format-spec advice advice-preload
recentf tree-widget wid-edit delsel easy-mmode autorevert setup-package
clojure-test-mode-autoloads elisp-slime-nav-autoloads elnode-autoloads
elnode ert derived help-fns find-func ewoc easymenu debug cl dired
regexp-opt db json web dotassoc kv url-util url-parse auth-source assoc
gnus-util password-cache url-vars mailcap mm-encode mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr creole-autoloads
db-autoloads exec-path-from-shell-autoloads fakir-autoloads
gist-autoloads gh-autoloads eieio byte-opt bytecomp byte-compile cconv
macroexp htmlize-autoloads kv-autoloads logito-autoloads magit-autoloads
nrepl-autoloads clojure-mode-autoloads paredit-autoloads
pcache-autoloads finder-inf php-mode-autoloads slime-js-autoloads
slime-repl-autoloads slime-autoloads web-autoloads package
tabulated-list setup-elnode saveplace time-date tooltip ediff-hook
vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset image fringe
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 files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process ns multi-tty
emacs)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]