Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Lisp by Dan McD. ( 15 years ago )
(let ((my-solaris-c-style
       '("bsd"
         (c-basic-offset                          . 4)
         (c-tab-width                             . 4)
         (tab-width                               . 4)
         (indent-tabs-mode                        . t)
         (c-offsets-alist                         . 
                          ((arglist-cont-nonempty . 4))))))
  (c-add-style "solaris" my-solaris-c-style))


----------------------------------

; Misc. variable settings, mostly to help me conform to cstyle.
; NOTE:  This only works with 19.31 and (presumably) beyond.

; Load c-mode so c-add-style function is loaded.
(c-mode)
(c-add-style "Sun" 
      '((c-basic-offset . 8)
       (c-offsets-alist . ((statement-block-intro . +)
      (knr-argdecl-intro . +)
      (knr-argdecl . 0)
      (statement-cont . *)
      (substatement . +)
      (arglist-intro . *)
      (arglist-cont . 0)
      (arglist-cont-nonempty . *)
      (member-init-intro . +)
      (member-init-cont . *)
      ))
       )
      1)
(setq c-comment-only-line-offset 0)
;; C mode hook stolen from text-mode hook from PAB.
(setq c-mode-hook
      '(lambda ()
  (c-set-style "sun")
  ; Comment this line out if you don't want colored C source.
  (font-lock-mode)
  ; For font-lock, set the appropriate variables, font-lock-*-face.
  ; Look at the modify-face commands below.
  (modify-face (quote font-lock-comment-face) "Blue"
        nil nil t nil nil nil nil)
  (modify-face (quote font-lock-keyword-face) "black"
        nil nil nil nil t nil nil)
  (modify-face (quote font-lock-type-face) "SlateBlue"
        nil nil nil nil nil nil nil)
  (modify-face (quote font-lock-function-name-face) "Firebrick"
        nil nil t nil nil nil nil)
  (modify-face (quote font-lock-type-face) "YellowGreen"
        nil nil t nil nil nil nil)

  (setq fill-column 78)
  )
      )

 

Revise this Paste

Parent: 37493
Your Name: Code Language: