From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Dziulko Newsgroups: gmane.emacs.help Subject: java mode won't play nice Date: Wed, 28 May 2003 08:27:26 -0400 (EDT) Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1054124889 6610 80.91.224.249 (28 May 2003 12:28:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 28 May 2003 12:28:09 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed May 28 14:28:08 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19L01X-0001ei-00 for ; Wed, 28 May 2003 14:27:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19L02a-0002GW-Ri for gnu-help-gnu-emacs@m.gmane.org; Wed, 28 May 2003 08:28:24 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19L024-0001cP-Cn for help-gnu-emacs@gnu.org; Wed, 28 May 2003 08:27:52 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19L01o-00019x-Oa for help-gnu-emacs@gnu.org; Wed, 28 May 2003 08:27:39 -0400 Original-Received: from klaatu.canisius.edu ([138.92.8.100]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19L01f-0000ks-Fb for help-gnu-emacs@gnu.org; Wed, 28 May 2003 08:27:27 -0400 Original-Received: from localhost (dziulko@localhost) by klaatu.canisius.edu (8.11.6/8.11.6) with ESMTP id h4SCRQD15008 for ; Wed, 28 May 2003 08:27:26 -0400 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10278 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10278 Hello I am trying to get java mode to indent and behave just like how I have c-mode set up. I have not been able to find anything helpful on the web. I did read that "`java-mode' sets the style ... of the buffer to `java' *before* running the `c-mode-common-hook' or `java-mode-hook'". Any suggestions? Below is my c-mode stuff from my .emacs file. (defconst my-c-style '((c-tab-always-indent . t) (c-comment-only-line-offset . 0) (c-hanging-braces-alist . ((substatement-open after) (brace-list-open) (brace-list-close))) (c-hanging-colons-alist . ((member-init-intro before) (inher-intro) (case-label after) (label after) (access-label after))) (c-cleanup-list . (scope-operator empty-defun-braces defun-close-semi)) (c-offsets-alist . ((arglist-close . c-lineup-arglist) (substatement-open . 0) (case-label . 4) (block-open . 0) (knr-argdecl-intro . -))) ;;(c-echo-syntactic-information-p . t) ) "My C Programming Style") ;; Customizations for all of c-mode, c++-mode, and objc-mode (defun my-c-mode-common-hook () ;; add my personal style and set it for the current buffer (c-add-style "PERSONAL" my-c-style t) ;; offset customizations not in my-c-style (c-set-offset 'member-init-intro '++) ;; other customizations (setq ps-line-number 'member-init-intro) (setq tab-width 8 ;; this will make sure spaces are used instead of tabs indent-tabs-mode nil) ;; we like auto-newline and hungry-delete (c-toggle-auto-hungry-state 1) ;; keybindings for all supported languages. We can put these in ;; c-mode-base-map because c-mode-map, c++-mode-map, objc-mode-map, ;; java-mode-map, and idl-mode-map inherit from it. (define-key c-mode-base-map "\C-m" 'newline-and-indent) (define-key c-mode-base-map "\C-xc" 'kill-comment) ) (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)