code_junkie

Easy to extend IDE for C

Nov 11th, 2011
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. ;; the indention-thing needs refining
  2. (defun pm-if ()
  3. "generates if stub"
  4. (interactive)
  5. (insert "if () {")
  6. (indent-according-to-mode)
  7. (newline)
  8. (indent-according-to-mode)
  9. (newline)
  10. (indent-according-to-mode)
  11. (insert "} /* endif */")
  12. (indent-according-to-mode)
  13. (newline)
  14. (indent-according-to-mode)
  15. (previous-line 3)
  16. (end-of-line)
  17. (goto-char (- (point) 3))
  18. )
  19.  
  20.  
  21. ;; bind it to CTRL-c i
  22. (define-key Ctl-C-keymap "i" 'pm-if)
Add Comment
Please, Sign In to add comment