[OpenAFS-devel] emacs tabification goo?

Jim Rees rees@umich.edu
Sat, 15 Nov 2003 21:29:56 -0500


I'm still using emacs 19, so this may not be useful to anyone else.
But here it is.  You can change the indent level by putting the cursor on
the first indent and typing C-x.

;; C mode stuff

(defun set-indent-level (arg)
  "Set C indent level."
  (interactive "NC indent level: ")
  (setq c-indent-level arg)
  (setq c-continued-statement-offset arg)
  (setq c-brace-offset (- arg))
  (setq c-label-offset (- arg)))

(defun set-indent-prefix ()
  "Set C indent level to current column."
  (interactive)
  (set-indent-level (current-column)))

(defun c-set-indent-prefix ()
  "Set C indent level to current column."
  (interactive)
  (setq c-basic-offset (current-column)))

(if (boundp 'c-mode-map)
    (define-key c-mode-map "\C-x." 'set-indent-prefix))

(setq c-argdecl-indent 0)
(set-indent-level 4)