All pastes #16539 Raw Edit

Miscellany

public text v1 · immutable
#16539 ·published 2005-06-30 19:32 UTC
rendered paste body
; c-mode
(setq auto-mode-alist (append '(("\\.h$" . c++-mode)) auto-mode-alist))
(defun my-c-mode-common-hook ()
  (c-toggle-auto-hungry-state 1)
  (c-set-style "stroustrup")
  (define-key c-mode-base-map (kbd "RET") 'c-context-line-break)
  (define-key c-mode-base-map (kbd "M-o") 'switch-cpp-h)
  (define-key c-mode-base-map (kbd "C-SPC") 'senator-completion-menu-popup)
  (define-key c-mode-base-map (kbd "C-c ;") 'comment-region)
  (define-key c-mode-base-map (kbd "C-c :") 'my-uncomment-region)
  (semantic-default-c-setup)
  (turn-off-filladapt-mode)
)

(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
(add-hook 'c-mode-hook 'my-c-mode-common-hook)
(add-hook 'c++-mode-hook 'my-c-mode-common-hook)
(add-hook 'c-initialization-hook 'my-c-mode-common-hook)

(defun my-uncomment-region ()
  (comment-region (region-beginning) (region-end) (quote (4)))
)