-; -*-mode: Emacs-Lisp-*-
-;==============================================================================
-; Filename: init.el
-;
-; Copying:	Copyright (C) 2013 0xnz, All rights reserved.
-; Version:	0.2
-; Author:	0xnz <yunxinyi AT gmail DOT com>
-; Last-update:  2013-10-06 23:37
-;
-; Note:         This file is NOT part of GNU Emacs
-; Description:  0xnz's dot emacs file, fixing weird quirks and poor defaults
-; Use:          copy this file to ~/.emacs or ~/.emacs.d/init.el
-;______________________________________________________________________________
-;-------------save personal info------------
-(setq user-full-name "oxnz")
-(setq user-mail-address "yunxinyi@gmail.com")
-;-----------------path config---------------
-;Load_path{
+;; -*-mode: Emacs-Lisp-*-
+;;=============================================================================
+;; Filename: init.el
+;;
+;; Copying:	Copyright (C) 2012, 2013 Oxnz, All rights reserved.
+;; Version:	0.2
+;; Author:	0xnz <yunxinyi AT gmail DOT com>
+;; Last-updated: 2013-10-20 13:50:42 CST
+;;
+;; Note:         This file is NOT part of GNU Emacs
+;; Description:  0xnz's dot emacs file, fixing weird quirks and poor defaults
+;; Use:          copy this file to ~/.emacs or ~/.emacs.d/init.el
+;;_____________________________________________________________________________
+;; ------------Load_path------------
 (add-to-list 'load-path user-emacs-directory)
-;}
-;todo path{
-(setq todo-file-do "~/.emacs.d/todo/do")
-(setq todo-file-done "~/.emacs.d/todo/done")
-(setq todo-file-top "~/.emacs.d/todo/top")
-;}
-;(setq default-directory "/Users/oxnz/Developer/")
 
 ;--------------------version check---------------
 (cond

(global-set-key [?\A-n] 'new-frame)
;---------------------------mode----------------------------------------
; uncomment the following line to override the default scratch messsage
(setq initial-scratch-message (concat
";                  /)\n"
";                 //\n"
";   .------------| |---------------------------------------------.__\n"
";   |   OXNZ     | |>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>:>\n"
";   `------------| |----------------------------------------------'^^\n"
";                 \\\\\n"
";                  \\)\n"
	)
)

;-----------------shell mode---------------
;(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
;(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on t)

;--------------sh-mode-------------
(setq
 sh-indent-for-then 0
 sh-indent-for-do 0
 sh-indent-for-after-do '+
 sh-indent-for-case-label '*
 sh-indent-for-case-alt '+
 sh-indent-comment t)
;-------------------compile mode------------------
(add-hook 'java-mode-hook
          (lambda(); javac or ant
            (set (make-local-variable 'compile-command) (concat "javac " (buffer-name)))))
; safe locals
; we mark these as 'safe', so emacs22+ won't give us annoying warnings
(setq safe-local-variable-values
      (quote ((auto-recompile . t)
              (folding-mode . t)
              (outline-minor-mode . t)
              (sh-indent-comment . t)
              auto-recompile outline-minor-mode sh-indent-comment
              )
             )
      )

 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(abbrev-mode t t)
 '(auto-insert-directory "~/.emacs.d/insert/")
 '(auto-insert-mode t)
 '(auto-save-default t)
 '(auto-save-file-name-transforms (\` ((".*" (\, temporary-file-directory) t))))
 '(background-color "black")
 '(backup-by-copying t)
 '(backup-directory-alist (quote (("." . "~/.emacs.d/backups"))))
 '(before-save-hook (quote (copyright-update time-stamp)))
 '(c-echo-syntactic-information-p t)
 '(calendar-chinese-all-holidays-flag t)
 '(color-theme-is-global t)
 '(column-number-mode t)
 '(compile-command "make")
 '(copyright-names-regexp "")
 '(cursor-color "purple")
 '(custom-enabled-themes (quote (light-blue)))
 '(default-buffer-file-coding-system (quote utf-8) t)
 '(default-major-mode (quote text-mode) t)
 '(delete-by-moving-to-trash t)
 '(delete-old-versions t)
 '(dired-kept-versions 1)
 '(echo-keystrokes 0.5)
 '(electric-indent-mode t)
 '(file-name-coding-system (quote utf-8) t)
 '(font-lock-maximum-decoration t)
 '(foreground-color "white")
 '(history-delete-duplicates t)
 '(hs-minor-mode t)
 '(indent-tabs-mode t)
 '(inhibit-default-init t)
 '(inhibit-startup-screen t)
 '(keyboard-coding-system (quote utf-8))
 '(language-environment (quote utf-8))
 '(make-backup-file-name t)
 '(mouse-color "white")
 '(perl-tab-always-indent t)
 '(perl-tab-to-comment t)
 '(query-replace-highlight t)
 '(require-final-newline t)
 '(safe-local-variable-values (quote ((auto-recompile . t) (folding-mode . t) (outline-minor-mode . t) (sh-indent-comment . t) auto-recompile outline-minor-mode sh-indent-comment)))
 '(search-highlight t)
 '(sh-indent-comment t)
 '(sh-indent-for-after-do (quote +))
 '(sh-indent-for-case-alt (quote +))
 '(sh-indent-for-case-label (quote *))
 '(sh-indent-for-do 0)
 '(sh-indent-for-then 0)
 '(show-paren-delay 0)
 '(show-paren-mode t)
 '(show-paren-style (quote parentheses))
 '(tab-always-indent (quote complete))
 '(tab-width 4)
 '(tempo-insert-region t)
 '(tempo-interactive t)
 '(terminal-coding-system (quote utf-8))
 '(todo-file-do "~/.emacs.d/todo/do")
 '(todo-file-done "~/.emacs.d/todo/done")
 '(todo-file-top "~/.emacs.d/todo/top")
 '(track-eol t)
 '(transient-mark-mode t)
 '(trash-directory "~/.Trash")
 '(truncate-partial-width-windows nil)
 '(uniquify-buffer-name-style (quote forward))
 '(user-full-name "Oxnz")
 '(user-mail-address "yunxinyi@gmail.com")
 '(version-control t)
 '(whitespace-line-column 80)
 '(whitespace-style (quote (trailing lines space-before-tab indentation space-after-tab)))
 '(x-select-enable-clipboard t))

(setq
   initial-scratch-message
   (concat
    ";                  /)\n"
    ";                 //\n"
    ";   .------------| |---------------------------------------------.__\n"
    ";   |   OXNZ     | |>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>:>\n"
    ";   `------------| |----------------------------------------------'^^\n"
    ";                 \\\\\n"
    ";                  \\)\n"
    )
   )

;; (setq auto-insert-copyright (user-full-name))
(eval-after-load 'autoinsert
  '(define-auto-insert '(perl-mode . "Perl skeleton")
     '("Description: "
       "#!/usr/bin/env perl" \n
       \n
       "use strict;" \n
       "use warnings;" \n
       _ \n \n
       "__END__" "\n\n"
       "=head1 NAME" "\n\n"
       "=head1 SYNOPSIS" "\n\n"
       (file-name-nondirectory buffer-file-name) " [-h] [-v]" "\n\n"
       "=head1 OPTION" "\n\n"
       "=over 1" "\n\n"
       "=item B<-h|--help>" "\n"
       \n "Print this help message and exit successfully." "\n\n"
       "=item B<-v|--version>" "\n"
       \n "Print version information and exit successfully." "\n\n"
       "=back" "\n\n"
       "=head1 DESCRIPTION" "\n\n\n"
       "=head1 COPYRIGHT" "\n\n"
       "Copyright (c) " (substring (current-time-string) -4) " "
       (getenv "ORGANIZATION") | (progn user-full-name) "\n\n"
       "This library is free software; you can redistribute it and/or" "\n"
       "modify it under the same terms as Perl itself." "\n\n"
       "=cut" "\n")))
(setq time-stamp-active t
	  time-stamp-start "Last-updated: "
	  time-stamp-format "%04y-%02m-%02d %02H:%02M:%02S %Z"
      time-stamp-end "$"
	  )

;Shell 使用 ansi color{
;(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
;(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
;}
;---------------------------------------------------------------------


;------------------------------behavior---------------------------------
;;把这些缺省禁用的功能打开
(put 'set-goal-column 'disabled nil)
(put 'narrow-to-region 'disabled nil)
