diff options
-rw-r--r-- | Makefile.am | 8 | ||||
-rw-r--r-- | curl-style.el | 50 | ||||
-rw-r--r-- | sample.emacs | 45 |
3 files changed, 4 insertions, 99 deletions
diff --git a/Makefile.am b/Makefile.am index 484e4df20..cbe983ffd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. +# Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -34,9 +34,9 @@ WINBUILD_DIST = winbuild/BUILD.WINDOWS.txt winbuild/gen_resp_file.bat \ winbuild/MakefileBuild.vc winbuild/Makefile.vc EXTRA_DIST = CHANGES COPYING maketgz Makefile.dist curl-config.in \ - curl-style.el sample.emacs RELEASE-NOTES buildconf \ - libcurl.pc.in vc6curl.dsw MacOSX-Framework Android.mk $(CMAKE_DIST) \ - Makefile.msvc.names $(WINBUILD_DIST) lib/libcurl.vers.in + RELEASE-NOTES buildconf libcurl.pc.in vc6curl.dsw MacOSX-Framework \ + Android.mk $(CMAKE_DIST) Makefile.msvc.names $(WINBUILD_DIST) \ + lib/libcurl.vers.in bin_SCRIPTS = curl-config diff --git a/curl-style.el b/curl-style.el deleted file mode 100644 index 83cf8cc31..000000000 --- a/curl-style.el +++ /dev/null @@ -1,50 +0,0 @@ -;;;; Emacs Lisp help for writing curl code. ;;;; - -;;; The curl hacker's C conventions. -;;; See the sample.emacs file on how this file can be made to take -;;; effect automatically when editing curl source files. - -(defconst curl-c-style - '((c-basic-offset . 2) - (c-comment-only-line-offset . 0) - (c-hanging-braces-alist . ((substatement-open before after))) - (c-offsets-alist . ((topmost-intro . 0) - (topmost-intro-cont . 0) - (substatement . +) - (substatement-open . 0) - (statement-case-intro . +) - (statement-case-open . 0) - (case-label . 0) - )) - ) - "Curl C Programming Style") - -(defun curl-code-cleanup () - "no docs" - (interactive) - (untabify (point-min) (point-max)) - (delete-trailing-whitespace) -) - -;; Customizations for all of c-mode, c++-mode, and objc-mode -(defun curl-c-mode-common-hook () - "Curl C mode hook" - ;; add curl style and set it for the current buffer - (c-add-style "curl" curl-c-style t) - (setq tab-width 8 - indent-tabs-mode nil ; Use spaces. Not tabs. - comment-column 40 - 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")) - ) - ;; keybindings for C, C++, and Objective-C. We can put these in - ;; c-mode-base-map because of inheritance ... - (define-key c-mode-base-map "\M-q" 'c-fill-paragraph) - (define-key c-mode-base-map "\M-m" 'curl-code-cleanup) - (setq c-recognize-knr-p nil) - ;;; (add-hook 'write-file-hooks 'delete-trailing-whitespace t) - (setq show-trailing-whitespace t) - ) - -;; Set this is in your .emacs if you want to use the c-mode-hook as -;; defined here right out of the box. -; (add-hook 'c-mode-common-hook 'curl-c-mode-common-hook) diff --git a/sample.emacs b/sample.emacs deleted file mode 100644 index e4470fe9e..000000000 --- a/sample.emacs +++ /dev/null @@ -1,45 +0,0 @@ - -;; This file was contributed by Mats Lidell - -;; Here's a sample .emacs file that might help you along the way. - -;; First comes a setup that is ideal when you are only working with curl. Just -;; select the next few lines, paste it into your .emacs and change the path to -;; the tools folder. (If you are using more than one style. Look further down -;; this file.) - -(load-file "<YOUR-PATH-TO-CURL>/curl-style.el") -(add-hook 'c-mode-common-hook 'curl-c-mode-common-hook) - -;; If you are using more than one style in maybe more than one project the -;; example below might help out. It uses a predicate hook pair to select the -;; right hook to use. - -(defvar my-style-selective-mode-hook nil - "Holds a list of predicate and hooks pairs. (list (PREDICATE . HOOK) -...) It is used by my-mode-selective-mood-hook-function for choosing -the right hook to run.") - -(defun my-style-selective-mode-hook-function () - "Run each PREDICATE in `my-style-selective-mode-hook' to see if the -HOOK in the pair should be executed. If the PREDICATE evaluate to non -nil HOOK is executed and the rest of the hooks are ignored." - (let ((h my-style-selective-mode-hook)) - (while (not (eval (caar h))) - (setq h (cdr h))) - (funcall (cdar h)))) - -;;; Example configuration. -;; Add the selective hook to the c-mode-common-hook -(add-hook 'c-mode-common-hook 'my-style-selective-mode-hook-function) - -;; Add your own hooks and predicates. The predicate should evaluate to -;; non nil if the hook in the pair is supposed to be evaluated. In the -;; example a part of the path is used to select what style to -;; use. Choose what is appropriate for you. -(add-hook 'my-style-selective-mode-hook - '((string-match "curl" (buffer-file-name)) . curl-c-mode-common-hook)) -(add-hook 'my-style-selective-mode-hook - '((string-match "other" (buffer-file-name)) . other-c-mode-common-hook)) -;; Make sure the default style is appended. -(add-hook 'my-style-selective-mode-hook '(t . my-c-mode-common-hook) t) |