3

Update: 11/Aug: I forgot to mention that I'm using literate programming to build the init.el from an org file. It seems that the problem appears when emacs opens the configure.org to generate the .el file.

I noticed that if I write the configuration to a .emacs (as I wrote below) the right version is loaded.

The right question

How to load the latest version of org-mode using org literate programming to generate the config.el file?


I'd like to use the latest version of org-mode from the git repository.

My setup

Emacs version: GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5) of 2015-03-07 on trouble, modified by Debian

About org-mode

  • I clone the repository, say in ~/.emacs.d/org-mode
  • Compile the autoload using make autoload
  • Initial part of my .emacs is

    (package-initialize)
    
    (require 'package)
    (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
    
    (add-to-list 'load-path "~/.emacs.d/org-mode/lisp/")
    (add-to-list 'load-path "~/.emacs.d/org-mode/contrib/lisp/" t)
    
    (unless (package-installed-p 'use-package)
      (package-install 'use-package))
    
    (setq use-package-verbose t)
    (setq use-package-always-ensure t)
    
    (require 'use-package)
    
    (use-package auto-compile
      :config (auto-compile-on-load-mode))
    
    (setq load-prefer-newer t)
    

Result

I call M-x org-version and get

Org-mode version 8.2.10 (release_8.2.10 @ /home/.../.emacs.d/org-mode/lisp/)

This is no the latest release!

If I call M-x org-reload it load the newest

Org-mode version 8.3.5 (release_8.3.5 @ /home/.../.emacs.d/org-mode/lisp/)

But it is not loaded automatically.

Question

What am I doing wrong??

P.D.: I accept suggestions about simplifying the configuration.

3
  • I've had similar problems and don't know the solution. But other org lisp files probably exist on your system? Like under /usr/share?
    – Brian Z
    Aug 10, 2016 at 21:16
  • I split my .emacs config into 2 parts: 1) package setup into normal .el config 2) other setup into org literate files, and load them after 1) using babel-loader.
    – lurdan
    Aug 12, 2016 at 2:20
  • Do you have org-mode package installed twice?
    – Melioratus
    Sep 4, 2016 at 5:14

1 Answer 1

1

You have still not provided the real initialization code, but from your description it seems, your .emacs contains code that loads an org-file for example with org-babel-load-file.

To use this function org-mode has to be loaded and because it's part of emacs, this doesn't raise a chicken-and-egg problem, but succeeds with the builtin version. And because org-mode now is loaded it will never be looked up in your cloned directory that is configured after this point.

Starting from this insight you have at least these possibilities:

Tangle your org-file

Just tangle the .emacs or init.el every time you change your source file. There is for sure a way to do this automatically.

Bootstrap org-mode before loading the init-file

Move the loading of org-mode to .emacs and then org-babel-load-file the rest of your configuration.

reload org-mode

Reload org-mode in the above shown code with org-reload. I think this is the least useful choice because org-mode is loaded twice.

1
  • I have the same problem, but could you please make your answer more useful by adding some code in init.el for each case scenario?
    – doctorate
    Jan 31, 2017 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.