0

I want to use the json.el included in 24.5, but cannot do that, because gnus includes an older version of json.el that is loaded before the one from 24.5.

When running list-load-path-shadows I got this as one of the shadows: /usr/share/emacs/site-lisp/gnus/gnus-fallback-lib/json hides /usr/share/emacs/24.5/lisp/json

How do I prevent the fallback json from being loaded?

Alexander Baier
  • 328
  • 1
  • 8
  • I don't have this fallback lib on my system. Did you per chance install Gnus from your OS package manager? – wasamasa Sep 06 '15 at 11:27
  • It appears I did that, yes. I can't remember anymore why I did that. I probably wanted some functionality that is not (yet?) in emacs 24. What would be an alternative to installing gnus via my package manager? Checking out from git and compiling myself? – Alexander Baier Sep 06 '15 at 12:23
  • The Gnus included with Emacs should be newer than your installed copy, so why not use that? – wasamasa Sep 06 '15 at 12:47
  • Said package is actually an AUR package installing a pretty recent version directly from git (I think directly from master). Thus it is newer than the gnus shipped with emacs 24. – Alexander Baier Sep 06 '15 at 13:20
  • Is there a way to remove the shadowing path from the load-path? – Alexander Baier Sep 06 '15 at 13:43
  • You can readd `/usr/share/emacs/24.5/lisp/` to the start of `load-path` by doing something like `(push "/usr/share/emacs/24.5/lisp" load-path)` – Iqbal Ansari Sep 06 '15 at 15:13
  • Is there a way to make those paths system/installation independent? This would allow me to use this config for an Emacs installed in another location. – Alexander Baier Sep 06 '15 at 20:47
  • @AlexanderBaier looking at [http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/startup.el?id=59b5723c9b613f14cd60cd3239cfdbc0d2343b18#n502] it seems `(expand-file-name "../lisp" data-directory)` should give you the path. – Iqbal Ansari Sep 07 '15 at 05:25
  • @IqbalAnsari Thank you, this works nicely! – Alexander Baier Sep 07 '15 at 08:11

1 Answers1

1

You can re-add /usr/share/emacs/24.5/lisp/ to the start of the load-path by doing something like this

(push "/usr/share/emacs/24.5/lisp" load-path)

While this will work, this is system/installation dependent, I found one installation independent way to get path to lisp startup.el

(expand-file-name "../lisp" data-directory)

Combining these together the following should solve your issue

(push (expand-file-name "../lisp" data-directory) load-path)

Please note that this works because gnus packaged with emacs is installed in /usr/share/emacs/24.5/lisp/gnus directory had it been installed directory in /usr/share/emacs/24.5/lisp, the above would have shadowed the package you installed from your package manager.

Iqbal Ansari
  • 7,468
  • 1
  • 28
  • 31