Troubleshooting Emacs Libraries

While trawling around the WikEmacs site today, I came across this page on troubleshooting that explained some commands that I wasn't familiar with. The first two are helpful if you are trying to search out library problems. For example, if you want to know where your version of org-mode is coming from you could find out with 【Meta+xlocate libraryReturnorgReturn】 and Emacs will tell you where it is loading the library from

Library is file ~/tools/org-mode/lisp/org.elc

The related command list-load-path-shadows will show you if your load-path variable is causing one version of a library to shadow another. For example, when I run it, it tells me that the version of org-mode that came with Emacs is shadowed by the newer version from my tools directory.

Finally, and perhaps most useful, is the find-library command. Suppose you want to look at the code for a library you are using (including the core libraries), let's say key-chord.el. Merely type 【Meta+xfind-libraryReturnkey-chordReturn】 and Emacs will open a buffer in a new window with the code loaded in it. Very handy.

This entry was posted in General and tagged . Bookmark the permalink.

One Response to Troubleshooting Emacs Libraries

  1. Phil says:

    I consider all these kinds of things to be a part of the "Self Documenting" aspect of Emacs (not least because there is often critical information in a library's Commentary).

    I bind find-library to C-h C-l, and it's something I use regularly (as much for opening my own config -- which is split into multiple files -- as for other code).

    I keep thinking that there's an extremely useful blog/tutorial in this particular subject. There's which has the basics, but it could be made much more comprehensive.

    Anyone feeling inspired? :)

Comments are closed.