all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* c-default-style
@ 2018-09-24 12:37 Mick Bert
  2018-09-24 13:40 ` c-default-style Eli Zaretskii
  2018-09-24 13:47 ` c-default-style Noam Postavsky
  0 siblings, 2 replies; 4+ messages in thread
From: Mick Bert @ 2018-09-24 12:37 UTC (permalink / raw)
  To: help-gnu-emacs

With an old verion of emacs, I used to set default indenting behavior by
inserting in my ~/.emacs file:

(setq c-default-style '((c-mode . "stroustrup")))
(setq c-default-style '((c++-mode . "stroustrup")))
(setq c-default-style '((objc-mode . "stroustrup")))

The new version inherited the configuration file, but I have to set each
time I visited a file the indenting behavior with command "c-set-style".
What's changed in the last two major versions? How should I do it now?
--
Mick


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c-default-style
  2018-09-24 12:37 c-default-style Mick Bert
@ 2018-09-24 13:40 ` Eli Zaretskii
  2018-09-24 13:47 ` c-default-style Noam Postavsky
  1 sibling, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2018-09-24 13:40 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Mick Bert <micbert75@gmail.com>
> Date: Mon, 24 Sep 2018 14:37:04 +0200
> 
> With an old verion of emacs, I used to set default indenting behavior by
> inserting in my ~/.emacs file:
> 
> (setq c-default-style '((c-mode . "stroustrup")))
> (setq c-default-style '((c++-mode . "stroustrup")))
> (setq c-default-style '((objc-mode . "stroustrup")))
> 
> The new version inherited the configuration file, but I have to set each
> time I visited a file the indenting behavior with command "c-set-style".
> What's changed in the last two major versions? How should I do it now?

I don't know what changed, but you should be able to fix your problem
by adding a call to c-set-style to your c-mode-common-hook.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c-default-style
  2018-09-24 12:37 c-default-style Mick Bert
  2018-09-24 13:40 ` c-default-style Eli Zaretskii
@ 2018-09-24 13:47 ` Noam Postavsky
  2018-09-24 14:13   ` c-default-style Mick Bert
  1 sibling, 1 reply; 4+ messages in thread
From: Noam Postavsky @ 2018-09-24 13:47 UTC (permalink / raw)
  To: micbert75; +Cc: Help Gnu Emacs mailing list

On Mon, 24 Sep 2018 at 08:37, Mick Bert <micbert75@gmail.com> wrote:
>
> With an old verion of emacs, I used to set default indenting behavior by
> inserting in my ~/.emacs file:
>
> (setq c-default-style '((c-mode . "stroustrup")))
> (setq c-default-style '((c++-mode . "stroustrup")))
> (setq c-default-style '((objc-mode . "stroustrup")))

It looks like you're throwing away your c-mode and c++-mode settings.
I think you want something more like this:

(setq c-default-style '((c-mode . "stroustrup")
                        (c++-mode . "stroustrup")
                        (objc-mode . "stroustrup")))



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c-default-style
  2018-09-24 13:47 ` c-default-style Noam Postavsky
@ 2018-09-24 14:13   ` Mick Bert
  0 siblings, 0 replies; 4+ messages in thread
From: Mick Bert @ 2018-09-24 14:13 UTC (permalink / raw)
  To: help-gnu-emacs

Il giorno lun 24 set 2018 alle ore 15:48 Noam Postavsky <npostavs@gmail.com>
ha scritto:

> On Mon, 24 Sep 2018 at 08:37, Mick Bert <micbert75@gmail.com> wrote:
> >
> > With an old verion of emacs, I used to set default indenting behavior by
> > inserting in my ~/.emacs file:
> >
> > (setq c-default-style '((c-mode . "stroustrup")))
> > (setq c-default-style '((c++-mode . "stroustrup")))
> > (setq c-default-style '((objc-mode . "stroustrup")))
>
> It looks like you're throwing away your c-mode and c++-mode settings.
> I think you want something more like this:
>
> (setq c-default-style '((c-mode . "stroustrup")
>                         (c++-mode . "stroustrup")
>                         (objc-mode . "stroustrup")))
>

Looks reasonable! You are right!
It's strange it did work before (if it really was so). Maybe I copied them
wrongly from one host to the other...
--
Mick


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-24 14:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-24 12:37 c-default-style Mick Bert
2018-09-24 13:40 ` c-default-style Eli Zaretskii
2018-09-24 13:47 ` c-default-style Noam Postavsky
2018-09-24 14:13   ` c-default-style Mick Bert

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.