Improvements to clang-format integrations.

This adds an emacs editor integration (thanks to Ami Fischman). Also
pulls out the style into a variable for the vi integration and just
uses clang-formats defaults style in clang-format-diff.py.

git-svn-id: svn://svn.chromium.org/llvm-project/cfe/trunk/tools/clang-format@179098 0b72dbe1-c17f-4bc7-b9db-2b4152be0356
diff --git a/clang-format-diff.py b/clang-format-diff.py
index ab5f1b1..16c6ad2 100755
--- a/clang-format-diff.py
+++ b/clang-format-diff.py
@@ -63,9 +63,10 @@
   offset, length = getOffsetLength(filename, line_number, line_count)
   with open(filename, 'r') as f:
     text = f.read()
-  p = subprocess.Popen([binary, '-offset', str(offset), '-length', str(length),
-                        '-style', style],
-                       stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+  command = [binary, '-offset', str(offset), '-length', str(length)]
+  if style:
+    command.append('-style', style)
+  p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                        stdin=subprocess.PIPE)
   stdout, stderr = p.communicate(input=text)
   if stderr:
@@ -84,8 +85,7 @@
                                    'Reformat changed lines in diff')
   parser.add_argument('-p', default=1,
                       help='strip the smallest prefix containing P slashes')
-  parser.add_argument('-style', default='LLVM',
-                      help='formatting style to apply (LLVM, Google)')
+  parser.add_argument('-style', help='formatting style to apply (LLVM, Google)')
   args = parser.parse_args()
 
   filename = None