5

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
11

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).

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.

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 “)
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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