.emacs-my
changeset 499 c3390bcde246
parent 497 1848e3b1fc00
child 500 1f8c3b0b0ca3
equal deleted inserted replaced
497:1848e3b1fc00 499:c3390bcde246
   977 ;;; devel, prog, programming.
   977 ;;; devel, prog, programming.
   978 
   978 
   979 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
   979 (add-to-list 'auto-mode-alist '("\\.cu$" . c-mode))
   980 
   980 
   981 (add-to-list 'auto-mode-alist '("\\.js$" . js-mode))
   981 (add-to-list 'auto-mode-alist '("\\.js$" . js-mode))
       
   982 
       
   983 (defun my-c++-header-file-p ()
       
   984   "Return non-nil, if in a C++ header."
       
   985   (and (string-match "\\.h$"
       
   986                      (or (buffer-file-name)
       
   987                          (buffer-name)))
       
   988        (save-excursion
       
   989          (re-search-forward "\\_<class\\_>" nil t))))
       
   990 
       
   991 (add-to-list 'magic-mode-alist
       
   992              '(my-c++-header-file-p . c++-mode))
       
   993 
   982 
   994 
   983 (setq-default comment-style (quote indent))
   995 (setq-default comment-style (quote indent))
   984 (setq-default comment-column 44)
   996 (setq-default comment-column 44)
   985 (setq-default comment-fill-column my-fill-column)
   997 (setq-default comment-fill-column my-fill-column)
   986 
   998