Problem with add hook comments
Posted: Sun Mar 15, 2015 3:36 am
Hi all,
Wonder if you could help me. I am running Emacs on Mac OSX and I am a newbe trying to set up my environment and learn a little lisp along the way. I have been trying to get emacs to turn on line numbering when in C/C++ mode amongst other things, but every time I try to use anything more complex than a one line thing, it doesn't seem to work. Here is the code I found (I still have to scrounge code at the moment to learn).
Firstly is the syntax here correct? it looks right judging by the amount of lisp I have looked at over the past few days to solve this problem.
And is there something obvious that I might be missing? e.g. .emacs file in wrong location or some sort of header line needed in .emacs file. I can post full .emacs file so far if it helps it's only 10 odd lines but got told off in a different forum for doing that so please let me know what is required to help me move on from this little block please.
Kind regards
Rob
Wonder if you could help me. I am running Emacs on Mac OSX and I am a newbe trying to set up my environment and learn a little lisp along the way. I have been trying to get emacs to turn on line numbering when in C/C++ mode amongst other things, but every time I try to use anything more complex than a one line thing, it doesn't seem to work. Here is the code I found (I still have to scrounge code at the moment to learn).
Code: Select all
(defun my-c-mode-common-hook ()
(line-number-mode 1))
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
And is there something obvious that I might be missing? e.g. .emacs file in wrong location or some sort of header line needed in .emacs file. I can post full .emacs file so far if it helps it's only 10 odd lines but got told off in a different forum for doing that so please let me know what is required to help me move on from this little block please.
Kind regards
Rob