Subject: Re: bug#8332: Acknowledgement (24.0.9999; lexbind-new branch errors on M-x describe-variable lexical-binding)

From: Tassilo Horn <[email-masked]>
Date: Thu, 24 Mar 2011 16:27:07 +0100

Stefan Monnier <[email-masked]> writes:

Hi Stefan,

>> After some bisectioning, I found out the culprit is anything.
>> Commenting out
>>   (require 'anything)
>> in my .emacs, so I'll Cc-ed Thierry and Rubykitch.
>
> Please try to only set lexical-binding via file-local variables.  This
> should be 100% backward compatible (i.e. only affect the files where
> you've set that variable), so any new error like the above is not
> normal.

I don't set lexical-binding globally (anymore).  The following recipe
produces the aformentioned error for me.

1. emacs -Q

2. C-h v lexical-binding RET shows its value is nil, and it shows its
   docs.

3. In *scratch* eval:

   (add-to-list 'load-path "~/repos/el/anything-config/")
   (require 'anything)

4. M-x toggle-debug-on-error (only to get the backtrace in 5.)

5. C-h v lexical-binding RET, and I get

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (void-variable symbol)
  (eq symbol (quote anything-type-attributes))
  (if (eq symbol (quote anything-type-attributes)) (progn (setq ad-return-value (concat ad-return-value "\n\n++++ Types currently defined ++++\n" (mapconcat (lambda (sym) (get sym (quote anything-typeattrdoc))) anything-types "\n")))))
  (when (eq symbol (quote anything-type-attributes)) (setq ad-return-value (concat ad-return-value "\n\n++++ Types currently defined ++++\n" (mapconcat (lambda (sym) (get sym (quote anything-typeattrdoc))) anything-types "\n"))))
  (let (ad-return-value) (setq ad-return-value (apply (quote ad-Orig-documentation-property) arg1 arg2 rest)) (when (eq symbol (quote anything-type-attributes)) (setq ad-return-value (concat ad-return-value "\n\n++++ Types currently defined ++++\n" (mapconcat (lambda (sym) (get sym (quote anything-typeattrdoc))) anything-types "\n")))) (when (eq symbol (quote anything-sources)) (setq ad-return-value (concat ad-return-value "\n" (mapconcat (lambda (sym) (get sym (quote anything-attrdoc))) anything-additional-attributes "\n")))) ad-return-value)
  documentation-property(lexical-binding variable-documentation)
  describe-variable(lexical-binding)
  call-interactively(describe-variable nil nil)
--8<---------------cut here---------------end--------------->8---

6. After closing the backtrace buffer with `q', that's what I get in
   *Help*

--8<---------------cut here---------------start------------->8---
lexical-binding is a variable defined in `C source code'.
Its value is nil
--8<---------------cut here---------------end--------------->8---

So the docs and the notice, that this variable automatically becomes
buffer local when setting it are missing.

My anything files are *not* compiled.

Bye,
Tassilo