* questions about the value of local variables
@ 2013-05-12 5:10 Hongxu Chen
0 siblings, 0 replies; 3+ messages in thread
From: Hongxu Chen @ 2013-05-12 5:10 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
I am using Emacs for some C/C++ coding.
One of the problem I am facing is that I need to specify some value of
Emacs variables in the .dir-locals.el file so that I can make the
programming environment much easier, one of which is
`ffap-c-path'. Since I also need the default value , I hope I can
append it rather that `setq'(like the default behavior of
`.dir-locals.el'). But I just cannot figure how. May be I need to use
`eval'?
Another problem is that the file local variables I set cannot take
effect before I type `M-x normal-mode', and for dir local variables it
seems that I need to kill all the buffers who is inside the
directory. So it there any easier way to do this?
Still another question, is there any good practice to set the
variables with proper hooks in c family programming language modes?
There seems quite a lot of hooks there
(`c-initialization-hook',`cc-mode-hook', `c-mode-hook',
`c-mode-common-hook', etc) and I just get lost.
--
Regards,
Hongxu Chen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: questions about the value of local variables
[not found] <mailman.25589.1368335429.855.help-gnu-emacs@gnu.org>
@ 2013-05-12 17:14 ` Alan Mackenzie
2013-05-13 16:36 ` Hongxu Chen
0 siblings, 1 reply; 3+ messages in thread
From: Alan Mackenzie @ 2013-05-12 17:14 UTC (permalink / raw)
To: help-gnu-emacs
Hongxu Chen <leftcopy.chx@gmail.com> wrote:
> Hi,
> I am using Emacs for some C/C++ coding.
[ .... ]
> Still another question, is there any good practice to set the
> variables with proper hooks in c family programming language modes?
> There seems quite a lot of hooks there
> (`c-initialization-hook',`cc-mode-hook', `c-mode-hook',
> `c-mode-common-hook', etc) and I just get lost.
>
Well, I don't think there's a `cc-mode-hook', but the others exist,
yes. :-)
Basic rule: put (the bulk of) your CC Mode customisations on
`c-mode-common-hook'. If this doesn't work, you'll need one of the other
hooks. It's all documented on page "CC Hooks" in the CC Mode manual.
> --
> Regards,
> Hongxu Chen
--
Alan Mackenzie (Nuremberg, Germany).
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: questions about the value of local variables
2013-05-12 17:14 ` questions about the value of local variables Alan Mackenzie
@ 2013-05-13 16:36 ` Hongxu Chen
0 siblings, 0 replies; 3+ messages in thread
From: Hongxu Chen @ 2013-05-13 16:36 UTC (permalink / raw)
To: Alan Mackenzie; +Cc: help-gnu-emacs
Alan Mackenzie <acm@muc.de> writes:
> Hongxu Chen <leftcopy.chx@gmail.com> wrote:
>
>> Hi,
>
>> I am using Emacs for some C/C++ coding.
>
> [ .... ]
>
>> Still another question, is there any good practice to set the
>> variables with proper hooks in c family programming language modes?
>> There seems quite a lot of hooks there
>> (`c-initialization-hook',`cc-mode-hook', `c-mode-hook',
>> `c-mode-common-hook', etc) and I just get lost.
>>
>
> Well, I don't think there's a `cc-mode-hook', but the others exist,
> yes. :-)
Sorry that I made a mistake.
>
> Basic rule: put (the bulk of) your CC Mode customisations on
> `c-mode-common-hook'. If this doesn't work, you'll need one of the other
> hooks. It's all documented on page "CC Hooks" in the CC Mode manual.
Thanks for your advice. It seems that using the right hook really needs
quite a lot of tricks. A few days ago I was adding a keymap for one of
the command, but it didn't work until I use the
`c-initialization-hook'. Well, seems that I have to read the docs
first.
>
>> --
>> Regards,
>> Hongxu Chen
--
Regards,
Hongxu Chen
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-13 16:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.25589.1368335429.855.help-gnu-emacs@gnu.org>
2013-05-12 17:14 ` questions about the value of local variables Alan Mackenzie
2013-05-13 16:36 ` Hongxu Chen
2013-05-12 5:10 Hongxu Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).