3

I want to install org-mode from Github repository and override that from ELPA.

My emacs configuration runs from an org-file, these are the lines relevant to package management and org-mode load path:

#+BEGIN_SRC emacs-lisp
    (require 'package)
    (package-initialize)                    
    (setq load-path (cons "~/.emacs.d/org-mode/lisp/" load-path))
    (setq load-path (cons "~/.emacs.d/org-mode/contrib/lisp/" load-path))
#+END_SRC

I installed org-mode version 9.0.4 from Github repo with these lines of bash code:

cd ~/.emacs.d/
git clone git://orgmode.org/org-mode.git
make autoloads

I deleted the org mode from ELPA folder inside .emacs.d. When I fire up emacs I get this error message:

Warning (initialization): An error occurred while loading `~/.emacs.d/init.el':

Symbol's function definition is void: org-define-error

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.

What am I missing here? Your help would be much appreciated. Any suggestions to improve my Emacs setup file are also welcome.

Update whey I hit M-x org-version it takes the version info from another location which is /usr/share/emacs/24.5/lisp/org/. What I want to achieve that emacs run org-mode from the new cloned location.

Notes

  • Emacs-version: GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-17 on lgw01-04, modified by Debian
  • Org-version: Org-mode version 8.2.10 (release_8.2.10 @ /usr/share/emacs/24.5/lisp/org/)
doctorate
  • 1,789
  • 16
  • 39
  • Are you using an `org` file as `init` file through `org-babel-load-file`? – Dox Feb 04 '17 at 09:16
  • I almost forgot that, sorry, yes I do. I have a `configuration.org` file that is called from `init.el` with that one liner, `(org-babel-load-file "~/.emacs.d/configuration.org")` – doctorate Feb 04 '17 at 09:36

1 Answers1

3

I had a similar problem with my installation, but I'm using the command org-babel-load-file to load an org file as init file.

What I believe it was causing the problem (might not be it) is that org was not initialized when I need it to compile the pointed org file. Therefore, I called it!

My Configuration

;; This is my init.el localed on .emacs.d/
(require 'package)
(package-initialize)
(require 'org)
(org-babel-load-file "~/.emacs.d/configuration.org")

Right after that, I call the repositories

;; This is my configuration.org located on .emacs.d/
(add-to-list 'package-archives
         '("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives 
             '("org" . "http://orgmode.org/elpa/") t)

;; After this line all your configurations

Notice that I use the org repository, instead of a local github. Important: At this point I haven't installed any org version, but the built-in.

Installing the updated version

Now is the time to start your emacs. If everything goes OK:

  • Run the command M-x list-packages. Wait for the list to appear.
  • Search for org and org-plus-contrib; both from the org repository.
  • Mark the two packages to install them. Use the letter i to mark them.
  • (opt) sellect any other package you want to install.
  • Execute the actions you marked, using the letter x. Wait for the process to finish.

Finally, resetart your emacs session.

Dox
  • 955
  • 10
  • 28
  • thank you sir, I will follow your procedure and get back to you later. – doctorate Feb 04 '17 at 09:44
  • I can only confirm what you have just said that org should be required early on in the `init.el` and then the rest of config goes only after that. This way when I hit M-x org-version it reads from the load path and not from the /usr/share/... having said that I ran into another error in org-mode related to the org-babel configuration. When I fire up emacs now there comes an error with `org-babel-header-args-safe-fn` which is related to org-babel, when I commented out `the `(R .t)` line related to the R statistics language in org babel, error has gone. Any idea? – doctorate Feb 04 '17 at 14:03
  • when I installed org-mode from Github, this error has gone WITHOUT commenting out the desired `(R .t)` line from inside org-babel configuration. – doctorate Feb 04 '17 at 14:27
  • given all the troubles I encountered with org-mode from other repos, I highly recommend using the Github version, it seems that many bugs had been fixed there. – doctorate Feb 04 '17 at 15:17