(defun my-c++-mode-hook()
(c-set-style "stroustrup")
(setq tab-width 4
;; 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))
;(local-set-key [return] 'newline-and-indent)
; (define-key c-mode-base-map "\C-m" 'c-context-line-break)
(add-hook 'c++-mode-hook 'my-c++-mode-hook)
(add-hook 'c-mode-hook 'my-c++-mode-hook)
;;End c++ mode--}}}}}
;;{{{{{------------------------------------------------------Html mode
;;what you see is what you get text edit stype
(autoload 'table-insert "table" "WYGIWYS table editor")
;;generate html file in buffer
(require 'htmlize)
;;End Html mode--}}}}}
;;{{{{{-------------------------------------------------------SQL mode
(add-to-list 'same-window-buffer-names "*SQL*")
(require 'sql)
(custom-set-variables
;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
;; Your init file should contain only one such instance.
'(align-region-separate (quote entire))
'(case-fold-search t)
'(change-log-default-name "LOG")
'(compile-auto-highlight t)
'(current-language-environment "Chinese-GBK")
'(default-input-method "chinese-py")
'(global-font-lock-mode t nil (font-lock))
'(next-line-add-newlines t)
'(show-paren-mode t nil (paren))
'(sql-server "localhost")
'(tabbar-separator (quote ("")))
'(transient-mark-mode t))
;(defalias 'sql-get-login 'ignore)
;;End SQL mode--}}}}}
(add-hook 'perl-mode-hook
(lambda ()
(message "Setting up my perl hooks")
;;(setq tab-width 4)
;;(auto-fill-mode t)
(local-set-key [return] 'newline-and-indent)
;;(auto-load-tags-file)
(hs-minor-mode t)
))
(add-hook 'lisp-mode-hook
(lambda ()
(message "Setting up my lisp hooks")
;;(setq tab-width 4)
(auto-fill-mode t)
(local-set-key [return] 'newline-and-indent)
;;(auto-load-tags-file)
(hs-minor-mode t)
))
;;===================================misc=====================================
(add-to-list 'load-path "/usr/share/emacs/site-lisp/emms/")
(require 'emms)
(require 'emms-default)
(emms-setup 'tiny "~/mp3/");"directory-1" "directory 2" ...)
(require 'emms-player-simple)
(require 'emms-source-file)
(setq emms-player-list '(emms-player-mplayer
; emms-player-ogg123
; emms-player-mpg321
)
emms-source-list '((emms-directory-tree "~/mp3/")))
;; Show the current track each time EMMS
;; starts to play a track with "NP : "
(add-hook 'emms-player-started-hook 'emms-show)
(setq emms-show-format "Now Play: %s")
(setq emms-repeat-playlist t)
;; When asked for emms-play-directory,
;; always start from this one
(setq emms-source-file-default-directory "~/mp3/")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;Never byte-compile your .emacs file by hand again
(defun autocompile nil
"compile itself if ~/.emacs"
(interactive)
(require 'bytecomp)
(if (string= (buffer-file-name) (expand-file-name (concat default-directory ".emacs")))
(byte-compile-file (buffer-file-name))))