[Mesa-dev] [PATCH] freedreno: Fix emacs modeline

Eric Engestrom eric.engestrom at intel.com
Wed Oct 17 15:00:05 UTC 2018


On Wednesday, 2018-10-17 15:48:41 +0200, Neil Roberts wrote:
> The modeline was missing a ‘:’ after the tab-width and Emacs was
> complaining every time you open a file. This patch was made with:
> 
> sed -ri '1 s/; tab-width ([0-9])/; tab-width: \1/' \
>     $(find -name \*.\[ch\] -exec grep -l -- '-\*- mode:' {} \+)
> ---
[snip]
> 
> diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_blend.c b/src/gallium/drivers/freedreno/a2xx/fd2_blend.c
> index 4e991794f07..48bd395b594 100644
> --- a/src/gallium/drivers/freedreno/a2xx/fd2_blend.c
> +++ b/src/gallium/drivers/freedreno/a2xx/fd2_blend.c
> @@ -1,4 +1,4 @@
> -/* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
> +/* -*- mode: C; c-file-style: "k&r"; tab-width: 4; indent-tabs-mode: t; -*- */

You might want to remove these instead, and use the .editorconfig [1]
already present at src/gallium/drivers/freedreno/.editorconfig
This is much easier to maintain than per-files settings ;)

The website [1] has a link for a plugin for Emacs since it appears to
lack native support, but if you're ok with installing a plugin, this
should be a good solution for you :)

[1] https://editorconfig.org


More information about the mesa-dev mailing list