Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When installing org-mode: Symbol's value as variable is void: org-src-lang-modes #2559

Closed
elliottslaughter opened this issue Aug 15, 2017 · 7 comments
Labels

Comments

@elliottslaughter
Copy link

When I install a fresh copy of org-mode via a fresh el-get install, I see the following error:

Bug: Symbol's value as variable is void: org-src-lang-modes

Based on the backtrace below, this looks like it's going through el-get's loadefs magic. Is there any way that could be causing trouble?

Here is the backtrace:

Debugger entered--Lisp error: (void-variable org-src-lang-modes)
  add-to-list(org-src-lang-modes ("sclang" . sclang))
  byte-code("\300\301\302\303\304\"\"\207" [with-eval-after-load "org" add-to-list org-src-lang-modes ("sclang" . sclang)] 5)
  load("/home/eslaught/.emacs.d/el-get/.loaddefs" nil t)
  el-get-load-fast("/home/eslaught/.emacs.d/el-get/.loaddefs.el")
  el-get-eval-autoloads()
  el-get(sync)
  econf-install()
  eval-buffer(#<buffer  *load*-610652> nil "/home/eslaught/econf/econf-helper.el" nil t)  ; Reading at buffer position 1907
  load-with-code-conversion("/home/eslaught/econf/econf-helper.el" "/home/eslaught/econf/econf-helper.el" nil t)
  require(econf-helper)
  eval-buffer(#<buffer  *load*> nil "/home/eslaught/.emacs" nil t)  ; Reading at buffer position 205
  load-with-code-conversion("/home/eslaught/.emacs" "/home/eslaught/.emacs" t t)
  load("~/.emacs" t t)
  #[0 "^H\205\262^@     \306=\203^Q^@\307^H\310Q\202;^@ \311=\204^^^@\307^H\312Q\202;^@\313\307\314\315#\203*^@\316\202;^@\313\307\314\317#$
  command-line()
  normal-top-level()

Versions:

Emacs  : GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7)
 of 2014-03-07 on lamiak, modified by Debian
Package: Org mode installed via el-get, from the following Git commit

commit 489080124210a78d6622c79ede5c003e07c2ccb8
Merge: b900a85 731f59f
Author: Kyle Meyer <kyle@kyleam.com>
Date:   Mon Aug 14 22:04:35 2017 -0400

    Merge branch 'maint'
@npostavs
Copy link
Collaborator

I think this is a bug in org-mode, with-eval-after-load is new in Emacs 24.4.

The reason it's coming from el-get loaddefs is because of this block in contrib/lisp/ob-sclang.el (note the ;;;###autoload cookie):

;;;###autoload
(with-eval-after-load "org"
  (add-to-list 'org-src-lang-modes '("sclang" . sclang)))

@elliottslaughter
Copy link
Author

I have confirmed that the same org-mode version loads correctly in Emacs 24.4.1 (and fails in 24.3.1), which supports the previous comment. I will report this to the upstream developers.

@kaushalmodi
Copy link

kaushalmodi commented Sep 7, 2017

That's strange.. I would have thought that in that case with-eval-after-load should have thrown an error.

Update: Unless @elliottslaughter byte-compiled Org using 24.4 and trying to reuse the same on 24.3.

@elliottslaughter
Copy link
Author

$ rm -rf ~/.emacs.d
$ /usr/bin/emacs --version
GNU Emacs 24.3.1
...
$ /usr/bin/emacs
...
Error (el-get): while installing org-mode: Symbol's value as variable is void: org-src-lang-modes

(My .emacs is set to load el-get and install org-mode.)

Is there any other way I could be getting stale build results?

@kaushalmodi
Copy link

I just pushed this to Org maint branch (and merged to master too): http://orgmode.org/cgit.cgi/org-mode.git/commit/?h=maint&id=7a29c82e1100f0e0e5c1c8d8b276139358abb031

See if that fixes this issue.

@elliottslaughter
Copy link
Author

The fix works, thanks.

@npostavs
Copy link
Collaborator

npostavs commented Sep 8, 2017

That's strange.. I would have thought that in that case with-eval-after-load should have thrown an error.

Update: Unless @elliottslaughter byte-compiled Org using 24.4 and trying to reuse the same on 24.3.

When compiling on 24.3, Emacs doesn't know about with-eval-after-load so it's treated as a function, therefore the argument expressions get evaluated first, e.g.,

(progn
  (defun foo ()
    (outer (inner)))
  (byte-compile 'foo)
  (foo))

gives (void-function inner).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants