all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Trouble with cc-mode style
@ 2004-03-02 22:14 exits funnel
  0 siblings, 0 replies; 4+ messages in thread
From: exits funnel @ 2004-03-02 22:14 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 3109 bytes --]

Hello,

I've recently bugun using Emacs to edit C++.  A couple
of weeks ago, I added the following to my .emacs:

;; BEGIN OLD STUFF
 (defun ef-cish-setup ( )
   (message "exit: In ef-cish-setup( )")
   (setq c-basic-offset 2)
   (setq c-default-style "bsd"))

 (add-hook 'c-mode-hook 'ef-cish-setup)
 (add-hook 'c++-mode-hook 'ef-cish-setup)
 (add-hook 'java-mode-hook 'ef-cish-setup)


 (require 'cc-mode)
 (c-set-offset 'substatement-open 0)
 (c-set-offset 'block-open 0)
 (c-set-offset 'statement-cont 0)
 (c-set-offset 'access-label '*)
 (c-set-offset 'inclass '+)
 (c-set-offset 'topmost-intro '+)
 (c-set-offset 'inline-open '+)
;; END OLD STUFF

It worked pretty well but now I've decided I'd like to
create an explicit style because, well, why not. 
Here's what my .emacs looks like now:

;; BEGIN NEW STUFF
(require 'cc-mode)     
(defconst exits-c++-style
 '(
    (c-offsets-alist . (
                         (substatement-open . 0)
                         (block-open        . 0)
                         (statement-cont    . 0)
                         (access-label      . '*)
                         (inclass           . '+)
                         (topmost-intro     . '+)
                         (inline-open       . '+)
                       )
    )
    (c-echo-syntactic-information-p . t)
  )
  "exit's C++ Programming Style Comment"
)

(defun exits-c-mode-common-hook ()
  (message "In exits-c-mode-common-hook")
  (c-add-style "exits-c++-style" exits-c++-style t)
  (global-set-key "\C-ci" 'c-indent-line-or-region)  
)
    
(add-hook 'c-mode-common-hook
'exits-c-mode-common-hook)

;;C++ Hook
(defun ef-c++-setup ( )
  (message "exit: In ef-c++-setup( )")
  (c-set-style exits-c++-style)
)
(add-hook 'c++-mode-hook 'ef-c++-setup)
;; END NEW STUFF

I've been playing with this stuff all day but I can't
seem to get it working.  When I start emacs and visit
a C++ file I get an error in the mini buffer which
complains about: 'wrong-type-argument
char-or-string-p' I'd paste the whole message but I
can't figure out how to get the stuff out of the
mini-buffer.   I've read most or all of the cc-mode
info but I still have a number of questions.

1) What's wrong with my style that causes the
wrong-type-argument error?
2) Is there any further documentation anywhere on
creating styles?  The cc-mode info stuff documents how
styles interact with cc-mode and gives an example
style but doesn't seem to really cover creating a
style explicitly
3) How can I make my style 'inherit' from the 'bsd'
style.  I seem to recall reading that one could do
this but I can't figure out how to do it?
4) This is completely off-topic to the rest of the
mail but what the heck: what can add to my .emacs file
to force emacs to maximize immediatly after it's
started?  I googled a bit and oddly found several
references to how to do it on w32 but came up empty
with respect to Linux.  

Thanks in advance for any replies and I apologize for
being so long-windeed.

-exits


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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

end of thread, other threads:[~2004-03-13 16:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1007.1078303437.340.help-gnu-emacs@gnu.org>
2004-03-03 19:44 ` Trouble with cc-mode style Alan Mackenzie
2004-03-13 16:42   ` exits funnel
2004-03-03 20:35 ` Alan Mackenzie
2004-03-02 22:14 exits funnel

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.