[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Emacs supporting GNU style for Classpath hacking
From: |
Roman Kennke |
Subject: |
Emacs supporting GNU style for Classpath hacking |
Date: |
Tue, 06 Jul 2004 10:45:50 +0200 |
Hi list,
Together with Michael I have put together an emacs configuration hook,
which enables GNU style auto-completion in Emacs with JDEE.
In order to make this work, you have to have JDEE installed:
http://jdee.sunsite.sk
XEmacs includes JDEE by default.
include the following snipped directly in ~/.emacs or ~/.xemacs/init.el
or load it from an external file with something like this inside
~/.emacs or ~/.xemacs/init.el:
(load "~/.xemacs/javagnustyle.el")
With this configuration, emacs automatically expands abbreviations. If
you type 'ife ' this will be expanded to:
if ()
{
}
else
{
}
Please see
http://jdee.sunsite.dk/jdedoc/html/jde-ug/jde-ug-content.html#Abbrevs
for details on more abbreviations
If this works out right, maybe we should include this in the GNU
Classpath hackers guide.
Cheers, Roman
;;; =============================================
;;; GNU style auto-completion for JDEE and Emacs
;;; =============================================
(defconst my-style
; newline BEFORE braces
'((c-hanging-braces-alist '((block-open before after)
(brace-list-open)))
;; TAB inserts 2 spaces
(c-basic-offset . 2)
)
)
(defun my-jde-mode-hook ()
; auto-newline mode on
(setq c-auto-newline t)
; indent spaces instead of tabs
(setq-default indent-tabs-mode nil)
; GNU style braces placement in templates
(setq-default jde-gen-k&r nil)
; supress generate comments
(setq-default jde-gen-comments nil)
; enable abbreviation mode
(jde-abbrev-mode)
(c-add-style "user" my-style t)
(c-set-style "user")
)
(add-hook 'jde-mode-hook 'my-jde-mode-hook)
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
- Emacs supporting GNU style for Classpath hacking,
Roman Kennke <=