339 :
331:
.xyzzyにこんな感じで書いてみてください。
長すぎると怒られるので2分割です。
---- part1 ----
;;; css-enhance
; library
(load-library "css-mode")
; indent (お好みでどうぞ)
(defvar *css-indent-level* 4)
(defvar *css-continued-statement-offset* 4)
(defvar *css-brace-offset* -4)
(defvar *css-brace-imaginary-offset* 0)
(defvar *css-argdecl-indent* 0)
(defvar *css-label-offset* 0)
; keymap (お好みでどうぞ)
(define-key *css-mode-map* #\{ 'c-electric-insert)
(define-key *css-mode-map* #\: 'c-electric-insert)
(define-key *css-mode-map* #\} 'c-electric-close)
(define-key *css-mode-map* #\C-h 'backward-delete-char-untabify-or-selection)
(define-key *css-mode-map* #\TAB 'c-indent-line)
(define-key *css-mode-map* #\C-M-q 'indent-sexp)
(define-key *css-mode-map* #\RET 'c-newline-and-indent)
340 :
331:02/11/09 10:09 ID:???
---- part2 ----
; function for hook
(defun css-enhance ()
;; inent command
(make-local-variable 'mode-specific-indent-command)
(make-local-variable 'c-comment-indent-variable)
(setq c-comment-indent-variable 'c-comment-indent)
(setq mode-specific-indent-command 'c-indent-line)
; indent
(make-local-variable 'c-indent-level)
(make-local-variable 'c-continued-statement-offset)
(make-local-variable 'c-brace-offset)
(make-local-variable 'c-brace-imaginary-offset)
(make-local-variable 'c-argdecl-indent)
(make-local-variable 'c-label-offset)
(setq c-indent-level *css-indent-level*)
(setq c-continued-statement-offset *css-continued-statement-offset*)
(setq c-brace-offset *css-brace-offset*)
(setq c-brace-imaginary-offset *css-brace-imaginary-offset*)
(setq c-argdecl-indent *css-argdecl-indent*)
(setq c-label-offset *css-label-offset*)
; comment
(setq comment-indent-function 'c-comment-indent)
(setq comment-start "/* " comment-end " */")
(setq comment-start-skip "/\\(\\*+\\|/\\)[ \t]*"))
; hook
(add-hook '*css-mode-hook* 'css-enhance)