Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 44 lines (39 sloc) 1.597 kb
57e61e3 @bagder This is the new Emacs style for curl hacking, based on work written by
authored
1 ;;;; Emacs Lisp help for writing curl code. ;;;;
2 ;;;; $Id$
3
4 ;;; The curl hacker's C conventions.
0e60a11 @bagder better comments, added some more variable types we use in the font-lock
authored
5 ;;; See the sample.emacs file on how this file can be made to take
6 ;;; effect automatically when editing curl source files.
57e61e3 @bagder This is the new Emacs style for curl hacking, based on work written by
authored
7
8 (defconst curl-c-style
9 '((c-basic-offset . 2)
10 (c-comment-only-line-offset . 0)
11 (c-hanging-braces-alist . ((substatement-open before after)))
12 (c-offsets-alist . ((topmost-intro . 0)
13 (topmost-intro-cont . 0)
14 (substatement . +)
15 (substatement-open . 0)
16 (statement-case-intro . +)
17 (statement-case-open . 0)
18 (case-label . 0)
19 ))
20 )
21 "Curl C Programming Style")
22
23 ;; Customizations for all of c-mode, c++-mode, and objc-mode
24 (defun curl-c-mode-common-hook ()
25 "Curl C mode hook"
26 ;; add curl style and set it for the current buffer
27 (c-add-style "curl" curl-c-style t)
28 (setq tab-width 8
29 indent-tabs-mode nil ; Use spaces. Not tabs.
30 comment-column 40
0e60a11 @bagder better comments, added some more variable types we use in the font-lock
authored
31 c-font-lock-extra-types (append '("bool" "CURL" "CURLcode" "ssize_t" "size_t" "socklen_t" "fd_set" "time_t" "curl_off_t" "curl_socket_t" "in_addr_t" "CURLSHcode" "CURLMcode"))
57e61e3 @bagder This is the new Emacs style for curl hacking, based on work written by
authored
32 )
33 ;; keybindings for C, C++, and Objective-C. We can put these in
34 ;; c-mode-base-map because of inheritance ...
35 (define-key c-mode-base-map "\M-q" 'c-fill-paragraph)
36 (setq c-recognize-knr-p nil)
bd3aba5 @bagder The kill trailing whitespace needs to be set better as this way it takes
authored
37 ;;; (add-hook 'write-file-hooks 'delete-trailing-whitespace t)
c090fdb @bagder automatically delete trailing white space on save in curl-mode
authored
38 (setq show-trailing-whitespace t)
57e61e3 @bagder This is the new Emacs style for curl hacking, based on work written by
authored
39 )
40
41 ;; Set this is in your .emacs if you want to use the c-mode-hook as
42 ;; defined here right out of the box.
43 ; (add-hook 'c-mode-common-hook 'curl-c-mode-common-hook)
Something went wrong with that request. Please try again.