Emacs lisp source code for
Files in the
It depends a bit on what distribution you use. On a debian style system you could do something like this:
$ dpkg -S `which cat` coreutils: /bin/cat $ apt-get source coreutils
The last command will fetch the source archive and all the patches which were used to build the binary package that includes the cat command.
Alternatively you could just google for it. Or use even google code search.
For Emacs however, there is a special packet called emacs23-el under Ubuntu which includes all el-files of Emacs and installs them alongside the elc-Files. This has the advantage, that you can directly look at function and variable definitions from Emacs. Say you want to look at how the function string-insert-rectangle is defined. You hit C-h f string-insert-rectangle and a Help buffer appears with documentation, telling that it is defined in rect.el. If you click on rect.el Emacs automatically shows the function definition.
For RPM-based distributions you can ask "rpm -qi <somepackage>", or even "rpm -qi <somefile>" if you don't know the original package. It will tell you what the source RPM is, and the home page for the source. On Fedora (and other distributions using yum) you can then get the source package using yumdownloader, e.g. "yumdownloader --source <package>" will fetch it for you. The rpm(1) command will then allow you to unpack the source (the source RPM package contains the upstream source, assorted patches, configuration files, and a spec file that directs the building and installing of the result).
This comes handy if you need to install a package with some kind of local modifications (perhaps just to check out the next upstream version).