[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#32457: 26.1.50; automatically set indent-tabs-mode from .gitattribut
From: |
Rudolf Schlatte |
Subject: |
bug#32457: 26.1.50; automatically set indent-tabs-mode from .gitattributes |
Date: |
Wed, 18 May 2022 16:22:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.1 (darwin) |
Robert Pluim <rpluim@gmail.com> writes:
>>>>>> On Wed, 18 May 2022 14:18:09 +0200, Lars Ingebrigtsen <larsi@gnus.org>
>>>>>> said:
>
> Lars> Tom Tromey <tom@tromey.com> writes:
> >> git can be configured to complain about indenting with tabs
> >> by using "whitespace=tab-in-indent" in .gitattributes.
> >>
> >> It would be nice if Emacs automatically detected this and set
> >> indent-tabs-mode to nil.
> >>
> >> git attributes can be queried using "git check-attr", for instance:
> >>
> >> $ git check-attr whitespace --
> src/librustc_codegen_llvm/debuginfo/metadata.rs
> >> src/librustc_codegen_llvm/debuginfo/metadata.rs: whitespace:
> >> tab-in-indent,trailing-space,tabwidth=4
>
> Lars> (I'm going through old bug reports that unfortunately weren't
> resolved
> Lars> at the time.)
>
> Lars> I don't think this would be an appropriate feature for Emacs core
> -- it
> Lars> would be too surprising if Emacs was setting `indent-tabs-mode'
> based on
> Lars> external factors like this (and I'm sure there's a lot of other
> hints it
> Lars> could be taking from other VCs).
>
> Lars> It does sound like it could be a useful ELPA package, though, but
> I'm
> Lars> closing this wishlist item in the Emacs bug tracker.
>
> .dir-locals.el supports 'eval', so anyone who wants this could put it there.
There is also EditorConfig (https://editorconfig.org,
http://elpa.nongnu.org/nongnu/editorconfig.html) for setting
indent-tabs-mode and other variables according to a configuration file.