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

org mode export broken emacs 25.1.1 void org-link-types #8334

Closed
greppy opened this Issue Feb 8, 2017 · 16 comments

Comments

Projects
None yet
@greppy

greppy commented Feb 8, 2017

Description :octocat:

cannot export org file

Reproduction guide 🐞

  • Install emacs 25.1.1 from source on RHEL7
  • git clone spacemacs
  • Start Emacs
  • open org file
  • C-c, C-e
  • get error

Observed behaviour: 👀 💔
void-function org-link-types

Expected behaviour: ❤️ 😄
Export org mode file as html

System Info 💻

  • OS: gnu/linux
  • Emacs: 25.1.1
  • Spacemacs: 0.200.7
  • Spacemacs branch: master (rev. c2774bc)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: ivy
  • Layers:
(ivy emacs-lisp git markdown python)
  • System configuration features: XPM JPEG TIFF GIF PNG SOUND DBUS GCONF GSETTINGS NOTIFY LIBSELINUX LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11

Backtrace 🐾

Problems while trying to load feature ‘org-w3m’
Problems while trying to load feature ‘org-bbdb’
Problems while trying to load feature ‘org-bibtex’
Problems while trying to load feature ‘org-docview’
Problems while trying to load feature ‘org-gnus’
Problems while trying to load feature ‘org-info’
Problems while trying to load feature ‘org-irc’
Problems while trying to load feature ‘org-mhe’
Problems while trying to load feature ‘org-rmail’
File mode specification error: (void-function org-link-types)
org-element--set-regexps: Symbol’s function definition is void: org-link-types
#### System Info :computer:
- OS: gnu/linux
- Emacs: 25.1.1
- Spacemacs: 0.200.7
- Spacemacs branch: master (rev. c2774bc0)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: ivy
- Layers:
‘‘‘elisp
(ivy emacs-lisp git markdown python)
‘‘‘
- System configuration features: XPM JPEG TIFF GIF PNG SOUND DBUS GCONF GSETTINGS NOTIFY LIBSELINUX LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11
@jorgemorais

This comment has been minimized.

jorgemorais commented Feb 14, 2017

The error message "Symbol’s function definition is void: org-link-types" is also seen on #8351 .

@rgrinberg

This comment has been minimized.

Contributor

rgrinberg commented Feb 18, 2017

The way I've worked around this is by deleting the org mode that comes with emacs itself. On archlinux and emacs from master, this required something like:

$ sudo rm -rf /usr/share/emacs/26.0.50/lisp/org/*
@mbtuckersimm

This comment has been minimized.

mbtuckersimm commented Mar 23, 2017

I just had this problem too. I had installed a new version of org-mode from elpa, and I had some code to set up org-mode in my init.el that only worked with this new version. But packages you install with the package manager get loaded after your emacs loads your init file (see the Info pages on Emacs Lisp Packages), so emacs was trying to evaluate the code using just the version of org-mode that comes with emacs, not the newer version. This is likely why deleting the older version works.

My solution was to call package-initialize in init.el before the org-mode code gets evaluated. This loads all of the user-installed packages, and hence ensures that the right version of org-mode is loaded when the relevant section of the init file is read.

Not sure if this is exactly the same as your problem, but I hope this is helpful.

@skyer9

This comment has been minimized.

skyer9 commented May 1, 2017

@mbtuckersimm you're solution is correct.

it is because after "install a new version of org-mode from elpa"
org-mode must be load after elpa initialized.

@stvharman

This comment has been minimized.

stvharman commented Aug 17, 2017

The explanation about this could improve in the documentation. I had simply included org in my configuration layers and experienced this problem due to version conflict. However, the information provided at
http://spacemacs.org/layers/+emacs/org/README.html
lacks specific guidance.

A question: Does this approach (package-initialize in init.el) have any drawbacks or disadvantages? If so, how can they be avoided?

thanks in advance!

@jkw

This comment has been minimized.

jkw commented Aug 30, 2017

Just got this error too. Never had it before, installed Spacemacs on a RPi3 yesterday, didn't get this error. Installed it just now on a Linode VPS based on ArchLinux, got the error.

@zaen323

This comment has been minimized.

zaen323 commented Aug 31, 2017

For what it's worth,
(spacemacs|use-package-add-hook org
:pre-init
(package-initialize)
)
worked for me

@othierry

This comment has been minimized.

othierry commented Sep 22, 2017

thanks @zaen323 your solution worked perfectly for me. Simple & Clean.

@zaen323

This comment has been minimized.

zaen323 commented Sep 23, 2017

@othierry Glad to be of help :)

@ckubrak

This comment has been minimized.

ckubrak commented Oct 9, 2017

@mbtuckersimm @othierry @zaen323 Where did you put the (package-initialize) script?
I've tried in user-init and user-config and non of them worked.

@mbtuckersimm

This comment has been minimized.

mbtuckersimm commented Oct 9, 2017

I put it near the beginning of my init.el. But really it just needs to go before any code that affects the packages you've loaded.

@rgrinberg

This comment has been minimized.

Contributor

rgrinberg commented Oct 9, 2017

Should this fix be upstreamed? I tried it out and it works just fine for me.

@ckubrak

This comment has been minimized.

ckubrak commented Oct 9, 2017

@mbtuckersimm I've fixed it, but I broke evaluating code blocks in org-mode. Everything started when I tried to fix the code evaluation in the first place

@mbtuckersimm

This comment has been minimized.

mbtuckersimm commented Oct 10, 2017

@ckubrak What exactly is the problem that you're having? I have this code in my org-mode setup to allow code block evaluation for the languages that I need:

(org-babel-do-load-languages
      'org-babel-load-languages
      '((emacs-lisp . t)
        (sh . t)
	(shell . t)
	(perl . t)
	(python . t)))

@ckubrak

This comment has been minimized.

ckubrak commented Oct 12, 2017

@mbtuckersimm I managed to make it work by adding (package-initialize) to my init.el

guewen added a commit to guewen/spacemacs.d that referenced this issue Dec 1, 2017

@mikaelv

This comment has been minimized.

mikaelv commented Dec 17, 2017

I had a similar issue when org-babel-do-load-languages was in my user-init.
I fixed it by moving the org-babel-load-languages variable to dotspacemacs-configuration-layers:

     (org :variables
          org-babel-load-languages '((emacs-lisp . t)
                                     (python . t)
                                     (scala . t))
          )

dbrumley pushed a commit to dbrumley/dotfiles that referenced this issue Jan 26, 2018

David Brumley
Fix to load latest org first
Call `package-initialize` first in init.el so that the latest downloaded
packages are preferrred. See
syl20bnr/spacemacs#8334

Eeemil added a commit to Eeemil/dotfiles that referenced this issue Sep 17, 2018

Now runs package-initialize before require:ing org-mode
Due to some conflict between Emacs built-in org-mode and org-mode from
orgmode.org/elpa, I need to initialize packages (e.g. initialize the
user-installed newer version of org-mode) before I can require org-mode. Read
more at syl20bnr/spacemacs#8334
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment