From: Alexander Kotelnikov <sacha@myxomop.com>
To: help-gnu-emacs@gnu.org
Subject: File-specific cc-mode settings
Date: Wed, 22 Aug 2007 23:37:23 +0400 [thread overview]
Message-ID: <87y7g3qs24.fsf@myxomop.com> (raw)
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
next reply other threads:[~2007-08-22 19:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-22 19:37 Alexander Kotelnikov [this message]
[not found] <mailman.5135.1187812509.32220.help-gnu-emacs@gnu.org>
2007-08-23 8:24 ` File-specific cc-mode settings Johan Bockgård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y7g3qs24.fsf@myxomop.com \
--to=sacha@myxomop.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).