.emacs-my
changeset 430 16e7a5a565a9
parent 419 7a06c31e9c09
parent 429 998f33a8ec6e
child 431 84a5ac36edab
equal deleted inserted replaced
419:7a06c31e9c09 430:16e7a5a565a9
    32     makefile-mode makefile-gmake-mode
    32     makefile-mode makefile-gmake-mode
    33     )
    33     )
    34   "List of development modes.")
    34   "List of development modes.")
    35 
    35 
    36 (defvar my-devel-mode-hook-list
    36 (defvar my-devel-mode-hook-list
    37   '(sh-mode-hook script-mode-hook
    37   '(
       
    38     outline-mode-hook
       
    39     sh-mode-hook script-mode-hook
    38     c-mode-hook c++-mode-hook java-mode-hook
    40     c-mode-hook c++-mode-hook java-mode-hook
    39     python-mode-hook
    41     python-mode-hook
    40     makefile-mode-hook makefile-gmake-mode-hook
    42     makefile-mode-hook makefile-gmake-mode-hook
    41     lisp-mode-hook emacs-lisp-mode-hook)
    43     lisp-mode-hook emacs-lisp-mode-hook)
    42   "List of development mode hooks.")
    44   "List of development mode hooks.")
    88     ) )
    90     ) )
    89 
    91 
    90 (menu-bar-mode -1)
    92 (menu-bar-mode -1)
    91 (tool-bar-mode -1)
    93 (tool-bar-mode -1)
    92 (when window-system
    94 (when window-system
       
    95   (defun my-popup-menu ()
       
    96     (interactive)
       
    97     (popup-menu
       
    98      (mouse-menu-bar-map) ;; (mouse-menu-major-mode-map)
       
    99      (list (list (/ (display-pixel-width) 2) 10) (get-buffer-window (buffer-name)))))
       
   100   (global-set-key [f10] 'my-popup-menu)
    93   (when (>= emacs-major-version 22) (tooltip-mode -1))
   101   (when (>= emacs-major-version 22) (tooltip-mode -1))
    94   (scroll-bar-mode 1)
   102   (scroll-bar-mode 1)
    95   )
   103   )
    96 
   104 
    97 (setq frame-title-format "Emacs - %b")
   105 (setq frame-title-format "Emacs - %b")
   886 
   894 
   887 (mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) ))
   895 (mapc (lambda (hook) (add-hook hook (lambda () (setq fill-column my-fill-column)) ))
   888       my-devel-mode-hook-list)
   896       my-devel-mode-hook-list)
   889 
   897 
   890 ;; ----------------------------------------------------------------------
   898 ;; ----------------------------------------------------------------------
   891 ;; diff, patch.
   899 ;; diff, patch, ediff, emerge.
   892 
   900 
   893 (setq diff-switches "-u")
   901 (setq diff-switches "-u")
       
   902 
       
   903 (setq ediff-diff-options "")
   894 
   904 
   895 ;; ----------------------------------------------------------------------
   905 ;; ----------------------------------------------------------------------
   896 ;; indenting.
   906 ;; indenting.
   897 
   907 
   898 (setq standard-indent 4)
   908 (setq standard-indent 4)
   911   (while (>= i 0)
   921   (while (>= i 0)
   912     (setq tab-stop-list (cons i tab-stop-list))
   922     (setq tab-stop-list (cons i tab-stop-list))
   913     (setq i (- i 4))))
   923     (setq i (- i 4))))
   914 
   924 
   915 ;; ----------------------------------------------------------------------
   925 ;; ----------------------------------------------------------------------
   916 ;; diff.
       
   917 
       
   918 (setq ediff-diff-options "")
       
   919 
       
   920 ;; ----------------------------------------------------------------------
       
   921 ;; *Compile*
   926 ;; *Compile*
   922 
   927 
   923 (setq compile-auto-highlight t
   928 (setq compile-auto-highlight t
   924       compile-command "make ")
   929       compile-command "make ")
   925 ;; compilation window shall scroll down if not 0
   930 ;; compilation window shall scroll down if not 0
   931 (add-to-list 'compilation-error-regexp-alist '("^\\( +\\[csc\\] \\|\\)\\(.*\\)(\\([0-9]*\\),\\([0-9]*\\)):" 2 3 4))
   936 (add-to-list 'compilation-error-regexp-alist '("^\\( +\\[csc\\] \\|\\)\\(.*\\)(\\([0-9]*\\),\\([0-9]*\\)):" 2 3 4))
   932 (add-to-list 'compilation-error-regexp-alist '("^ *\\(.*\\)(\\([0-9]*\\)) +:" 1 2))
   937 (add-to-list 'compilation-error-regexp-alist '("^ *\\(.*\\)(\\([0-9]*\\)) +:" 1 2))
   933 (add-to-list 'compilation-error-regexp-alist '("^\"?\\([^\"]*\\)\"?,\\([0-9]*\\) .*\\[.*\\]: " 1 2)) ; KEIL compiler
   938 (add-to-list 'compilation-error-regexp-alist '("^\"?\\([^\"]*\\)\"?,\\([0-9]*\\) .*\\[.*\\]: " 1 2)) ; KEIL compiler
   934 ;; (add-to-list 'compilation-mode-font-lock-keywords '("\\(/[Oo][Uu][Tt]:[^ 	]+\\)" . 1))
   939 ;; (add-to-list 'compilation-mode-font-lock-keywords '("\\(/[Oo][Uu][Tt]:[^ 	]+\\)" . 1))
   935 ;; (add-to-list 'compilation-mode-font-lock-keywords '("[ 	]\\(/F[oe][^ 	]+\\)" . 1))
   940 ;; (add-to-list 'compilation-mode-font-lock-keywords '("[ 	]\\(/F[oe][^ 	]+\\)" . 1))
       
   941 
       
   942 ;; ----------------------------------------------------------------------
       
   943 ;; TAGS, etags, ctags, GNU GLOBAL.
       
   944 
       
   945 (when (featurep 'etags-table)
       
   946   (setq etags-table-search-up-depth 1)
       
   947   )
       
   948 
       
   949 ;; ----------------------------------------------------------------------
       
   950 ;; CEDET, semantic.
       
   951 
       
   952 ;; For debug use 'semantic-debug-idle-function' and 'semantic-debug-idle-work-function'.
       
   953 (when (or (and (= emacs-major-version 23) (= emacs-minor-version 2))
       
   954           (>= emacs-minor-version 24))
       
   955   (semantic-mode 1)
       
   956   (global-semantic-idle-summary-mode 1)
       
   957   (global-semantic-idle-scheduler-mode 1)
       
   958   (setq semantic-idle-scheduler-idle-time 1) ; 1 sec.
       
   959   (global-semanticdb-minor-mode 1)
       
   960   (global-semantic-decoration-mode 1)
       
   961   (global-semantic-mru-bookmark-mode 1)
       
   962   ;; (global-semantic-idle-completions-mode -1)
       
   963   ;; (global-semantic-stickyfunc-mode 1)
       
   964   ;; (setq semantic-stickyfunc-sticky-classes '(function type variable include package))
       
   965 
       
   966   ;; (semantic-add-system-include "~/include" 'c++-mode)
       
   967   ;; (semantic-add-system-include "~/include" 'c-mode)
       
   968   )
       
   969 
       
   970 ;; ----------------------------------------------------------------------
       
   971 ;; imenu.
       
   972 
       
   973 (require 'imenu)
       
   974 (when window-system
       
   975   (mapc (lambda (hook)
       
   976           (add-hook hook
       
   977                     (lambda ()
       
   978                       (imenu-add-menubar-index)
       
   979                       (run-hooks 'menu-bar-update-hook)
       
   980                       ) ))
       
   981         my-devel-mode-hook-list)
       
   982   )
   936 
   983 
   937 ;; ----------------------------------------------------------------------
   984 ;; ----------------------------------------------------------------------
   938 ;; windows inf files for driver installing
   985 ;; windows inf files for driver installing
   939 
   986 
   940 (add-to-list 'auto-mode-alist '("\\.inf\\'" . conf-mode))
   987 (add-to-list 'auto-mode-alist '("\\.inf\\'" . conf-mode))
  1022         (substatement-open . 0)
  1069         (substatement-open . 0)
  1023         ))
  1070         ))
  1024     (c-echo-syntactic-information-p . t))
  1071     (c-echo-syntactic-information-p . t))
  1025   "My C Programming Style")
  1072   "My C Programming Style")
  1026 
  1073 
  1027 (add-hook 'c-mode-common-hook
  1074 (add-hook
  1028           (lambda () (c-add-style "my" my-c-style t)))
  1075  'c-mode-common-hook
  1029 (setq c-default-style '((java-mode . "my") (c-mode . "my") (csharp-mode . "my") (c++-mode . "my") (objc-mode . "my") (other . "my")))
  1076  '(lambda ()
       
  1077     (c-add-style "my" my-c-style t)
       
  1078     ;; If set 'c-default-style' before 'c-add-style'
       
  1079     ;; "Undefined style: my" error occured from 'c-get-style-variables'.
       
  1080     (setq c-default-style
       
  1081           '(
       
  1082             (java-mode . "my") (c-mode . "my") (csharp-mode . "my") (c++-mode . "my") (objc-mode . "my")
       
  1083             (awk-mode . "awk")
       
  1084             (other . "my")
       
  1085             ))
       
  1086     ))
       
  1087 
  1030 
  1088 
  1031 ;; ----------------------------------------------------------------------
  1089 ;; ----------------------------------------------------------------------
  1032 ;; bat file, batch, loaded from 'generic-x.el'.
  1090 ;; bat file, batch, loaded from 'generic-x.el'.
  1033 
  1091 
  1034 ;; ----------------------------------------------------------------------
  1092 ;; ----------------------------------------------------------------------
  1054 ;; (add-to-list 'load-path (expand-file-name "~/emacs/site/semantic"))
  1112 ;; (add-to-list 'load-path (expand-file-name "~/emacs/site/semantic"))
  1055 ;; (add-to-list 'load-path (expand-file-name "~/emacs/site/speedbar"))
  1113 ;; (add-to-list 'load-path (expand-file-name "~/emacs/site/speedbar"))
  1056 ;; (add-to-list 'load-path (expand-file-name "~/emacs/site/elib-1.0"))
  1114 ;; (add-to-list 'load-path (expand-file-name "~/emacs/site/elib-1.0"))
  1057 ;; (add-to-list 'load-path (expand-file-name "~/emacs/site/eieio"))
  1115 ;; (add-to-list 'load-path (expand-file-name "~/emacs/site/eieio"))
  1058 ;; (add-to-list 'load-path (expand-file-name "~/emacs/site/jde-2.3.5.1/lisp"))
  1116 ;; (add-to-list 'load-path (expand-file-name "~/emacs/site/jde-2.3.5.1/lisp"))
  1059 
       
  1060 ;; Load CEDET
       
  1061 ;; (load-file "~/emacs/site/common/cedet.el")
       
  1062 ;; Enabling SEMANTIC minor modes.  See semantic/INSTALL for more ideas.
       
  1063 ;; (semantic-load-enable-code-helpers)
       
  1064 
  1117 
  1065 ;; If you want Emacs to defer loading the JDE until you open a
  1118 ;; If you want Emacs to defer loading the JDE until you open a
  1066 ;; Java file, edit the following line
  1119 ;; Java file, edit the following line
  1067 ;; (setq defer-loading-jde nil)
  1120 ;; (setq defer-loading-jde nil)
  1068 ;; to read:
  1121 ;; to read: