Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: trunk/src/third_party/clang_format/scripts/clang-format.el

Issue 135793002: Revert 244398 "Revert of https://codereview.chromium.org/111953007/" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 ;;; Clang-format emacs integration for use with C/Objective-C/C++. 1 ;;; Clang-format emacs integration for use with C/Objective-C/C++.
2 2
3 ;; This defines a function clang-format-region that you can bind to a key. 3 ;; This defines a function clang-format-region that you can bind to a key.
4 ;; A minimal .emacs would contain: 4 ;; A minimal .emacs would contain:
5 ;; 5 ;;
6 ;; (load "<path-to-clang>/tools/clang-format/clang-format.el") 6 ;; (load "<path-to-clang>/tools/clang-format/clang-format.el")
7 ;; (global-set-key [C-M-tab] 'clang-format-region) 7 ;; (global-set-key [C-M-tab] 'clang-format-region)
8 ;; 8 ;;
9 ;; Depending on your configuration and coding style, you might need to modify 9 ;; Depending on your configuration and coding style, you might need to modify
10 ;; 'style' in clang-format, below. 10 ;; 'style' in clang-format, below.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 "-style" style) 47 "-style" style)
48 (goto-char (point-min)) 48 (goto-char (point-min))
49 (let ((json-output (json-read-from-string 49 (let ((json-output (json-read-from-string
50 (buffer-substring-no-properties 50 (buffer-substring-no-properties
51 (point-min) (line-beginning-position 2))))) 51 (point-min) (line-beginning-position 2)))))
52 (delete-region (point-min) (line-beginning-position 2)) 52 (delete-region (point-min) (line-beginning-position 2))
53 (goto-char (1+ (cdr (assoc 'Cursor json-output)))) 53 (goto-char (1+ (cdr (assoc 'Cursor json-output))))
54 (dotimes (index (length orig-windows)) 54 (dotimes (index (length orig-windows))
55 (set-window-start (nth index orig-windows) 55 (set-window-start (nth index orig-windows)
56 (nth index orig-window-starts))))))) 56 (nth index orig-window-starts)))))))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698