7

I'm trying to add line numbers to emacs, following this guide: Linum: Separating line numbers from text.

I have to edit "linum.el" to add some code, however I can't find that file. I'm using ubuntu, I have tried using:

find */* linum.el

but I'm getting:

find: `linum.el': No such file or directory
Dan
  • 32,584
  • 6
  • 98
  • 168
user5133
  • 73
  • 3

3 Answers3

14

M-x find-library will let you select a library and take you to the source code.

Note that you may not have the elisp files installed on your machine. For Ubuntu, try installing emacs24-el (or whatever version you're on; look for the ...-el to get the elisp source).

Dan
  • 32,584
  • 6
  • 98
  • 168
5

If you are looking for source of a function <name>, you can find a link to the source in the description of the function:

C-h f <name> RET

In your case it will be:

C-h f linum-mode RET

Starting from Emacs 24.3 C-h f can perform autoloading:

When this command is called for an autoloaded function whose docstring contains a key substitution construct, that function's library is automatically loaded, so that the documentation can be shown correctly.

Adobe
  • 1,859
  • 13
  • 27
2

I would highly recommend against editing linum.el. The huge disadvantage of doing that is that your changes will be lost every time the package gets updated. Also, that page you linked said you can achieve the same effect without editing linum.el by doing this:

(setq linum-format “%d “)
robru
  • 141
  • 4
  • This post does not actually answer the question that OP posed, although it does touch on a related point. It would probably be better as a comment. Please consider converting it. – Dan Jan 11 '15 at 12:09