diff options
author | Daniel Jasper <djasper@google.com> | 2013-04-17 07:55:02 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-04-17 07:55:02 +0000 |
commit | a50b57862b99bdd7d056014f429a809647257c8b (patch) | |
tree | b5e6068cf1bdd361f1b789b1fe5ab8973a4bdc73 /tools/clang-format/clang-format.el | |
parent | e68d9e08152bd246aa1d7da02a67efea81112707 (diff) | |
download | clang-a50b57862b99bdd7d056014f429a809647257c8b.tar.gz clang-a50b57862b99bdd7d056014f429a809647257c8b.tar.bz2 clang-a50b57862b99bdd7d056014f429a809647257c8b.tar.xz |
Small improvements to clang-format documentation and integration
scripts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/clang-format/clang-format.el')
-rw-r--r-- | tools/clang-format/clang-format.el | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/clang-format/clang-format.el b/tools/clang-format/clang-format.el index 1277885996..d58e40358b 100644 --- a/tools/clang-format/clang-format.el +++ b/tools/clang-format/clang-format.el @@ -3,7 +3,7 @@ ;; This defines a function clang-format-region that you can bind to a key. ;; A minimal .emacs would contain: ;; -;; (load "<path-to-clang>/tools/clang/clang-format/clang-format.el") +;; (load "<path-to-clang>/tools/clang-format/clang-format.el") ;; (global-set-key [C-M-tab] 'clang-format-region) ;; ;; Depending on your configuration and coding style, you might need to modify @@ -15,12 +15,12 @@ (binary "clang-format") (style "LLVM")) (if mark-active - (setq beg (1- (region-beginning)) - end (1- (region-end))) - (setq beg (1- (line-beginning-position)) - end (1- (line-end-position)))) - (call-process-region (point-min) (point-max) "clang-format" t t nil - "-offset" (number-to-string beg) + (setq beg (region-beginning) + end (region-end)) + (setq beg (line-beginning-position) + end (line-end-position))) + (call-process-region (point-min) (point-max) binary t t nil + "-offset" (number-to-string (1- beg)) "-length" (number-to-string (- end beg)) "-style" style) (goto-char orig-point) |