line-number-mode and
linum-mode are two completely different things.
line-number-mode switches the display of line and column numbers in the mode line, while
linum-mode displays line numbers at the left margin.
linum-mode significantly slows down Emacs when editing big files.
Try
M-x line-number-mode to see if the display of line and column numbers in the Emacs mode line changes between "C
n", where
n ist the column number, and "(
n,
m)", where
n ist the column and
m ist the line number.
Rob_K wrote:... every time I try to use anything more complex than a one line thing, it doesn't seem to work ...
I'm sorry but you need to describe
what exactly doesn't work or what you think should have happened. From the description in the first post above I really don't have the slightest clue what your problem is at all.
I can tell you that with Emacs 24.4.1 on Debian Linux the following line in my .emacs file:
as well as
M-x line-number-mode while Emacs is running, both switch the display of line and column numbers in the mode line as described above.
Rob_K wrote:... is the syntax here correct?
I can see no syntax mistakes, but I'm using Emacs for Lisp and not for C programming, so I can't tell you if
c-mode-common-hook is the right hook for switching the display of line and column numbers in Emacs c-mode.
Rob_K wrote:... is there something obvious that I might be missing? e.g. .emacs file in wrong location ...
Since you haven't written where you have stored your .emacs file I can't tell you if it's the right or wrong location. Also I'm on Linux and not on a Mac, so I don't know where Emacs is looking for the .emacs file on a Mac. I think that Emacs should automatically find the .emacs file if the file is stored in the $HOME directory of the underlying BSD Unix.
If you look in the Emacs *messages* buffer right after you started Emacs, there should be messages what files Emacs has loaded at startup.
Or add a line like this to your .emacs file:
Then look in the *messages* buffer after you started Emacs to see if your "Hello Emacs!" message was printed there.
Rob_K wrote:... or some sort of header line needed in .emacs file?
There is no special header line needed in an .emacs file.
Ask Google for a PDF copy of Bob Glickstein's book "Writing GNU Emacs Extensions", it's the best book I know about Emacs customisation.
- edgar