.emacs-my
changeset 710 49635ebf70f1
parent 704 474a9291a602
child 711 c124c5e589af
equal deleted inserted replaced
708:659c1d14b849 710:49635ebf70f1
  1472 
  1472 
  1473 ;; Minor mode that highlights suspicious C and C++ constructions.
  1473 ;; Minor mode that highlights suspicious C and C++ constructions.
  1474 (cwarn-mode 1)
  1474 (cwarn-mode 1)
  1475 
  1475 
  1476 (setq c-echo-syntactic-information-p t)
  1476 (setq c-echo-syntactic-information-p t)
  1477 (add-hook 'c-mode-common-hook
  1477 
  1478  (lambda ()
  1478 (defun my-c-mode-common-hook ()
  1479    ;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon.
  1479   ;; Automatically inserte newlines after special characters such as brace, comma, semi-colon, and colon.
  1480    (c-toggle-auto-newline -1)
  1480   (c-toggle-auto-newline -1)
  1481    ;; Delete all preceding whitespace by DEL.
  1481   ;; Delete all preceding whitespace by DEL.
  1482    (c-toggle-hungry-state -1)
  1482   (c-toggle-hungry-state -1)
  1483    ))
  1483   )
       
  1484 (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
  1484 
  1485 
  1485 (defconst my-c-style
  1486 (defconst my-c-style
  1486   '((c-tab-always-indent . t)
  1487   '((c-tab-always-indent . t)
  1487     (c-comment-only-line-offset . 4)
  1488     (c-comment-only-line-offset . 4)
  1488     (c-hanging-braces-alist
  1489     (c-hanging-braces-alist
  1524         (inextern-lang . 0)
  1525         (inextern-lang . 0)
  1525         ))
  1526         ))
  1526     (c-echo-syntactic-information-p . t))
  1527     (c-echo-syntactic-information-p . t))
  1527   "My C Programming Style")
  1528   "My C Programming Style")
  1528 
  1529 
  1529 (add-hook
  1530 (defun my-c-mode-style-hook ()
  1530  'c-mode-common-hook
  1531   (c-add-style "my" my-c-style t)
  1531  '(lambda ()
  1532   ;; If set 'c-default-style' before 'c-add-style'
  1532     (c-add-style "my" my-c-style t)
  1533   ;; "Undefined style: my" error occured from 'c-get-style-variables'.
  1533     ;; If set 'c-default-style' before 'c-add-style'
  1534   (setq c-default-style
  1534     ;; "Undefined style: my" error occured from 'c-get-style-variables'.
  1535         '(
  1535     (setq c-default-style
  1536           (java-mode . "my") (c-mode . "my") (csharp-mode . "my") (c++-mode . "my") (objc-mode . "my")
  1536           '(
  1537           (idl-mode . "my")
  1537             (java-mode . "my") (c-mode . "my") (csharp-mode . "my") (c++-mode . "my") (objc-mode . "my")
  1538           (awk-mode . "awk")
  1538             (idl-mode . "my")
  1539           (other . "my")
  1539             (awk-mode . "awk")
  1540           ))
  1540             (other . "my")
  1541   )
  1541             ))
  1542 (add-hook 'c-mode-common-hook 'my-c-mode-style-hook)
  1542     ))
       
  1543 
  1543 
  1544 ;;; ----------------------------------------------------------------
  1544 ;;; ----------------------------------------------------------------
  1545 (message "python")
  1545 (message "python")
  1546 
  1546 
  1547 (when (equal window-system 'w32)
  1547 (when (equal window-system 'w32)