[PATCH] clang-format.el: customization-support, MELPA-compatibility

Manuel Klimek klimek at google.com
Wed Jan 7 08:14:31 PST 2015


+If called interactively uses the region or the current buffer if there
+is no active region.  If no style is given uses `clang-format-style'."

Doing full-buffer if nothing is selected is a usability problem if one
works in an existing codebase; if no region is selected, it should just use
the cursor position (which will get the current statement reflowed).
The idea is that the user can do clang-format-buffer if they insist.

+(put 'clang-format-executable 'risky-local-variable t)

Any reason not to use :risky in the defcustom?

Otherwise looks good; the main concern is using the full buffer if no
region is specified.

On Mon Jan 05 2015 at 3:02:16 PM Daniel Jasper <djasper at google.com> wrote:

> I really don't know enough emacs lisp to review this patch. Manuel, can
> you take a look?
>
> On Sat, Jan 3, 2015 at 9:27 AM, Daniel Jasper <djasper at google.com> wrote:
>
>> I don't know much about emacs at all, but I'll experiment a bit with this
>> patch on monday. This certainly seems like a great improvement. Thanks for
>> working on it.
>>
>> On Fri, Jan 2, 2015 at 12:13 AM, Rafael Espíndola <
>> rafael.espindola at gmail.com> wrote:
>>
>>> This looks really nice.
>>>
>>> Daniel, what do you think?
>>>
>>> On 29 December 2014 at 07:33, Johann Klähn <kljohann at gmail.com> wrote:
>>> > Hi all,
>>> >
>>> > Some time ago, I uploaded a package[1] with essentially the same
>>> > functionality as tools/clang-format/clang-format.el to the Emacs
>>> package
>>> > archive MELPA. My version has several usability improvements and it
>>> has been
>>> > requested[2] that those changes are consolidated with the version in
>>> the cfe
>>> > tree. I would be happy to sunset my repository if this patch is
>>> accepted and
>>> > have the MELPA-package point to the cfe version.
>>> >
>>> > * Includes file header/footer as required by MELPA
>>> > * Correctly handles buffers that are not associated with a file
>>> > * Displays stderr and exit code of clang-format process
>>> > * Is customizable via the Emacs customization interface and
>>> > file-/directory-local variables
>>> >
>>> > As this is my first patch to this list, feel free to point out any
>>> silly
>>> > mistakes I did. :)
>>> >
>>> > All the best,
>>> > Johann
>>> >
>>> > [1]: https://github.com/kljohann/clang-format.el
>>> > [2]: https://github.com/milkypostman/melpa/issues/2202 and
>>> > https://github.com/kljohann/clang-format.el/issues/2
>>> >
>>> > _______________________________________________
>>> > cfe-commits mailing list
>>> > cfe-commits at cs.uiuc.edu
>>> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>> >
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150107/a1bbd6ec/attachment.html>


More information about the cfe-commits mailing list