[Mesa-dev] [PATCH] dir-locals.el: use appropriate style and stop unsafe warning

Damien Grassart damien at grassart.com
Mon Mar 6 16:36:16 UTC 2017


Actually please ignore this, cc-mode does not actually work the way I
thought it should. Sorry for the noise.

On Mon, Mar 6, 2017 at 1:00 PM, Damien Grassart <damien at grassart.com> wrote:
> This updates the c-file-style for directories that appear to use Linux
> kernel style rather than the Stroustrup style, and adds a
> .dir-locals.el and .editorconfig for the radv driver.
>
> Also changes the mode from prog-mode to the less generic cc-mode so
> that Emacs doesn't warn about unsafe variables.
>
> Signed-off-by: Damien Grassart <damien at grassart.com>
> ---
>  .dir-locals.el                                    |  2 +-
>  src/amd/vulkan/.dir-locals.el                     | 11 +++++++++++
>  src/amd/vulkan/.editorconfig                      |  2 ++
>  src/gallium/drivers/freedreno/.dir-locals.el      |  2 +-
>  src/gallium/drivers/r600/.dir-locals.el           |  4 ++--
>  src/gallium/drivers/radeon/.dir-locals.el         |  4 ++--
>  src/gallium/drivers/radeonsi/.dir-locals.el       |  4 ++--
>  src/gallium/drivers/swr/rasterizer/.dir-locals.el |  2 +-
>  src/gallium/drivers/vc4/.dir-locals.el            |  2 +-
>  src/gallium/drivers/vc4/kernel/.dir-locals.el     |  4 ++--
>  src/gallium/winsys/radeon/.dir-locals.el          |  2 +-
>  src/mesa/drivers/dri/nouveau/.dir-locals.el       |  4 ++--
>  12 files changed, 28 insertions(+), 15 deletions(-)
>  create mode 100644 src/amd/vulkan/.dir-locals.el
>  create mode 100644 src/amd/vulkan/.editorconfig
>
> diff --git a/.dir-locals.el b/.dir-locals.el
> index 5340c3ae23..6542227271 100644
> --- a/.dir-locals.el
> +++ b/.dir-locals.el
> @@ -1,5 +1,5 @@
>  ((nil . ((show-trailing-whitespace . t)))
> - (prog-mode
> + (cc-mode
>    (indent-tabs-mode . nil)
>    (tab-width . 8)
>    (c-basic-offset . 3)
> diff --git a/src/amd/vulkan/.dir-locals.el b/src/amd/vulkan/.dir-locals.el
> new file mode 100644
> index 0000000000..f48a45616d
> --- /dev/null
> +++ b/src/amd/vulkan/.dir-locals.el
> @@ -0,0 +1,11 @@
> +((cc-mode
> +  (indent-tabs-mode . true)
> +  (tab-width . 8)
> +  (c-basic-offset . 8)
> +  (c-file-style . "linux")
> +  (fill-column . 78)
> +  (eval . (progn
> +           (c-set-offset 'innamespace '0)
> +           (c-set-offset 'inline-open '0)))
> +  )
> + )
> diff --git a/src/amd/vulkan/.editorconfig b/src/amd/vulkan/.editorconfig
> new file mode 100644
> index 0000000000..cc8e11ffd6
> --- /dev/null
> +++ b/src/amd/vulkan/.editorconfig
> @@ -0,0 +1,2 @@
> +[*.{c,h}]
> +indent_style = tab
> diff --git a/src/gallium/drivers/freedreno/.dir-locals.el b/src/gallium/drivers/freedreno/.dir-locals.el
> index aa20d49546..dbc584b7b1 100644
> --- a/src/gallium/drivers/freedreno/.dir-locals.el
> +++ b/src/gallium/drivers/freedreno/.dir-locals.el
> @@ -1,4 +1,4 @@
> -((prog-mode
> +((cc-mode
>    (indent-tabs-mode . true)
>    (tab-width . 4)
>    (c-basic-offset . 4)
> diff --git a/src/gallium/drivers/r600/.dir-locals.el b/src/gallium/drivers/r600/.dir-locals.el
> index 4e35c129e7..f48a45616d 100644
> --- a/src/gallium/drivers/r600/.dir-locals.el
> +++ b/src/gallium/drivers/r600/.dir-locals.el
> @@ -1,8 +1,8 @@
> -((prog-mode
> +((cc-mode
>    (indent-tabs-mode . true)
>    (tab-width . 8)
>    (c-basic-offset . 8)
> -  (c-file-style . "stroustrup")
> +  (c-file-style . "linux")
>    (fill-column . 78)
>    (eval . (progn
>             (c-set-offset 'innamespace '0)
> diff --git a/src/gallium/drivers/radeon/.dir-locals.el b/src/gallium/drivers/radeon/.dir-locals.el
> index 4e35c129e7..f48a45616d 100644
> --- a/src/gallium/drivers/radeon/.dir-locals.el
> +++ b/src/gallium/drivers/radeon/.dir-locals.el
> @@ -1,8 +1,8 @@
> -((prog-mode
> +((cc-mode
>    (indent-tabs-mode . true)
>    (tab-width . 8)
>    (c-basic-offset . 8)
> -  (c-file-style . "stroustrup")
> +  (c-file-style . "linux")
>    (fill-column . 78)
>    (eval . (progn
>             (c-set-offset 'innamespace '0)
> diff --git a/src/gallium/drivers/radeonsi/.dir-locals.el b/src/gallium/drivers/radeonsi/.dir-locals.el
> index 4e35c129e7..f48a45616d 100644
> --- a/src/gallium/drivers/radeonsi/.dir-locals.el
> +++ b/src/gallium/drivers/radeonsi/.dir-locals.el
> @@ -1,8 +1,8 @@
> -((prog-mode
> +((cc-mode
>    (indent-tabs-mode . true)
>    (tab-width . 8)
>    (c-basic-offset . 8)
> -  (c-file-style . "stroustrup")
> +  (c-file-style . "linux")
>    (fill-column . 78)
>    (eval . (progn
>             (c-set-offset 'innamespace '0)
> diff --git a/src/gallium/drivers/swr/rasterizer/.dir-locals.el b/src/gallium/drivers/swr/rasterizer/.dir-locals.el
> index 2b04c18a9b..9e09ee81e6 100644
> --- a/src/gallium/drivers/swr/rasterizer/.dir-locals.el
> +++ b/src/gallium/drivers/swr/rasterizer/.dir-locals.el
> @@ -1,4 +1,4 @@
> -((prog-mode
> +((cc-mode
>    (c-basic-offset . 4)
>    (c-file-style . "k&r")
>    (fill-column . 78)
> diff --git a/src/gallium/drivers/vc4/.dir-locals.el b/src/gallium/drivers/vc4/.dir-locals.el
> index ac94242d70..d3bb0f5874 100644
> --- a/src/gallium/drivers/vc4/.dir-locals.el
> +++ b/src/gallium/drivers/vc4/.dir-locals.el
> @@ -1,4 +1,4 @@
> -((prog-mode
> +((cc-mode
>    (indent-tabs-mode . nil)
>    (tab-width . 8)
>    (c-basic-offset . 8)
> diff --git a/src/gallium/drivers/vc4/kernel/.dir-locals.el b/src/gallium/drivers/vc4/kernel/.dir-locals.el
> index 49403de246..a955945716 100644
> --- a/src/gallium/drivers/vc4/kernel/.dir-locals.el
> +++ b/src/gallium/drivers/vc4/kernel/.dir-locals.el
> @@ -1,8 +1,8 @@
> -((prog-mode
> +((cc-mode
>    (indent-tabs-mode . t)
>    (tab-width . 8)
>    (c-basic-offset . 8)
> -  (c-file-style . "stroustrup")
> +  (c-file-style . "linux")
>    (fill-column . 78)
>    (eval . (progn
>             (c-set-offset 'innamespace '0)
> diff --git a/src/gallium/winsys/radeon/.dir-locals.el b/src/gallium/winsys/radeon/.dir-locals.el
> index d5f0f04332..9fcbdc985c 100644
> --- a/src/gallium/winsys/radeon/.dir-locals.el
> +++ b/src/gallium/winsys/radeon/.dir-locals.el
> @@ -1,4 +1,4 @@
> -((prog-mode
> +((cc-mode
>    (indent-tabs-mode . nil)
>    (tab-width . 8)
>    (c-basic-offset . 4)
> diff --git a/src/mesa/drivers/dri/nouveau/.dir-locals.el b/src/mesa/drivers/dri/nouveau/.dir-locals.el
> index 774f023ae6..7b1af6f3f4 100644
> --- a/src/mesa/drivers/dri/nouveau/.dir-locals.el
> +++ b/src/mesa/drivers/dri/nouveau/.dir-locals.el
> @@ -1,8 +1,8 @@
> -((prog-mode
> +((cc-mode
>    (indent-tabs-mode . true)
>    (tab-width . 8)
>    (c-basic-offset . 8)
> -  (c-file-style . "stroustrup")
> +  (c-file-style . "linux")
>    (fill-column . 78)
>    )
>   )
> --
> 2.12.0
>


More information about the mesa-dev mailing list