help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

File-specific cc-mode settings


From: Alexander Kotelnikov
Subject: File-specific cc-mode settings
Date: Wed, 22 Aug 2007 23:37:23 +0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Hello.

I have cc-mode configuration which suits my needs, but for certain
files I'd like to get specific settings. So what I tried was putting

/*
Local Variables:
mode:c
c-style-java: t
End:
*/

in the end of such file and

(setq c-style-java nil)
(setq safe-local-variable-values '((c-style-java . t)) )

(add-hook 'c-mode-hook 
          '(lambda () 
             (if c-style-java
                 (progn
                   (c-set-style "java")
                   (message "java")
                   )
               (message "not java")
               )
             )
          )
to ~/.emacs

But is does not help (I think, due to c-style-java is buffer local and
c-mode-hook is processed in another context, I see "not java" in
*Messages* buffer).

Is there a way to achieve the result I want?

Thanks,

-- 
Alexander Kotelnikov
Saint-Petersburg, Russia





reply via email to

[Prev in Thread] Current Thread [Next in Thread]