.emacs-my
changeset 173 04b974b118c2
parent 172 fcea80b465b9
child 174 87a5496d252c
equal deleted inserted replaced
172:fcea80b465b9 173:04b974b118c2
   854 ;; ----------------------------------------------------------------------
   854 ;; ----------------------------------------------------------------------
   855 ;; LISP
   855 ;; LISP
   856 (setq list-command-history-max 256)
   856 (setq list-command-history-max 256)
   857 
   857 
   858 ;; ----------------------------------------------------------------------
   858 ;; ----------------------------------------------------------------------
   859 ;; C, c-lang
   859 ;; C, cc-mode
       
   860 
   860 (setq c-echo-syntactic-information-p t)
   861 (setq c-echo-syntactic-information-p t)
       
   862 (add-hook 'c-mode-common-hook
       
   863  (lambda ()
       
   864    ;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon.
       
   865    (c-toggle-auto-newline -1)
       
   866    ;; Delete all preceding whitespace by DEL.
       
   867    (c-toggle-hungry-state -1)
       
   868    ))
   861 
   869 
   862 (defconst my-c-style
   870 (defconst my-c-style
   863   '((c-tab-always-indent . t)
   871   '((c-tab-always-indent . t)
   864     (c-comment-only-line-offset . 4)
   872     (c-comment-only-line-offset . 4)
   865     (c-hanging-braces-alist
   873     (c-hanging-braces-alist
   904 ;; (objc-mode . "my-mode") (c++-mode . "cc-mode")
   912 ;; (objc-mode . "my-mode") (c++-mode . "cc-mode")
   905 (add-hook 'c-mode-common-hook
   913 (add-hook 'c-mode-common-hook
   906           (lambda () (c-add-style "my" my-c-style t)))
   914           (lambda () (c-add-style "my" my-c-style t)))
   907 (setq c-default-style '((java-mode . "my") (c-mode . "my") (csharp-mode . "my") (other . "my")))
   915 (setq c-default-style '((java-mode . "my") (c-mode . "my") (csharp-mode . "my") (other . "my")))
   908 
   916 
   909 ;; Customizations for all modes in CC Mode.
       
   910 ;; (defun my-c-mode-common-hook ()
       
   911 ;;   ;; add my personal style and set it for the current buffer
       
   912 ;;   (c-add-style "PERSONAL" my-c-style t)
       
   913 ;;   ;; other customizations
       
   914 ;;   ;; we like auto-newline and hungry-delete
       
   915 ;;   (c-toggle-auto-hungry-state 1)
       
   916 ;;   ;; key bindings for all supported languages.  We can put these in
       
   917 ;;   ;; c-mode-base-map because c-mode-map, c++-mode-map, objc-mode-map,
       
   918 ;;   ;; java-mode-map, idl-mode-map, and pike-mode-map inherit from it.
       
   919 ;;   (define-key c-mode-base-map "\C-m" 'c-context-line-break))
       
   920 
       
   921 ;; (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
       
   922 
       
   923 ;; ----------------------------------------------------------------------
   917 ;; ----------------------------------------------------------------------
   924 ;; *csharp*, c-sharp
   918 ;; *csharp*, c-sharp
   925 ;;
   919 ;;
   926 (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
   920 (autoload 'csharp-mode "csharp-mode" "Major mode for editing C# code." t)
   927 (add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
   921 (add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))