From: exits funnel <exitsfunnel@yahoo.com>
Subject: Trouble with cc-mode style
Date: Tue, 2 Mar 2004 14:14:41 -0800 (PST) [thread overview]
Message-ID: <20040302221441.74392.qmail@web40513.mail.yahoo.com> (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 youre looking for faster
http://search.yahoo.com
next reply other threads:[~2004-03-02 22:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-02 22:14 exits funnel [this message]
[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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040302221441.74392.qmail@web40513.mail.yahoo.com \
--to=exitsfunnel@yahoo.com \
/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.
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.