* c-set-style question
@ 2006-09-13 15:04 jronald
2006-09-13 16:47 ` David Hansen
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: jronald @ 2006-09-13 15:04 UTC (permalink / raw)
Which variable does this function change? Is there?
There is another a variable called c-default-style, which isn't changed by
the function.What is the effect of it.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c-set-style question
2006-09-13 15:04 c-set-style question jronald
@ 2006-09-13 16:47 ` David Hansen
2006-09-13 17:04 ` robert.thorpe
2006-09-13 20:31 ` what confuse me is jronald
2 siblings, 0 replies; 6+ messages in thread
From: David Hansen @ 2006-09-13 16:47 UTC (permalink / raw)
On Wed, 13 Sep 2006 23:04:11 +0800 jronald wrote:
> Which variable does this function change? Is there?
I would suspect a lot of buffer local variables that control
indentation.
> There is another a variable called c-default-style, which isn't changed by
> the function.What is the effect of it.
C-h v c-default-style RET
will tell you.
If you just want to customize the indentation of C code you
should ask a bit more specific questions (and btw. CC mode
comes with a pretty good manual that describes it's
indentation very detailed).
David
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c-set-style question
2006-09-13 15:04 c-set-style question jronald
2006-09-13 16:47 ` David Hansen
@ 2006-09-13 17:04 ` robert.thorpe
2006-09-13 20:31 ` what confuse me is jronald
2 siblings, 0 replies; 6+ messages in thread
From: robert.thorpe @ 2006-09-13 17:04 UTC (permalink / raw)
jronald wrote:
> Which variable does this function change? Is there?
>
> There is another a variable called c-default-style, which isn't changed by
> the function.What is the effect of it.
It's in the docs type C-h v c-default-style
c-default-style is an alist determining the style to be used by all
C-like languages. It is used before mode-specific hooks are run. Then
once in CC mode c-set-style can be used to change the mode on the fly.
So, c-default-style is most useful for writing you .emacs files,
c-set-style is most useful to change the style during editing. You
could use c-set-style to change the style in a hook if you liked though.
^ permalink raw reply [flat|nested] 6+ messages in thread
* what confuse me is ...
2006-09-13 15:04 c-set-style question jronald
2006-09-13 16:47 ` David Hansen
2006-09-13 17:04 ` robert.thorpe
@ 2006-09-13 20:31 ` jronald
2006-09-14 15:21 ` robert.thorpe
2 siblings, 1 reply; 6+ messages in thread
From: jronald @ 2006-09-13 20:31 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 406 bytes --]
By consulting c-default-style in emacs's doc,
it says:
c-default-style's value is
((java-mode . "java")
(other . "gnu"))
but I'm editing a .cpp file.
"jronald" <followait@163.com> дÈëÏûÏ¢ÐÂÎÅ:ee96lh$5t9$1@news.yaako.com...
> Which variable does this function change? Is there?
>
> There is another a variable called c-default-style, which isn't changed by
> the function.What is the effect of it.
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: what confuse me is ...
2006-09-13 20:31 ` what confuse me is jronald
@ 2006-09-14 15:21 ` robert.thorpe
2006-09-14 18:31 ` Helpful, thans jronald
0 siblings, 1 reply; 6+ messages in thread
From: robert.thorpe @ 2006-09-14 15:21 UTC (permalink / raw)
jronald wrote:
> By consulting c-default-style in emacs's doc,
> it says:
>
> c-default-style's value is
> ((java-mode . "java")
> (other . "gnu"))
>
> but I'm editing a .cpp file.
c-default-style is a CC mode variable. CC mode deals with all
langauges that are similar to C, such as Java, C++, C, and lots of
other obscure langs. When you see "c-mode" in a buffer it means that
you're using a C mode that is internally part of CC-mode.
As a result this variable can have values for every one of these
programming languages. For example, you can do:-
(setq c-default-style "k&r") ;; Use kernigham & ritchie style for
everything
or specifying different styles for each mode that CC-mode controls..
(setq c-default-style '((java-mode . "java") (c-mode . "gnu") (other .
"whitesmith")))
I think the name is rather confusing, it probably should be changed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Helpful, thans.
2006-09-14 15:21 ` robert.thorpe
@ 2006-09-14 18:31 ` jronald
0 siblings, 0 replies; 6+ messages in thread
From: jronald @ 2006-09-14 18:31 UTC (permalink / raw)
<robert.thorpe@antenova.com>
??????:1158247308.610920.315590@e3g2000cwe.googlegroups.com...
> jronald wrote:
>> By consulting c-default-style in emacs's doc,
>> it says:
>>
>> c-default-style's value is
>> ((java-mode . "java")
>> (other . "gnu"))
>>
>> but I'm editing a .cpp file.
>
> c-default-style is a CC mode variable. CC mode deals with all
> langauges that are similar to C, such as Java, C++, C, and lots of
> other obscure langs. When you see "c-mode" in a buffer it means that
> you're using a C mode that is internally part of CC-mode.
>
> As a result this variable can have values for every one of these
> programming languages. For example, you can do:-
>
> (setq c-default-style "k&r") ;; Use kernigham & ritchie style for
> everything
> or specifying different styles for each mode that CC-mode controls..
> (setq c-default-style '((java-mode . "java") (c-mode . "gnu") (other .
> "whitesmith")))
>
> I think the name is rather confusing, it probably should be changed.
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-09-14 18:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-13 15:04 c-set-style question jronald
2006-09-13 16:47 ` David Hansen
2006-09-13 17:04 ` robert.thorpe
2006-09-13 20:31 ` what confuse me is jronald
2006-09-14 15:21 ` robert.thorpe
2006-09-14 18:31 ` Helpful, thans jronald
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).