Skip to content

Instantly share code, notes, and snippets.

@take-cheeze
Created October 20, 2012 08:54
Show Gist options
  • Select an option

  • Save take-cheeze/3922717 to your computer and use it in GitHub Desktop.

Select an option

Save take-cheeze/3922717 to your computer and use it in GitHub Desktop.
;; git core.whitespace
(add-hook
'c-mode-common-hook
(lambda()
(let (core-whitespace)
(setq core-whitespace
(shell-command-to-string
(concat "git --exec-path="
(file-name-directory (buffer-file-name))
" config core.whitespace")))
(print core-whitespace)
(if (string-match "tab-in-indent" core-whitespace)
(progn
(setq indent-tabs-mode t)))
(if (string-match "indent-with-non-tab" core-whitespace)
(progn
(setq indent-tabs-mode nil)))
(if (string-match "tabwidth=\\([\\[0-9+\\]\\)" core-whitespace)
(progn
(setq tab-width (string-to-number
(match-string 1 core-whitespace)))
(setq c-basic-offset tab-width)
(setq c-tab-offset tab-width)
))
)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment