Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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