 (setq display-time-use-mail-icon t)
 (setq display-time-interval 10)
 ;}
+;在模式栏中显示当前光标所在函数
+;(which-function-mode)
 
 ;-----------------echo-area-----------------
 

 kept-old-versions 2
 version-control t)

;----------------------encoding---------------------
(set-language-environment 'UTF-8)
(set-buffer-file-coding-system 'utf-8)

;))
;(add-hook hook (lambda () (linum-mode 1))))

;------------------------programming related----------------------
;打开代码折叠功能
(add-hook 'c-mode-hook' 'hs-minor-mode)
(add-hook 'c++-mode-hook 'hs-minor-mode)
;------------------------auto complete------------------------
;(require 'auto-complete)
;(global-auto-complete-mode t)
;;auto-complete
;(add-to-list 'load-path "~/.emacs.d/plugins/auto-complete")
;(require 'auto-complete-config)
;(add-to-list 'ac-dictionary-directories "~/.emacs.d/plugins/auto-complete/ac-dict")
;(ac-config-default)


;---------------------------action--------------------------
; auto-indent yanked (pasted) code
(dolist (command '(yank yank-pop))
 (eval `(defadvice ,command (after indent-region activate)
	(and (not current-prefix-arg)
		(member major-mode '(emacs-lisp-mode lisp-mode clojure-mode
			scheme-mode haskell-mode ruby-mode rspec-mode python-mode
			c-mode c++-mode objc-mode latex-mode plain-tex-mode js-mode
			html-mode))
		(let ((mark-even-if-inactive transient-mark-mode))
			(indent-region (region-beginning) (region-end) nil))))))


;-----------------------key-sequence---------------------
; compile and debug{
;(global-set-key [f5] 'compile);compile
;(global-set-key [C-f7] 'gdb);debug
