all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* File-specific cc-mode settings
@ 2007-08-22 19:37 Alexander Kotelnikov
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Kotelnikov @ 2007-08-22 19:37 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 2+ messages in thread
[parent not found: <mailman.5135.1187812509.32220.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2007-08-23  8:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-22 19:37 File-specific cc-mode settings Alexander Kotelnikov
     [not found] <mailman.5135.1187812509.32220.help-gnu-emacs@gnu.org>
2007-08-23  8:24 ` Johan Bockgård

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.