geom_gate userland utility improvements
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

52 lines
1.9 KiB

  1. ;;;; Emacs Lisp help for writing libssh2 code. ;;;;
  2. ;;;; $Id: libssh2-style.el,v 1.1 2008/12/20 12:36:50 bagder Exp $
  3. ;;; The libssh2 hacker's C conventions.
  4. ;;; See the sample.emacs file on how this file can be made to take
  5. ;;; effect automatically when editing libssh2 source files.
  6. (defconst libssh2-c-style
  7. '((c-basic-offset . 4)
  8. (c-comment-only-line-offset . 0)
  9. (c-hanging-braces-alist . ((substatement-open before after)))
  10. (c-offsets-alist . ((topmost-intro . 0)
  11. (topmost-intro-cont . 0)
  12. (substatement . +)
  13. (substatement-open . 0)
  14. (statement-case-intro . +)
  15. (statement-case-open . 0)
  16. (case-label . 0)
  17. ))
  18. )
  19. "Libssh2 C Programming Style")
  20. (defun libssh2-code-cleanup ()
  21. "tabify and delete trailing whitespace"
  22. (interactive)
  23. (untabify (point-min) (point-max))
  24. (delete-trailing-whitespace)
  25. )
  26. ;; Customizations for all of c-mode, c++-mode, and objc-mode
  27. (defun libssh2-c-mode-common-hook ()
  28. "Libssh2 C mode hook"
  29. ;; add libssh2 style and set it for the current buffer
  30. (c-add-style "libssh2" libssh2-c-style t)
  31. (setq tab-width 8
  32. indent-tabs-mode nil ; Use spaces, not tabs.
  33. comment-column 40
  34. c-font-lock-extra-types (append '("libssh2_int64_t" "LIBSSH2_USERAUTH_KBDINT_PROMPT" "LIBSSH2_SESSION" "LIBSSH2_CHANNEL" "ssize_t" "size_t" "uint32_t" "LIBSSH2_LISTENER" "LIBSSH2_POLLFD"))
  35. )
  36. ;; keybindings for C, C++, and Objective-C. We can put these in
  37. ;; c-mode-base-map because of inheritance ...
  38. (define-key c-mode-base-map "\M-q" 'c-fill-paragraph)
  39. (define-key c-mode-base-map "\M-m" 'libssh2-code-cleanup)
  40. (setq c-recognize-knr-p nil)
  41. ;;; (add-hook 'write-file-hooks 'delete-trailing-whitespace t)
  42. (setq show-trailing-whitespace t)
  43. )
  44. ;; Set this is in your .emacs if you want to use the c-mode-hook as
  45. ;; defined here right out of the box.
  46. ; (add-hook 'c-mode-common-hook 'libssh2-c-mode-common-hook)