Emacs: Fix cc-fmt (workaround)

Uncrustify is supposed to load ~/.uncrustify.cfg by default.
Since 0.64 at least it does not seem to work, so we specify it manually.
master
Pierre Neidhardt 2017-02-15 13:41:15 +01:00
parent babe5876d6
commit 50e3815b2d
1 changed files with 2 additions and 2 deletions

View File

@ -60,9 +60,9 @@ restored."
(let ((status)
(formatbuf (get-buffer-create "*C format buffer*")))
(setq status
(call-process-region (point) (mark) "uncrustify" nil formatbuf nil "-lc" "-q"))
(call-process-region (point) (mark) "uncrustify" nil formatbuf nil "-lc" "-q" "-c" (concat (getenv "HOME") "/.uncrustify.cfg")))
(if (/= status 0)
(error "Bad formatted C file")
(error "error running uncrustify")
(delete-region (point) (mark))
(insert-buffer formatbuf)
(kill-buffer formatbuf))))