unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* c++-mode vs. c-mode
@ 2005-08-09 13:14 Rancier, Jeff
  2005-08-09 13:47 ` J. David Boyd
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rancier, Jeff @ 2005-08-09 13:14 UTC (permalink / raw)


Is there a simple way to have c++-mode behave (or inherit) my customizations
for c-mode?

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

* Re: c++-mode vs. c-mode
  2005-08-09 13:14 c++-mode vs. c-mode Rancier, Jeff
@ 2005-08-09 13:47 ` J. David Boyd
  2005-08-09 16:42 ` Kevin Rodgers
  2005-08-09 18:12 ` Eli Zaretskii
  2 siblings, 0 replies; 4+ messages in thread
From: J. David Boyd @ 2005-08-09 13:47 UTC (permalink / raw)


"Rancier, Jeff" <Jeff.Rancier@Sensis.com> writes:

> Is there a simple way to have c++-mode behave (or inherit) my customizations
> for c-mode?


If you really mean that you don't care about c++-mode per-se, but would be
happy with working on c++ code in c-mode, one way would be to add a construct
into your .emacs like this:

(setq auto-mode-alist
      (append '(("\\.C$"  . c-mode)
                ("\\.cc$" . c-mode)
                ("\\.hh$" . c-mode)
                ("\\.c$"  . c-mode)
                ("\\.h$"  . c-mode))
              auto-mode-alist))


to force c++ code to be edited in c-mode.


Dave in Largo, FL

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

* Re: c++-mode vs. c-mode
  2005-08-09 13:14 c++-mode vs. c-mode Rancier, Jeff
  2005-08-09 13:47 ` J. David Boyd
@ 2005-08-09 16:42 ` Kevin Rodgers
  2005-08-09 18:12 ` Eli Zaretskii
  2 siblings, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2005-08-09 16:42 UTC (permalink / raw)


Rancier, Jeff wrote:
> Is there a simple way to have c++-mode behave (or inherit) my customizations
> for c-mode?

Put your customizations in a c-mode-common-hook function, or if you
don't want those customizations affecting Objective-C, Java, etc.
buffers: (add-hook 'c++-mode-hook (lambda () (run-hooks 'c-mode-hook)))

-- 
Kevin Rodgers

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

* Re: c++-mode vs. c-mode
  2005-08-09 13:14 c++-mode vs. c-mode Rancier, Jeff
  2005-08-09 13:47 ` J. David Boyd
  2005-08-09 16:42 ` Kevin Rodgers
@ 2005-08-09 18:12 ` Eli Zaretskii
  2 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2005-08-09 18:12 UTC (permalink / raw)


> From: "Rancier, Jeff" <Jeff.Rancier@Sensis.com>
> Date: Tue, 9 Aug 2005 09:14:37 -0400 
> 
> Is there a simple way to have c++-mode behave (or inherit) my customizations
> for c-mode?

What customizations are those, and how did you set things up to
activate them?

If you activate them from c++-mode-hook, one solution is to activate
them from c-mode-common-hook instead.

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

end of thread, other threads:[~2005-08-09 18:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-09 13:14 c++-mode vs. c-mode Rancier, Jeff
2005-08-09 13:47 ` J. David Boyd
2005-08-09 16:42 ` Kevin Rodgers
2005-08-09 18:12 ` Eli Zaretskii

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).