summaryrefslogtreecommitdiff
path: root/tools/clang-format/clang-format.el
Commit message (Collapse)AuthorAge
* clang-format: Add -assume-filename option for editor integrations.Daniel Jasper2013-09-13
| | | | | | | | | | | | | | With -style=file, clang-format now starts to search for a .clang-format file starting at the file given with -assume-filename if it reads from stdin. Otherwise, it would start searching from the current directory, which is not helpful for editor integrations. Also changed vim, emacs and sublime integrations to actually make use of this flag. This fixes llvm.org/PR17072. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190691 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch the default mode for clang-format to '-file'. Make 'LLVM' theChandler Carruth2013-09-02
| | | | | | | | | | | | | | | | | | | fallback syntax used when we fail to find a '.clang-format' file. Adjust variable names appropriately. Update the editor integration pieces that specify a '-style' option to specify it as '-style=file'. I left the functionality in place because even if the preferred method is to use '.clang-format' files, this way if someone needs to clobber the style in their editor we show how to do so in these examples. Also check in a '.clang-format' file for Clang to ensure that separate checkouts and builds of Clang from LLVM can still get the nice formatting. =] This unfortunately required nuking the test for the absence of a '.clang-format' file as now the directory happening to be under your clang source tree will cause there to always be a file. ;] git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189741 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to assign clang-format-buffer to a keybinding.Manuel Klimek2013-06-11
| | | | | | Patch by Chris Gray. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183739 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix off-by-one error in clang-format's emacs integration.Daniel Jasper2013-05-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182395 91177308-0d34-0410-b5e6-96231b3b80d8
* Let clang-format move the cursor appropriately.Daniel Jasper2013-05-21
| | | | | | | | | With this patch, clang-format will try to keep the cursor at the original code position in editor integrations (implemented for emacs and vim). This means, after formatting, clang-format will try to keep the cursor on the same character of the same token. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182373 91177308-0d34-0410-b5e6-96231b3b80d8
* Update clang-format emacs integration.Daniel Jasper2013-05-14
| | | | | | | | | | - Remove free variables - Add function clang-format-buffer, e.g. for before-save-hooks - Wrap restoring windows in an unwind-protect Patch by Stephen Gildea! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181766 91177308-0d34-0410-b5e6-96231b3b80d8
* Further fix to clang-format emacs integration.Daniel Jasper2013-05-07
| | | | | | | This is just a slight improvement for the fix in r181299, which fixes formatting the very last line of a file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181303 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix clang-format emacs integration in last line.Daniel Jasper2013-05-07
| | | | | | | | Emacs seems to have a line that is just past the last character of the buffers content. This needs to be handled specially so that clang-format is not called with an invalid -offset. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181299 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix scrolling bug in clang-format's emacs integration.Daniel Jasper2013-04-25
| | | | | | | This patch ensure that nothing scrolls even if the same buffer is opened in multiple windows. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180252 91177308-0d34-0410-b5e6-96231b3b80d8
* Small improvements to clang-format documentation and integrationDaniel Jasper2013-04-17
| | | | | | scripts. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179676 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide better emacs integration.Daniel Jasper2013-04-12
| | | | | | | | | | | The new emacs integration is simpler, does not save the current file before reformatting and ensures that emacs does not scroll as a result of formatting. Also explicitly set the style in clang-format tests to make them more robust. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179372 91177308-0d34-0410-b5e6-96231b3b80d8
* Improvements to clang-format integrations.Daniel Jasper2013-04-09
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: https://llvm.org/svn/llvm-project/cfe/trunk@179098 91177308-0d34-0410-b5e6-96231b3b80d8