Commits

duyanning committed 63bf265 Merge

merge

  • Participants
  • Parent commits bbf849e, 3859012

Comments (0)

Files changed (2)

File c++-helper.el

       (message "File must be a header file (.h)"))))
 
 
-(defun insert-header-guard (buffer-name, extern-C)
+(defun insert-header-guard (buffer-name extern-C)
   (let* ((split-name (split-string buffer-name "[-_.]"))
          (guard-def (concat ""
                             (mapconcat (lambda (x) (upcase x))
         (insert guard-def)))))
 
 
-;; ˛ÎżźÁËebrowse.elÖĐşŻĘýebrowse-revert-tree-buffer-from-fileľÄĘľĎÖ
+;; 参考了ebrowse.el中函数ebrowse-revert-tree-buffer-from-file的实现
 (defun rebuild-and-reload-BROWSE ()
   "rebuild and reload BROWSE"
   (interactive)
 ;; c-indent-command
 ;;   (funcall indent-function)
 ;;     indent-according-to-mode
-;;       indent-line-functionËůÖ¸ľÄşŻĘýŁŹź´c-indent-line
-;;         (setq c-syntactic-context (c-guess-basic-syntax))ľĂľ˝šâąę´ŚľÄÓÉĎĎÂÎÄ
-;;         (setq indent (c-get-syntactic-indentation c-syntactic-context)) ´ËĘąľĂľ˝ľÄindentÎŞ0
-;;         (setq shift-amt (- indent (current-indentation))) ÇółöľÄshift-amtҲĘÇ0
-;;         (c-shift-line-indentation shift-amt) ĂťÓĐŇĆśŻšâąę
+;;       indent-line-function所指的函数,即c-indent-line
+;;         (setq c-syntactic-context (c-guess-basic-syntax))得到ĺ
+;;         (setq indent (c-get-syntactic-indentation c-syntactic-context)) 此时得到的indent为0
+;;         (setq shift-amt (- indent (current-indentation))) 求出的shift-amt也是0
+;;         (c-shift-line-indentation shift-amt) 没有移动ĺ
 ;;         (run-hooks 'c-special-indent-hook)
-;;           c-gnu-impose-minimum žÍĘÇŇňÎŞŐâŇťĐĐŁŹenum classľÄ}×ÜĘÇĎňÓŇĚŤśŕ
+;;           c-gnu-impose-minimum 就是因为这一行,enum class的}总是向右太多
 ;;             (c-shift-line-indentation (- c-label-minimum-indentation (current-indentation)))
-;; žÍĘÇŇňÎŞc-gnu-impose-minimumŁŹenum classľÄ}×ÜĘÇĎňÓŇĚŤśŕŁŹľŤ°Ńc-default-styleÖĐC++ľÄˇç¸ńÉčÎŞstroustrupžÍşĂÁËŁŹÄŹČĎĘÇgnu
+;; 就是因为c-gnu-impose-minimum,enum class的}总是向右太多,但把c-default-style中C++的风格设为stroustrup就好了,默认是gnu
 (defun align-enum-class-closing-brace (langelem)
   (if (inside-class-enum-p (c-langelem-pos langelem))
       '-
 (defvar paredit-path "~/.emacs.d/packages/paredit.el") ; http://emacswiki.org/emacs/ParEdit
 (defvar ace-jump-mode-path "~/.emacs.d/packages/ace-jump-mode.el") ; https://github.com/winterTTr/ace-jump-mode/wiki
 (defvar yaml-mode-path "~/.emacs.d/packages/yaml-mode/") ; https://github.com/yoshiki/yaml-mode
-(defvar cmake-mode-path "/usr/share/cmake-2.8.9/editors/emacs") ; location in cygwin
+(defvar cmake-mode-path "/usr/share/emacs/site-lisp/cmake-mode.el")
+;D:\\Program Files\\CMake 2.8\\share\\cmake-2.8\\editors\\emacs
 
 
 ;;;; ~/.emacs.d/env.el就相当于.emacs这个程序的é
   (add-to-list 'image-load-path "~/.emacs.d/images/")
 
 
-  (when (file-exists-p "~/share/emacs/lisp/")
-    (add-to-load-path "~/share/emacs/lisp/"))
-
 
   (require 'string-operations)
   (load "general-helper")
   (setq make-backup-files nil)
   (column-number-mode t)
   (show-paren-mode t)
-  (global-set-key (kbd "C-z") 'undo)
-  (global-set-key (kbd "C-/") 'suspend-emacs)
-  (global-set-key (kbd "C-c w") 'delete-region)
-  (global-set-key (kbd "C-c k") 'server-edit)
+  (global-set-key "\C-z" 'undo)
+  (global-set-key "\C-cw" 'delete-region)
+  (global-set-key "\C-ck" 'server-edit)
   (setq-default indicate-empty-lines t)
 
   ;; tab and space
 (defun load-win-common-settings ()
   (load-common-settings)
   (server-start)
-  (when (fboundp 'ime-save-and-set-status)
-    (require 'smart-ime)
-    (smart-ime-mode 1))
-
+  (require 'smart-ime)
+  (smart-ime-mode 1)
   ;;(w32-register-hot-key [M-tab]) ; win7下无效
   ;;(w32-unregister-hot-key [M-tab])
   (configure-ntcmd-mode)
 
 
 (defun load-cygwin-settings ()
-  (load-linux-common-settings)
-
-  ;; need emacs compiled with smart-ime supports
-  (when (fboundp 'ime-save-and-set-status)
-    (require 'smart-ime)
-    (smart-ime-mode 1))
-)
+  (load-linux-common-settings))
 
 
 (defun load-term-settings ()
   (when (file-exists-p org-path)
     (require 'org-install))
 
-  (global-set-key (kbd "C-c l") 'org-store-link)
-  (global-set-key (kbd "C-c c") 'org-capture)
-  (global-set-key (kbd "C-c a") 'org-agenda)
-  (global-set-key (kbd "C-c b") 'org-iswitchb)
+  (global-set-key "\C-cl" 'org-store-link)
+  (global-set-key "\C-cc" 'org-capture)
+  (global-set-key "\C-ca" 'org-agenda)
+  (global-set-key "\C-cb" 'org-iswitchb)
 
   ;; Setting up Remember for Org
   (org-remember-insinuate)
 
 ;; 调整默认字体大小后再最大化窗口,所以将主ĺ
 ;;;; 丝ĺ
-(cond 
- ((is-ubuntu) (load-ubuntu-settings))  ; Ubuntu
- ((is-winxp) (load-winxp-settings))    ; Windows XP
- ((is-win7) (load-win7-settings))      ; Windows 7
- ((is-cygwin) (load-cygwin-settings))  ; Cygwin
- ((is-term) (load-term-settings))      ; character only terminal
- )
+(cond ((is-term) (load-term-settings))      ; character only terminal
+      ((is-ubuntu) (load-ubuntu-settings))  ; Ubuntu
+      ((is-winxp) (load-winxp-settings))    ; Windows XP
+      ((is-win7) (load-win7-settings))      ; Windows 7
+      ((is-cygwin) (load-cygwin-settings))) ; Cygwin