1 ;;---------------------------------------------------------------------------
3 ;; Emacs-Options for Videolan CodingStyle programming
5 ;; paste the following lines in your .emacs file
7 ;;---------------------------------------------------------------------------
9 ;; associate c-mode with file extension '.c' or '.h' in vlc trunk tree
12 '((".*vlc-trunk.*/.*\\.[ch]$" . c-mode)
15 ;; define videolan c style settings
16 (defconst videolan-c-style
17 '((c-tab-always-indent . t)
18 (c-comment-only-line-offset . 4)
19 (c-hanging-braces-alist . ((substatement-open before after)
21 (c-hanging-colons-alist . ((member-init-intro before)
25 (access-label after)))
26 (c-cleanup-list . (scope-operator
30 (c-offsets-alist . ((string . -1000)
31 (c . c-lineup-C-comments)
34 (defun-block-intro . +)
40 (topmost-intro-cont . 0)
41 (member-init-intro . +)
42 (member-init-cont . 0)
48 (brace-list-close . 0)
49 (brace-list-intro . +)
50 (brace-list-entry . 0)
53 (statement-block-intro . +)
54 (statement-case-intro . +)
55 (statement-case-open . +)
57 (substatement-open . +)
61 (do-while-closure . 0)
66 (arglist-cont-nonempty . c-lineup-arglist)
72 (objc-method-intro . 0)
73 (objc-method-args-cont . 0)
74 (objc-method-call-cont . 0)))
77 (c-echo-syntactic-information-p . t)
79 "Videolan C Programming Style")
81 ;; Customizations for c-mode
82 (defun videolan-mode-hook ()
83 ;; add the Videolan c style and set it for the current buffer
84 (local-set-key "\r" 'newline-and-indent)
85 (c-add-style "vlc" videolan-c-style t)
86 (c-set-offset 'member-init-intro '++)
88 ;; other customizations
90 ;; this will make sure spaces are used instead of tabs
92 ;; we like auto-newline and hungry-delete
93 (c-toggle-auto-newline-state 1)
95 '(c-hanging-semi&comma-criteria nil))
98 (add-hook 'c-mode-hook 'videolan-mode-hook)