(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; 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.
 '(ecb-options-version “2.32”))
 (custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; 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.
 )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;基本设置;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;********************** basic setting *********************
;;不要生成临时文件
 (setq-default make-backup-files nil)
;;设置中文语言环境
 ;;(set-language-environment 'Chinese-GB)
;;写文件的编码方式
 ;;(set-buffer-file-coding-system 'gb2312)
 (set-buffer-file-coding-system 'utf-8)
;;新建文件的编码方式
 ;;(setq default-buffer-file-coding-system 'gb2312)
 (setq default-buffer-file-coding-system 'utf-8)
;;终端方式的编码方式
 (set-terminal-coding-system 'utf-8)
;;键盘输入的编码方式
 ;;(set-keyboard-coding-system 'gb2312)
;;读取或写入文件名的编码方式
 (setq file-name-coding-system 'utf-8)
;;打开就启用 text 模式
 (setq default-major-mode 'text-mode)
;;禁用启动信息
 ;;(setq inhibit-startup-message t)
;;语法高亮
 (global-font-lock-mode t)
 (put 'set-goal-column 'disabled nil)
 (put 'narrow-to-region 'disabled nil)
 (put 'upcase-region 'disabled nil)
 (put 'downcase-region 'disabled nil)
 (put 'LaTeX-hide-environment 'disabled nil)
;;打开图片显示功能
 ;;(auto-image-file-mode t)
;;以 y/n 替代 yes/no
 (fset 'yes-or-no-p 'y-or-n-p)
;;打开缺省禁用的功能
 (setq version-control t)
 (setq kept-new-versions 3)
 (setq delete-old-versions t)
 (setq kept-old-versions 2)
 (setq dired-kept-versions 1)
;;让 dired 可以递归的拷贝和删除目录
 (setq dired-recursive-copies 'top)
 (setq dired-recursive-deletes 'top)
;;时间戳设置(time-stamp),设定文档上次保存的信息
 ;;只要里在你得文档里有Time-stamp:的设置,就会自动保存时间戳
 ;;启用time-stamp
 (setq time-stamp-active t)
 ;;去掉time-stamp的警告?
 (setq time-stamp-warn-inactive t)
 ;;设置time-stamp的格式,我如下的格式所得的一个例子:
 (setq time-stamp-format “%:u %02m/%02d/%04y %02H02M02S”)
 ;;将修改时间戳添加到保存文件的动作里。
 (add-hook 'write-file-hooks 'time-stamp)
;;在文档最后自动插入空白一行,好像某些系统配置文件是需要这样的
 (setq require-final-newline t)
 (setq track-eol t)
;;使用C-k删掉指针到改行末的所有东西
 (setq-default kill-whole-line t)
;;设定删除保存记录为200,可以方便以后无限恢复
 (setq kill-ring-max 200)
;;增大使用查找函数和变量的寻找范围
 (setq apropos-do-all t)
;;是用aspell程序作为Emacs的拼写检查成学
 (setq-default ispell-program-name “aspell”)
;;使用narrow功能时的一个设置
 (put 'narrow-to-region 'disabled nil)
;;启动Emacs自动设置为两个窗口(上下各一个)
 ;;(split-window-vertically)
;;功能是将当前行设为本页第一行,同终端下的clear命令有点相似
 (defun line-to-top-of-window ()
 “Move the line point is on to top of window.”
 (interactive)
 (recenter 0))
;; 回车缩进
 (global-set-key “\C-m” 'newline-and-indent)
 (global-set-key (kbd “C-”) 'newline)
;;临时记号
 ;;有时你需要跳到另一个文件进行一些操作,然后很快的跳回来。你当然可以 使用 bookmark或者寄存器。
 ;;但是这些实在是太慢了。你多想拥有vi那样的 ma, mb, 'a, 'b 的操作。现在你可以用几行 elisp 达到类似的目的
 (global-set-key [(control ?.)] 'ska-point-to-register)
 (global-set-key [(control ?,)] 'ska-jump-to-register)
 (defun ska-point-to-register()
 “Store cursorposition fast in a register.
 Use ska-jump-to-register to jump back to the stored
 position.”
 (interactive)
 (setq zmacs-region-stays t)
 (point-to-register 8))
(defun ska-jump-to-register()
 “Switches between current cursorposition and position
 that was stored with ska-point-to-register.”
 (interactive)
 (setq zmacs-region-stays t)
 (let ((tmp (point-marker)))
 (jump-to-register 8)
 (set-register 8 tmp)))
;; go-to-char 非常感谢 Oliver Scholz 提供这个函数给 我。
 ;;这个函数是一个 vi 的 “f” 命令的替代品。vi的用户知道,vi有 一个特别好的命令 “f”。当你按 “fx”, x 是任意一个字符时
 ;;光标 就会移动到下一个 “x” 处。这之后只要按 “;”(分号),光标就到再 下一个 “x”。
 ;;举个例子说明这个命令的用途。比如我们有这样一行字,光标在 行首。
 ;;(setq unread-command-events (list last-input-event)))
 ;; ^^^^^
 ;;我们希望迅速的到达最后那个 event 处,于是我在 vi 里按 “fe”。结果光标到了 “setq” 的那个 e 上面,这时候我接着按 “;”,
 ;;不一会儿就到了我们想要的地方。很方便吧?可能起初不觉得,后来 你发现这真的非常好!
;;我一直觉得 Emacs 没有这样一个方便的命令,但是 Oliver 给了 我一个完美的答案:
 ;;有了这段代码之后,当你按 C-c a x (x 是任意一个字符) 时,光 标就会到下一个 x 处。再次按 x,光标就到下一个 x。比如 C-c a w w w w …, C-c a b b b b b b …
 ;;我觉得这个方式比 vi 的 “f” 要快。
 (defun wy-go-to-char (n char)
 “Move forward to Nth occurence of CHAR.
 Typing `wy-go-to-char-key’ again will move forwad to the next Nth
 occurence of CHAR.”
 (interactive "p\ncGo to char: ")
 (search-forward (string char) nil nil n)
 (while (char-equal (read-char)
 char)
 (search-forward (string char) nil nil n))
 (setq unread-command-events (list last-input-event)))
 (define-key global-map (kbd “C-c a”) 'wy-go-to-char)
;;====================== Chinese setting =====================
 ;;(setq gnus-default-charset 'cn-gb-2312
 ;;gnus-group-name-charset-group-alist '((“." . gb2312))
 ;;gnus-summary-show-article-charset-alist '((1 . cn-gb-2312) (2 . big5) (3 . chinese-gbk) (4 . utf-8))
 ;;gnus-newsgroup-ignored-charsets '(unknown-8bit x-unknown iso-8859-1)
 ;;gnus-group-posting-charset-alist '((".” gb2312 (gb2312))))
 ;;(define-coding-system-alias 'gb18030 'gb2312)
;;------------设置(utf-8)模式------------
 (set-language-environment 'Chinese-GB)
 (set-keyboard-coding-system 'utf-8)
 (set-clipboard-coding-system 'utf-8)
 (set-terminal-coding-system 'utf-8)
 (set-buffer-file-coding-system 'utf-8)
 (set-default-coding-systems 'utf-8)
 (set-selection-coding-system 'utf-8)
 (modify-coding-system-alist 'process “*” 'utf-8)
 (setq default-process-coding-system '(utf-8 . utf-8))
 (setq-default pathname-coding-system 'utf-8)
 (set-file-name-coding-system 'utf-8)
 (setq ansi-color-for-comint-mode t) ;;′|àshell-mode??,o??÷[M`J3
;;设置 sentence-end 可以识别中文标点。不用在 fill 时在句号后插 入两个空格。
 (setq sentence-end “\([。!?]\|……\|[.?!][]”')}]\($\|[ \t]\)\)[ \t\n]")
 (setq sentence-end-double-space nil)
;;---------------------- End Chinese setting ---------------------
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;快捷键设置;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;********************** 常用编程配置 *********************
 ;; 按下Alt+/,就会弹出菜单让你自动补全
 ;;(define-key c-mode-base-map [(meta ?/)] 'semantic-ia-complete-symbol-menu)
;;设置home键指向buffer开头,end键指向buffer结尾
 (global-set-key [home] 'beginning-of-buffer)
 (global-set-key [end] 'end-of-buffer)
;; "C-,"设为屏幕左移命令
 (global-set-key (kbd “C-,”) 'scroll-left)
 ;; "C-."设为屏幕右移命令
 (global-set-key (kbd “C-.”) 'scroll-right)
;;设置M-g为goto-line
 (global-set-key (kbd “M-g”) 'goto-line)
 ;;;F2:进入wiki-mode模式
 (global-set-key [(f2)] 'emacs-wiki-find-file)
(global-set-key [f3] 'repeat-complex-command)
 ;; f4设置为在Emacs中调用gdb
 (global-set-key [f4] 'gdb)
;;定义查找快捷键
(global-set-key [C-f3] 'replace-regexp) ;;支持正则表达式
 (global-set-key [C-f4] 'replace-string)
 ;; C-f5, 设置编译命令; f5, 保存所有文件然后编译当前窗口文件
 (defun du-onekey-compile ()
 “Save buffers and start compile”
 (interactive)
 (save-some-buffers t)
 (switch-to-buffer-other-window “compilation”)
 (compile compile-command))
 (global-set-key [C-f5] 'compile)
 (global-set-key [f5] 'du-onekey-compile)
;;f6多个启动窗口跳转
(global-set-key [f6] 'gdb-many-windows)
(global-set-key [C-f7] 'previous-error)
 ;;(global-set-key [f7] 'next-error)
 ;; 自动编译(快捷键F7)
 (defun quick-compile ()
 “A quick compile funciton for C”
 (interactive)
 (compile (concat "gcc " (buffer-name (current-buffer)) " -g ")))
 (global-set-key [(f7)] 'quick-compile)
;;f8就是另开一个buffer然后打开shell,C-f8则是在当前的buffer打开shell
(defun open-eshell-other-buffer ()
 “Open eshell in other buffer”
 (interactive)
 (split-window-vertically)
 (eshell))
 (global-set-key [(f8)] 'open-eshell-other-buffer)
 (global-set-key [C-f8] 'eshell)
;;设置f9调用speedbar命令
 ;;使用 n 和 p 可以上下移动,
 ;; + 展开目录或文件进行浏览,- 收缩,RET 访问目录或文件,g 更新 speedbar。
 (setq speedbar-show-unknown-files t);;可以显示所有目录以及文件
 (setq dframe-update-speed nil);;不自动刷新,手动 g 刷新
 (setq speedbar-update-flag nil)
 (setq speedbar-use-images nil);;不使用 image 的方式
 (setq speedbar-verbosity-level 0)
(global-set-key [f9] 'speedbar)
;;设置F10为撤销
 (global-set-key [f10] 'undo)
;;启动窗口gdb
 (global-set-key [f11] 'gdb-many-windows)
;;;Alt+s : 让speedbar获得焦点
 (global-set-key (kbd “M-s”) 'speedbar-get-focus)
;;单点调试 按键绑定
 ;;(global-set-key [C-f5] 'gud-go)
 ;;(add-hook 'gdb-mode-hook '(lambda ()
 ;;(define-key c-mode-base-map [C-f7] 'gud-step)
 ;; (define-key c-mode-base-map [C-f9] 'gud-next)))
;;函数间跳转
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;快捷键设置结束;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;====================== 常用编程插件 =====================
;;********************** auto-header *********************
(add-to-list 'load-path “~/.emacs.d/lisp/”)
 ;;(require 'auto-header)
 ;;加载auto-header.el文件,自动添加文件头
 ;;(require 'auto-header)
 ;; 设置文件头中的姓名
 (setq header-full-name “yaoming168”)
;; 设置每次保存时要更新的项目
 (setq header-update-on-save
 '( filename
 modified
 counter
 copyright))
;;---------------------- END auto-header ---------------------
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;基本设置结束;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;外观设置;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;颜色设置,其实有个color-theme.el可以将Emacs设置丰富多彩,非常漂亮,不过启动有些慢,我只是选择了一些颜色设置。
 ;;;;;去掉工具栏
 (tool-bar-mode nil)
 ;; 去掉菜单栏 (C-Mouse2:显示菜单项) ,以右键形式显示
 (menu-bar-mode nil)
;;;;;不要滚动栏,现在都用滚轴鼠标了,可以不用滚动栏了
 (scroll-bar-mode nil)
 ;;;;;改变emacs标题栏的标题
 (setq frame-title-format “%b@Alex-GDLC”)
 ;;;;;允许emacs和外部其他程序的粘贴
 (setq x-select-enable-clipboard t)
 ;; 显示列号
 (setq column-number-mode t)
 ;;开启语法高亮。
 (global-font-lock-mode 1)
 ;;设置tab为4个空格的宽度
 (setq default-tab-width 4)
 (setq c-basic-offset 4)
 ;;;;;;;;; 设置界面 start
 (set-cursor-color “Wheat”)
 (set-mouse-color “Wheat”)
 (set-foreground-color “Wheat”)
 (set-background-color “DarkSlateGray”)
 (if window-system
 (setq default-frame-alist
 (append
 '( (top . 80)
 (left . 100)
 (width . 110)
 (height . 35))
 default-frame-alist))
 )
 ;;;启动最大化
 ;;;(setq initial-frame-alist '((top . 0) (left . 0) (width . 97) (height . 49)))
 ;;;;;启用时间显示设置,在minibuffer上面的那个杠上(忘了叫什么来着)
 (display-time-mode 1)
 ;;;;;时间使用24小时制
 (setq display-time-24hr-format t)
 ;;;;;时间显示包括日期和具体时间
 (setq display-time-day-and-date t)
 ;;;;;时间的变化频率,单位多少来着?
 (setq display-time-interval 10)
 ;;;;;鼠标自动避开指针,如当你输入的时候,指针到了鼠标的位置,鼠标有点挡住视线了
 (mouse-avoidance-mode 'animate)
 ;;;;;指针不要闪,我得眼睛花了
 (blink-cursor-mode -1)
 ;;;高亮显示要拷贝的内容
 (transient-mark-mode 1)
 ;;;;;当指针到一个括号时,自动显示所匹配的另一个括号
 (show-paren-mode 1)
 ;;;;;是用滚轴鼠标
 (mouse-wheel-mode t)
 ;;;;;备份设置
 ;;;;;emacs还有一个自动保存功能,默认在~/.emacs.d/auto-save-list里,这个非常有用,我这里没有改动,具体可以参见Sams teach yourself emacs in 24hours(我简称为sams24)
 ;;;;;启用版本控制,即可以备份多次
 (setq version-control t)
 ;;;;;备份最原始的版本两次,记第一次编辑前的文档,和第二次编辑前的文档
 (setq kept-old-versions 2)
 ;;;;;备份最新的版本五次,理解同上
 (setq kept-new-versions 5)
 ;;;;;删掉不属于以上7中版本的版本
 (setq delete-old-versions t)
 ;;;;;设置备份文件的路径
 (setq backup-directory-alist '((“.” . “~/.emacs.tmp”)))
 ;;;;;备份设置方法,直接拷贝
 (setq backup-by-copying t)
 ;; 自动存盘
 (setq auto-save-mode t)
 ;;;;;去掉烦人的警告铃声
 (setq visible-bell nil)
 ;;;;;滚动页面时比较舒服,不要整页的滚动
 (setq scroll-step 1
 scroll-margin 3
 scroll-conservatively 10000)
 ;;;;;使用C-k删掉指针到改行末的所有东西
 (setq-default kill-whole-line t)
 ;;;;;设定删除保存记录为200,可以方便以后无限恢复
 (setq kill-ring-max 200)
 ;;;;;是用aspell程序作为Emacs的拼写检查成学
 (setq-default ispell-program-name “aspell”)
 ;;;;;这个东西必须放在最后
 ;;;;;desktop.el是一个可以保存你上次emacs关闭时的状态,下一次启动时恢复为上次关闭的状态。就和vmware的suspend一样。
 ;;;;;因为我要使用sawfish-mode,wiki-mode,html-helper-mode,放在这里才能保证下次启动时能正确辨认文件需要的模式。
 (load “desktop”)
 (desktop-load-default)
 (desktop-read)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;外观设置结束;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;编程习惯基础设置;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;光标靠近鼠标指针时让鼠标指针自己闪开
 (mouse-avoidance-mode 'animate)
;;;;修改标题栏,显示buffer的名字
 (setq frame-title-format “%b”)
;;;;启动Emacs Server
 ;;(server-start)
;;;;每次进入Emacs即显式Plan
 ;;;;(plan)(color-theme-dark-blue)
;;;;高亮当前行
 (require 'hl-line)
 (global-hl-line-mode t)
;;;;向左右滚动的命令激活:C-x < 和 C-x >
 (put 'scroll-left 'disabled nil)
;;配置一下shell的颜色
 (autoload 'ansi-color-for-comint-mode-on “ansi-color” nil t)
 (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
 (setq ansi-color-for-comint-mode t)
;;;;退出Emacs时保存所有正在编辑的文档
 ;;(load “desktop”)
 ;;(desktop-save-mode)
 ;;(desktop-read)
;; 标题栏显示文件路径
 (setq frame-title-format
 '(“%S” (buffer-file-name “%f”
 (dired-directory dired-directory “%b”))))
;;-------------------------关闭启动时的`开机画面’------------
 (setq inhibit-startup-message t)
;;-------------------------显示列号--------------------------
 ;;(setq column-number-mode t)
 ;;display the column number and line number
 (setq column-number-mode t)
 (setq line-number-mode t)
 (global-linum-mode t)
;;-------------------------使用Win下的选择习惯---------------
 ;;用shift+方向键进行选择
 (pc-selection-mode)
 (setq x-select-enable-clipboard t);支持emacs和外部程序的粘贴
 (setq default-fill-column 80);默认显示 80列就换行
;;;; 显示时间
 (setq display-time-24hr-format t)
 (setq display-time-day-and-date t)
 (display-time)
;;;;设置大的kill ring
 (setq kill-ring-max 150)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;编程习惯基础设置结束;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;编程语言设置;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;========================================================
 ;;auto-complete
 (add-to-list 'load-path “~/.emacs.d/lisp/auto-complete-1.3.1”)
(require 'auto-complete)
 (require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories “~/.emacs.d/lisp/auto-complete-1.3.1/dict”)
(global-auto-complete-mode t)
;(setq-default ac-sources '(ac-source-words-in-same-mode-buffers))
 (setq-default ac-sources '(ac-source-yasnippet
 ac-source-semantic
 ac-source-ropemacs
 ac-source-imenu
 ac-source-words-in-buffer
 ac-source-dictionary
 ac-source-abbrev
 ac-source-words-in-buffer
 ac-source-files-in-current-dir
 ac-source-filename))
(add-hook 'emacs-lisp-mode-hook (lambda () (add-to-list 'ac-sources 'ac-source-symbols)))
 (add-hook 'auto-complete-mode-hook (lambda () (add-to-list 'ac-sources 'ac-source-filename)))
 ;;下面这句是从auto-complete-config.el中翻出来的
 ;;加上这句,在python中输入类的 . 就可以提示里面的方法了
 (add-hook 'python-mode-hook (lambda () (add-to-list 'ac-omni-completion-sources (cons “\.” '(ac-source-ropemacs))) ))
(set-face-background 'ac-candidate-face “lightgray”)
 (set-face-underline 'ac-candidate-face “darkgray”)
 (set-face-background 'ac-selection-face “steelblue”)
(setq ac-auto-start 2)
 (setq ac-dwim t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;c++语言设置;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 编程
 ;; C代码采用内核风格排版
 (defun c-lineup-arglist-tabs-only (ignored)
 “Line up argument lists by tabs, not spaces”
 (let* ((anchor (c-langelem-pos c-syntactic-element))
 (column (c-langelem-2nd-pos c-syntactic-element))
 (offset (- (1+ column) anchor))
 (steps (floor offset c-basic-offset)))
 (* (max steps 1)
 c-basic-offset)))
 (add-hook 'c-mode-common-hook
 (lambda ()
 ;; Add kernel style
 (c-add-style
 “linux-tabs-only”
 '(“linux” (c-offsets-alist
 (arglist-cont-nonempty
 c-lineup-gcc-asm-reg
 c-lineup-arglist-tabs-only))))))
 (add-hook 'c-mode-hook
 (lambda ()
 ;; (let ((filename (buffer-file-name)))
 ;; Enable kernel mode for the appropriate files
 ;; (when (and filename
 ;; (string-match (expand-file-name “/”)
 ;; filename))
 (setq indent-tabs-mode t)
 (c-set-style “linux-tabs-only”)))
 ;😉)
;;;; CC-mode配置 http://cc-mode.sourceforge.net/
 (require 'cc-mode)
 (c-set-offset 'inline-open 0)
 (c-set-offset 'friend '-)
 (c-set-offset 'substatement-open 0)
;;;;根据后缀判断所用的mode
 ;;;;注意:我在这里把.h关联到了c+±mode
 (setq auto-mode-alist
 (append '((“\.h$” . c+±mode)) auto-mode-alist))
;;h/cpp切换
(require 'eassist nil 'noerror)
(define-key c-mode-base-map [M-f12] 'eassist-switch-h-cpp)
;;用性感的尾巴highlight-tail标记最近的修改
(setq highlight-tail-colors
 '((“#c1e156” . 0)
 (“#b8ff07” . 25)
 (“#00c377” . 60)))
 ;;补全
 (define-key c-mode-base-map (kbd “M-n”) 'semantic-ia-complete-symbol-menu)
;;============================================================================
;===================== template设置 =================================
 (add-to-list 'load-path “~/.emacs.d/lisp/template/lisp/”)
 (require 'template)
 (template-initialize)
;===================== template设置结束===============================
;;h/cpp切换
 (require 'eassist nil 'noerror)
(define-key c-mode-base-map [M-f12] 'eassist-switch-h-cpp)
(setq eassist-header-switches
 '((“h” . (“cpp” “cxx” “c++” “CC” “cc” “C” “c” “mm” “m”))
 (“hh” . (“cc” “CC” “cpp” “cxx” “c++” “C”))
 (“hpp” . (“cpp” “cxx” “c++” “cc” “CC” “C”))
 (“hxx” . (“cxx” “cpp” “c++” “cc” “CC” “C”))
 (“h++” . (“c++” “cpp” “cxx” “cc” “CC” “C”))
 (“H” . (“C” “CC” “cc” “cpp” “cxx” “c++” “mm” “m”))
 (“HH” . (“CC” “cc” “C” “cpp” “cxx” “c++”))
 (“cpp” . (“hpp” “hxx” “h++” “HH” “hh” “H” “h”))
 (“cxx” . (“hxx” “hpp” “h++” “HH” “hh” “H” “h”))
 (“c++” . (“h++” “hpp” “hxx” “HH” “hh” “H” “h”))
 (“CC” . (“HH” “hh” “hpp” “hxx” “h++” “H” “h”))
 (“cc” . (“hh” “HH” “hpp” “hxx” “h++” “H” “h”))
 (“C” . (“hpp” “hxx” “h++” “HH” “hh” “H” “h”))
 (“c” . (“h”))
 (“m” . (“h”))
 (“mm” . (“h”))))
;;;;我的Java语言编辑策略::::::::::::::::::::::::::::::::::::::::::::::::::::
;;如果需要打开缩写词和模版的功能
 (add-to-list 'load-path (expand-file-name "~/.emacs.d/lisp/semantic-1.3.3"))
 (add-to-list 'load-path (expand-file-name "~/.emacs.d/lisp/speedbar-0.13a"))
 (add-to-list 'load-path (expand-file-name "~/.emacs.d/lisp/eieio-0.16"))
 (add-to-list 'load-path (expand-file-name "~/.emacs.d/lisp/jde-2.3.5.1/lisp"))
 (add-to-list 'load-path (expand-file-name "~/.emacs.d/lisp/elib-1.0"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;java语言设置结束;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;第二轮设置;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;设置文件默认路径
 ;;set the default file path
 (setq default-directory “~/sources/”)
;;shell设置
 ;;; multi-term
 (load-file (expand-file-name “/home/yaoming/.emacs.d/lisp/multi-term.el”))
 (require 'multi-term)
;; personal setting
 (setq multi-term-program “/bin/bash”)
 (setq multi-term-buffer-name “term”)
 (global-set-key “\C-x.” 'multi-term)
 (global-set-key “\C-x,” 'multi-term-dedicated-open)
;;自动添加括号
 ;; C mode
 (add-hook 'c-mode-hook 'hs-minor-mode)
 (add-hook 'c+±mode-hook 'hs-minor-mode)
 (add-hook 'java-mode-hook 'hs-minor-mode)
 (add-hook 'objc-mode-hook 'hs-minor-mode)
 (add-hook 'python-mode-hook 'hs-minor-mode)
 (defun my-c-mode-auto-pair ()
 (interactive)
 (make-local-variable ‘skeleton-pair-alist)
 (setq skeleton-pair-alist ‘(
 (? ? _ "’’")
 (?( ? _ “)”)
 (?[ ? _ “]”)
 (?{ \n > _ \n ?} >)))
 (setq skeleton-pair t)
 (local-set-key (kbd “(”) 'skeleton-pair-insert-maybe)
 (local-set-key (kbd “{”) 'skeleton-pair-insert-maybe)
 (local-set-key (kbd “`”) 'skeleton-pair-insert-maybe)
 (local-set-key (kbd “[”) 'skeleton-pair-insert-maybe))
 (add-hook 'c-mode-hook 'my-c-mode-auto-pair)
 (add-hook 'c+±mode-hook 'my-c-mode-auto-pair)
(add-hook 'java-mode-hook 'my-c-mode-auto-pair)
 (add-hook 'objc-mode-hook 'my-c-mode-auto-pair)
 (add-hook 'python-mode-hook 'my-c-mode-auto-pair)
;===================== cedet设置 =====================================
(add-hook 'texinfo-mode-hook (lambda () (require 'sb-texinfo)))
 (add-to-list 'load-path “~/.emacs.d/lisp/cedet-1.0pre4/common/cedet.el”)
 (add-to-list 'load-path “~/.emacs.d/lisp/cedet-1.0pre4/contrib”)
 (add-to-list 'load-path “~/.emacs.d/lisp/cscope-13.0”)
 (add-to-list 'load-path “~/.emacs.d/lisp/cedet-1.0pre4/ede”)
 (add-to-list 'load-path “~/.emacs.d/lisp/cedet-1.0pre4/speedbar”)
 (add-to-list 'load-path “~/.emacs.d/lisp/cedet-1.0pre4/eieio”)
 ;;(add-to-list 'load-path “~/.emacs.d/lisp/cedet-1.0pre4/semantic”)
 (add-to-list 'load-path “~/.emacs.d/lisp/cedet-1.0pre4/common”)
(add-to-list 'load-path “~/.emacs.d/lisp/ecb-2.32”)
 (require 'cedet)
 (require 'ecb)
 (require 'ede)
(require 'semantic-ia)
 (global-ede-mode 1) ; Enable the Project management system
(global-ede-mode t)
 (require 'xcscope)
;;函数功能
 (semantic-load-enable-minimum-features)
 (semantic-load-enable-code-helpers)
 (semantic-load-enable-guady-code-helpers)
 (semantic-load-enable-excessive-code-helpers)
 (semantic-load-enable-semantic-debugging-helpers)
;;代码折叠
(require 'semantic-tag-folding nil 'noerror)
 (global-semantic-tag-folding-mode 1)
;;代码折叠快捷键
 (when (and window-system (require 'semantic-tag-folding nil 'noerror))
 (global-semantic-tag-folding-mode 1)
 (global-set-key (kbd “C-?”) 'global-semantic-tag-folding-mode)
 (define-key semantic-tag-folding-mode-map (kbd “C-c , -”) 'semantic-tag-folding-fold-block)
 (define-key semantic-tag-folding-mode-map (kbd “C-c , +”) 'semantic-tag-folding-show-block)
 (define-key semantic-tag-folding-mode-map (kbd “C-_”) 'semantic-tag-folding-fold-all)
 (define-key semantic-tag-folding-mode-map (kbd “C-+”) 'semantic-tag-folding-show-all))
;;函数间跳转
(global-set-key [f12] 'semantic-ia-fast-jump)
 (global-set-key [S-f12]
 (lambda ()
 (interactive)
 (if (ring-empty-p (oref semantic-mru-bookmark-ring ring))
 (error “Semantic Bookmark ring is currently empty”))
 (let* ((ring (oref semantic-mru-bookmark-ring ring))
 (alist (semantic-mrub-ring-to-assoc-list ring))
 (first (cdr (car alist))))
 (if (semantic-equivalent-tag-p (oref first tag)
 (semantic-current-tag))
 (setq first (cdr (car (cdr alist)))))
 (semantic-mrub-switch-tags first))))
;;-----------------------------------------------
 ;; 自动添加
 ;; ecb
 (custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; 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.
 '(ecb-fix-window-size t)
 '(ecb-layout-window-sizes nil)
 '(ecb-options-version “2.32”)
 '(ecb-primary-secondary-mouse-buttons (quote mouse-1–mouse-2))
 '(ecb-windows-width 0.3))
 (custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; 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.
 )
 (put 'upcase-region 'disabled nil)
 (put 'downcase-region 'disabled nil)
;; 关闭tip
 (setq ecb-tip-of-the-day nil)
;; Ecb的操作:
 ;; C-c . g d 目录列表窗口
 ;; C-c . g s 源码窗口
 ;; C-c . g m 方法和变量窗口
 ;; C-c . g h 历史窗口
 ;; C-c . g l 最后选择过的编辑窗口
 ;; C-c . g 1 编辑窗口1
 ;; C-c . g n 编辑窗口n
 ;; C-c . l c 选择版面
 ;; C-c . l r 重画版面
 ;; C-c . l t 拴牢版面(锁定版面)
 ;; C-c . l w 拴牢可见的ecb窗口
 ;; C-c . \ 拴牢编绎窗口
;; 其中l为小写字母(L),大家别看错!!
;;;; 各窗口间切换
 (global-set-key [M-left] 'windmove-left)
 (global-set-key [M-right] 'windmove-right)
 (global-set-key [M-up] 'windmove-up)
 (global-set-key [M-down] 'windmove-down)
(defun my-ecb-active-or-deactive ()
 (interactive)
 (if ecb-minor-mode
 (ecb-deactivate)
 (ecb-activate)))
(global-set-key (kbd “”) 'my-ecb-active-or-deactive)
;cedet设置结束============
;=========================== 方便编程操作的设置=====================================
(setq compile-command “make”)
 ;;emacs的默认compile命令是调用make -k,我把它改成了make。你也可以把它改成其他的,比如gcc之类的.
;;把c语言风格设置为k&r风格
 (add-hook 'c-mode-hook
 '(lambda ()
 (c-set-style “k&r”)))
;;把C++语言风格设置为stroustrup风格
 (add-hook 'c+±mode-hook
 '(lambda()
 (c-set-style “stroustrup”)))
;========================================================================
(load-library “hideshow”)
 (add-hook 'c-mode-hook 'hs-minor-mode)
 (add-hook 'c+±mode-hook 'hs-minor-mode)
 (add-hook 'java-mode-hook 'hs-minor-mode)
 (add-hook 'perl-mode-hook 'hs-minor-mode)
 (add-hook 'php-mode-hook 'hs-minor-mode)
 (add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)
 ;;能把一个代码块缩起来,需要的时候再展开
 ;; M-x hs-minor-mode
 ;; C-c @ ESC C-s show all
 ;; C-c @ ESC C-h hide all
 ;; C-c @ C-s show block
 ;; C-c @ C-h hide block
 ;; C-c @ C-c toggle hide/show
;========================================================================
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Android环境搭建;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;微薄功能;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;第一种方案
 ;;(add-to-list 'load-path “~/.emacs.d/lisp/austin------weibo.emacs-751a8e2”)
 ;;(require 'weibo)
;;第二种方案
(load-file “~/.emacs.d/lisp/twittering-mode.el”)
(require 'twittering-mode)
(setq twittering-use-ssl nil
twittering-oauth-use-ssl nil)
(setq twittering-icon-mode 1)
(setq twittering-enabled-services '(sina))
(setq twittering-accounts '((sina (username “你的新浪用户名”)
(auth oauth))))
;;按M-x,输入twit,选择y会弹出浏览器,浏览器上会显示pin码,回emacs输入该pin码,ok了。
;;C-c C-s写微博
;;C-c C-c就发送微博了。
;;C-c C-f 浏览你关注的人的微博
;;C-c C-r 浏览你回复给别人的和别人回复给你的信息
;;C-m 回车 回复光标所在的那条微博
;;C-c C-m 或C-c enter 引用光标所在的那条微博
;;其他设置
 ;;2种编辑html的好模式
 (autoload 'html-helper-mode “html-helper-mode” “Yay HTML” t)
 (autoload 'css-mode “css-mode” “Mode for editing CSS files” t)










