~ubuntu-branches/ubuntu/precise/primrose/precise

« back to all changes in this revision

Viewing changes to minorGems/.emacs

  • Committer: Bazaar Package Importer
  • Author(s): Paul Wise
  • Date: 2009-04-06 19:26:56 UTC
  • Revision ID: james.westby@ubuntu.com-20090406192656-cri7503gebyvfl8t
Tags: upstream-5+dfsg1
ImportĀ upstreamĀ versionĀ 5+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; Modification History
 
2
;;
 
3
;; 2001-March-10   Jason Rohrer
 
4
;; Created.
 
5
;; Fixed so that c++ mode is used for .h files.
 
6
;; Fixed [C-backspace] mapping.
 
7
;;
 
8
;; 2001-May-21   Jason Rohrer
 
9
;; Changed so that Java inclass items are not doubly indented.
 
10
;;
 
11
;; 2002-January-21   Jason Rohrer
 
12
;; Gave in and set to use spaces instead of tabs.
 
13
;; This is primarily motivated by the fact that tabs look terrible
 
14
;; in CVS-web.
 
15
;;
 
16
;; 2005-January-16   Jason Rohrer
 
17
;; Added php mode.
 
18
;;
 
19
 
 
20
(custom-set-variables
 
21
  ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
 
22
  ;; Your init file should contain only one such instance.
 
23
 '(case-fold-search t)
 
24
 '(current-language-environment "ASCII")
 
25
 '(global-font-lock-mode t nil (font-lock))
 
26
 '(tab-stop-list (quote (4 8 12 16 20 24 28 32 36 40 44 48 52 56 60)))
 
27
 '(transient-mark-mode t))
 
28
(custom-set-faces
 
29
  ;; custom-set-faces was added by Custom -- don't edit or cut/paste it!
 
30
  ;; Your init file should contain only one such instance.
 
31
 )
 
32
 
 
33
 
 
34
;(setq-default scroll-step 1)               ; turn off jumpy scroll
 
35
(setq-default visible-bell t)              ; no beeps, flash on errors
 
36
 
 
37
(display-time)                             ; display the time on modeline
 
38
(column-number-mode t)                     ; display the column number on modeline
 
39
(setq-default kill-whole-line t)           ; ctrl-k kills whole line if at col 0
 
40
(setq-default fill-column 80)              ; wrap at col 80
 
41
(setq-default tab-width 4)                 ; show tabs as 4 cols
 
42
 
 
43
(setq font-lock-maximum-decoration t)      ; use colours in font lock mode
 
44
(setq font-lock-maximum-size nil)          ; turn off limit on font lock mode
 
45
 
 
46
; turn on font-lock everywhere (if possible)
 
47
(global-font-lock-mode 1 t)
 
48
 
 
49
; make sure C-backspace kills a word
 
50
( global-set-key `[C-backspace]   `backward-kill-word )
 
51
 
 
52
; background color, light yellow
 
53
( add-to-list  'default-frame-alist '( background-color . "#FFFFDC" ) )
 
54
 
 
55
; auto fill mode
 
56
( add-hook 'c-mode-common-hook 'turn-on-auto-fill )
 
57
 
 
58
; fix comment syntax highlighting problems
 
59
( setq font-lock-support-mode 'lazy-lock-mode )
 
60
( setq lazy-lock-defer-time 0 )
 
61
 
 
62
; delete highlighted text as we type
 
63
( delete-selection-mode t )
 
64
 
 
65
; make sure c++ mode is used for .h files
 
66
( setq auto-mode-alist ( 
 
67
        append '(
 
68
                ("\\.h$" . c++-mode)
 
69
                )
 
70
        auto-mode-alist
 
71
        )
 
72
)
 
73
 
 
74
 
 
75
; off for now, since it screws up indenting
 
76
; load the line numbers package
 
77
;( load "setnu" );
 
78
; turn it on
 
79
;( add-hook 'c-mode-common-hook 'turn-on-setnu-mode )
 
80
 
 
81
 
 
82
( copy-face 'italic  'font-lock-comment-face )
 
83
( set-face-foreground 'font-lock-comment-face "#00AA00" )
 
84
( setq font-lock-comment-face 'font-lock-comment-face )
 
85
 
 
86
( copy-face 'default 'font-lock-string-face )
 
87
( set-face-foreground 'font-lock-string-face "#FF00FF" )
 
88
( setq font-lock-string-face 'font-lock-string-face )
 
89
 
 
90
( copy-face 'bold 'font-lock-type-face )
 
91
( set-face-foreground 'font-lock-type-face "#0000FF" )
 
92
( setq font-lock-type-face 'font-lock-type-face )
 
93
 
 
94
( copy-face 'bold 'font-lock-keyword-face )
 
95
( set-face-foreground 'font-lock-keyword-face "#C88000" )
 
96
( setq font-lock-keyword-face 'font-lock-keyword-face )
 
97
 
 
98
 
 
99
( copy-face 'default 'font-lock-function-name-face )
 
100
( set-face-foreground 'font-lock-function-name-face "#C80000" )
 
101
( setq font-lock-function-name-face 'font-lock-function-name-face )
 
102
 
 
103
( copy-face 'default 'font-lock-variable-name-face )
 
104
( set-face-foreground 'font-lock-variable-name-face "#0000FF" )
 
105
( setq font-lock-variable-name-face 'font-lock-variable-name-face )
 
106
 
 
107
( copy-face 'bold 'font-lock-constant-face )
 
108
( set-face-foreground 'font-lock-constant-face "#C800FF" )
 
109
( setq font-lock-constant-face 'font-lock-constant-face )
 
110
 
 
111
( copy-face 'bold 'font-lock-warning-face )
 
112
( set-face-foreground 'font-lock-warning-face "#FF0000" )
 
113
( setq font-lock-warning-face 'font-lock-warning-face )
 
114
 
 
115
( copy-face 'default 'font-lock-reference-face )
 
116
( set-face-foreground 'font-lock-reference-face "#00FFFF" )
 
117
( setq font-lock-reference-face 'font-lock-reference-face )
 
118
 
 
119
 
 
120
 
 
121
 
 
122
(defconst my-c-style
 
123
  '((c-tab-always-indent           . t)
 
124
    (c-comment-only-line-offset    . 4)
 
125
    (c-hanging-braces-alist        . ((substatement-open after)
 
126
                                                                          (defun-open after)
 
127
                                                                          (block-open after)
 
128
                                                                          (class-open after)
 
129
                                                                          (inline-open after)
 
130
                                                                          (brace-entry-open after)
 
131
                                      (brace-list-open)))
 
132
    (c-hanging-colons-alist        . ((member-init-intro before)
 
133
                                      (inher-intro)
 
134
                                      (case-label after)
 
135
                                      (label after)
 
136
                                      (access-label after)))
 
137
    (c-cleanup-list                . (scope-operator
 
138
                                      empty-defun-braces
 
139
                                      defun-close-semi))
 
140
    (c-offsets-alist               . ((arglist-close     . c-lineup-arglist)
 
141
                                      (substatement-open . 0)
 
142
                                      (case-label        . 4)
 
143
                                      (block-open        . 0)
 
144
                                                                          (comment-intro     . 0)
 
145
                                      (block-close       . 4)
 
146
                                      (inclass           . 8)
 
147
                                      (access-label      . -4)
 
148
                                                                          (defun-close       . 4)
 
149
                                                                          (inline-close      . 4)
 
150
                                                                          (class-close       . 4)
 
151
                                                                          (brace-list-close  . 4)
 
152
                                      (knr-argdecl-intro . -)))
 
153
    (c-echo-syntactic-information-p . t)
 
154
    )
 
155
  "My C Programming Style")
 
156
 
 
157
;; Customizations for all of c-mode, c++-mode, and objc-mode
 
158
(defun my-c-mode-common-hook ()
 
159
  ;; add my personal style and set it for the current buffer
 
160
  (c-add-style "PERSONAL" my-c-style t)
 
161
 
 
162
  ;; offset customizations not in my-c-style
 
163
  (c-set-offset 'member-init-intro '++)
 
164
  ;; other customizations
 
165
  (setq tab-width 4
 
166
        ;; this will make sure spaces are used instead of tabs
 
167
        indent-tabs-mode nil)
 
168
  ;; we like auto-newline and hungry-delete
 
169
  (c-toggle-auto-hungry-state 1)
 
170
  ;; keybindings for C, C++, and Objective-C.  We can put these in
 
171
  ;; c-mode-map because c++-mode-map and objc-mode-map inherit it
 
172
  (define-key c-mode-map "\C-m" 'newline-and-indent)
 
173
  )
 
174
 
 
175
;; the following only works in Emacs 19
 
176
;; Emacs 18ers can use (setq c-mode-common-hook 'my-c-mode-common-hook)
 
177
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
 
178
(add-hook 'java-mode-hook 'my-c-mode-common-hook)
 
179
 
 
180
 
 
181
 
 
182
 
 
183
( add-hook 'perl-mode-hook 'my-perl-mode-hook )
 
184
 
 
185
 
 
186
(require 'php-mode)
 
187
 
 
188
 
 
189
; caml mode (Tuareg)
 
190
(setq auto-mode-alist (cons '("\\.ml\\w?" . tuareg-mode) auto-mode-alist))
 
191
  (autoload 'tuareg-mode "tuareg" "Major mode for editing Caml code" t)
 
192
  (autoload 'camldebug "camldebug" "Run the Caml debugger" t)
 
193
 
 
194
; old caml mode
 
195
;(setq auto-mode-alist
 
196
;         (cons '("\\.ml[iylp]?$" . caml-mode) auto-mode-alist))
 
197
;(autoload 'caml-mode "caml" "Major mode for editing Caml code." t)
 
198
;(autoload 'run-caml "inf-caml" "Run an inferior Caml process." t)
 
199
;(if window-system (require 'caml-font))
 
200
(put 'downcase-region 'disabled nil)
 
201
 
 
202
 
 
203
 
 
204
;; actionscript (for flash development)
 
205
(autoload 'actionscript-mode "actionscript-mode" "Major mode for actionscript." t)
 
206
;; Activate actionscript-mode for any files ending in .as
 
207
(add-to-list 'auto-mode-alist '("\\.as$" . actionscript-mode))
 
208
;; Load our actionscript-mode extensions.
 
209
;;(eval-after-load "actionscript-mode" '(load "as-config"))
 
 
b'\\ No newline at end of file'