Re: [Mesa-dev] [PATCH] Fix automatic indentation mode for recent emacs, use fewer columns in .git

2015-04-08 Thread Carl Worth
On Wed, Apr 08 2015, Neil Roberts wrote:
> It seems a bit strange that this has stopped working for you.

Yes. I don't understand exactly what's going on.

> mode. The C and C++ modes both inherit from prog-mode, as well as a
> bunch of other ones such as Python and lisp files.

That's what I guessed, (given that we have "prog-mode" in our files). I
tried investigating a little bit, but didn't get too far.

From an editor session editing an emacs file, (whether my standard
environment or with "emacs -q"), "M-x describe-mode" says:

C/l mode:
Major mode for editing K&R and ANSI C code.

Which looks pretty standard to me. But I don't know what the identifier
for this mode would be to specify it in the .dir-locals.el file nor what
modes it inherits from.

> If you are using a
> non-standard mode for C files it would be surprising if it doesn't also
> inherit from prog-mode. I have just tested this with emacs -q (to
> prevent it from loading my personal config) on Emacs 24.3.1 and it does
> work as is.

No non-standard mode here, (at least not intentionally). And I also
verified the behavior is the same with "emacs -q". Maybe there's a
Debian-specific bug that I'm hitting here?

> I don't think the patch would break anything for me since you explicitly
> set the fill-column back to 70 for commit messages so I don't care
> enough to complain if you want to commit it anyway, but it does seem
> like something fishy is going on and the reasoning in the commit message
> doesn't add up.

I won't disagree there. I don't know the actual root cause, but since
this fixes an actual problem for me, and we haven't identified any
negative side effects, I'll plan to commit this change.

And if anyone can diagnose the root cause and improve .dir-locals.el
further, that will be fine too.

-Carl


pgpD6Q3OM6D8Y.pgp
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] Fix automatic indentation mode for recent emacs, use fewer columns in .git

2015-04-08 Thread Neil Roberts
It seems a bit strange that this has stopped working for you. If you
specify a mode in the .dir-locals.el file then it's supposed to set the
variable for any files with that mode or any modes inherited from that
mode. The C and C++ modes both inherit from prog-mode, as well as a
bunch of other ones such as Python and lisp files. If you are using a
non-standard mode for C files it would be surprising if it doesn't also
inherit from prog-mode. I have just tested this with emacs -q (to
prevent it from loading my personal config) on Emacs 24.3.1 and it does
work as is.

I don't think the patch would break anything for me since you explicitly
set the fill-column back to 70 for commit messages so I don't care
enough to complain if you want to commit it anyway, but it does seem
like something fishy is going on and the reasoning in the commit message
doesn't add up.

Regards,
- Neil

Carl Worth  writes:

> I recently noticed (after upgrading to emacs 24?) that I was no longer
> getting automatic C-style settings in emacs like I was accustomed to
> getting. That is, I was now getting a default indentation of 8 and
> indentation with tabs instead of spaces.
>
> It appears that the .dir-locals.el file is no longer taking
> effect. Presumably, emacs was previously using "prog-mode" for C and
> C++ source files but is now using a mode with some other name?
>
> I didn't chase down the name of the current mode, but just using "nil"
> makes these variables get set on all files, (which should be mostly
> harmless), and should be compatible with both old and new emacs.
>
> I did verify that the later change in this file (to indent with tabs
> when in makefile-mode) still takes precendence as desired.
>
> While editing these files, I've also set things up to use a smaller
> value for fill-column when editing a file within the ".git"
> directory. This will help avoid commit messages getting wrapped when
> "git log" adds some extra indentation.
>
> Note: If this change causes .dir-locals.el to take effect for someone
> when it never had before, then emacs may prompt about the potentially
> "unsafe" eval block here. User can reply to that prompt with "!" to
> permanently whitelist this particular eval block as safe so that
> prompt will not be seen again in the future.
> ---
>  .dir-locals.el| 4 ++--
>  src/gallium/drivers/freedreno/.dir-locals.el  | 2 +-
>  src/gallium/drivers/r600/.dir-locals.el   | 2 +-
>  src/gallium/drivers/radeon/.dir-locals.el | 2 +-
>  src/gallium/drivers/radeonsi/.dir-locals.el   | 2 +-
>  src/gallium/drivers/vc4/.dir-locals.el| 2 +-
>  src/gallium/drivers/vc4/kernel/.dir-locals.el | 2 +-
>  src/gallium/winsys/radeon/.dir-locals.el  | 2 +-
>  src/mesa/drivers/dri/nouveau/.dir-locals.el   | 2 +-
>  9 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/.dir-locals.el b/.dir-locals.el
> index d95eb48..f44d964 100644
> --- a/.dir-locals.el
> +++ b/.dir-locals.el
> @@ -1,12 +1,12 @@
> -((prog-mode
> +((nil
>(indent-tabs-mode . nil)
>(tab-width . 8)
>(c-basic-offset . 3)
>(c-file-style . "stroustrup")
> -  (fill-column . 78)
>(eval . (progn
>   (c-set-offset 'innamespace '0)
>   (c-set-offset 'inline-open '0)))
>)
> + (".git" (nil (fill-column . 70)))
>   (makefile-mode (indent-tabs-mode . t))
>   )
> diff --git a/src/gallium/drivers/freedreno/.dir-locals.el 
> b/src/gallium/drivers/freedreno/.dir-locals.el
> index aa20d49..c26578b 100644
> --- a/src/gallium/drivers/freedreno/.dir-locals.el
> +++ b/src/gallium/drivers/freedreno/.dir-locals.el
> @@ -1,4 +1,4 @@
> -((prog-mode
> +((nil
>(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 4e35c12..8be6a30 100644
> --- a/src/gallium/drivers/r600/.dir-locals.el
> +++ b/src/gallium/drivers/r600/.dir-locals.el
> @@ -1,4 +1,4 @@
> -((prog-mode
> +((nil
>(indent-tabs-mode . true)
>(tab-width . 8)
>(c-basic-offset . 8)
> diff --git a/src/gallium/drivers/radeon/.dir-locals.el 
> b/src/gallium/drivers/radeon/.dir-locals.el
> index 4e35c12..8be6a30 100644
> --- a/src/gallium/drivers/radeon/.dir-locals.el
> +++ b/src/gallium/drivers/radeon/.dir-locals.el
> @@ -1,4 +1,4 @@
> -((prog-mode
> +((nil
>(indent-tabs-mode . true)
>(tab-width . 8)
>(c-basic-offset . 8)
> diff --git a/src/gallium/drivers/radeonsi/.dir-locals.el 
> b/src/gallium/drivers/radeonsi/.dir-locals.el
> index 4e35c12..8be6a30 100644
> --- a/src/gallium/drivers/radeonsi/.dir-locals.el
> +++ b/src/gallium/drivers/radeonsi/.dir-locals.el
> @@ -1,4 +1,4 @@
> -((prog-mode
> +((nil
>(indent-tabs-mode . true)
>(tab-width . 8)
>(c-basic-offset . 8)
> diff --git a/src/gallium/drivers/vc4/.dir-locals.el 
> b/src/gallium/drivers/vc4/.dir-locals.el
> index ac94242..ed10dc2 100644
> --- a/src/gallium/drivers/vc4/.dir-locals.el
> +++ b/src/gallium/dri

Re: [Mesa-dev] [PATCH] Fix automatic indentation mode for recent emacs, use fewer columns in .git

2015-04-03 Thread Carl Worth
On Fri, Apr 03 2015, Jordan Justen wrote:
>> -  (fill-column . 78)
>
> Do we want to remove this? Or does it match the default?

The default is actually 70. I didn't mean to have that part in the
commit. Thanks for noticing.

>> + (".git" (nil (fill-column . 70)))
>
> Should the commit subject line be under 70 characters? I notice that
> yours is 74. :)

Right. I don't use auto-fill, and I don't always hit the fill-paragraph
key if I'm only typing a single line.

> https://www.kernel.org/doc/Documentation/SubmittingPatches says the
> subject line should be limited to 70-75 characters.

Phew! I at least fit within the kernel guideline.

> Maybe the .git part should be moved that into a separate patch?

I thought about that, but in one sense, all of this mucking around with
trying to get emacs to behave in a sane way is somewhat off-topic for
mesa, so I thought keeping it in just one commit was more polite.

> Not a huge deal though, so,
> Reviewed-by: Jordan Justen 

Thanks.

-Carl


pgpkwl9DXKwgq.pgp
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] Fix automatic indentation mode for recent emacs, use fewer columns in .git

2015-04-03 Thread Jordan Justen
On 2015-04-02 14:38:53, Carl Worth wrote:
> I recently noticed (after upgrading to emacs 24?) that I was no longer
> getting automatic C-style settings in emacs like I was accustomed to
> getting. That is, I was now getting a default indentation of 8 and
> indentation with tabs instead of spaces.
> 
> It appears that the .dir-locals.el file is no longer taking
> effect. Presumably, emacs was previously using "prog-mode" for C and
> C++ source files but is now using a mode with some other name?
> 
> I didn't chase down the name of the current mode, but just using "nil"
> makes these variables get set on all files, (which should be mostly
> harmless), and should be compatible with both old and new emacs.
> 
> I did verify that the later change in this file (to indent with tabs
> when in makefile-mode) still takes precendence as desired.
> 
> While editing these files, I've also set things up to use a smaller
> value for fill-column when editing a file within the ".git"
> directory. This will help avoid commit messages getting wrapped when
> "git log" adds some extra indentation.
> 
> Note: If this change causes .dir-locals.el to take effect for someone
> when it never had before, then emacs may prompt about the potentially
> "unsafe" eval block here. User can reply to that prompt with "!" to
> permanently whitelist this particular eval block as safe so that
> prompt will not be seen again in the future.
> ---
>  .dir-locals.el| 4 ++--
>  src/gallium/drivers/freedreno/.dir-locals.el  | 2 +-
>  src/gallium/drivers/r600/.dir-locals.el   | 2 +-
>  src/gallium/drivers/radeon/.dir-locals.el | 2 +-
>  src/gallium/drivers/radeonsi/.dir-locals.el   | 2 +-
>  src/gallium/drivers/vc4/.dir-locals.el| 2 +-
>  src/gallium/drivers/vc4/kernel/.dir-locals.el | 2 +-
>  src/gallium/winsys/radeon/.dir-locals.el  | 2 +-
>  src/mesa/drivers/dri/nouveau/.dir-locals.el   | 2 +-
>  9 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/.dir-locals.el b/.dir-locals.el
> index d95eb48..f44d964 100644
> --- a/.dir-locals.el
> +++ b/.dir-locals.el
> @@ -1,12 +1,12 @@
> -((prog-mode
> +((nil
>(indent-tabs-mode . nil)
>(tab-width . 8)
>(c-basic-offset . 3)
>(c-file-style . "stroustrup")
> -  (fill-column . 78)

Do we want to remove this? Or does it match the default?

>(eval . (progn
> (c-set-offset 'innamespace '0)
> (c-set-offset 'inline-open '0)))
>)
> + (".git" (nil (fill-column . 70)))

Should the commit subject line be under 70 characters? I notice that
yours is 74. :)

https://www.kernel.org/doc/Documentation/SubmittingPatches says the
subject line should be limited to 70-75 characters.

It seems like the same should be used for subsequent line wrapping.

Maybe the .git part should be moved that into a separate patch?

Not a huge deal though, so,
Reviewed-by: Jordan Justen 

>   (makefile-mode (indent-tabs-mode . t))
>   )
> diff --git a/src/gallium/drivers/freedreno/.dir-locals.el 
> b/src/gallium/drivers/freedreno/.dir-locals.el
> index aa20d49..c26578b 100644
> --- a/src/gallium/drivers/freedreno/.dir-locals.el
> +++ b/src/gallium/drivers/freedreno/.dir-locals.el
> @@ -1,4 +1,4 @@
> -((prog-mode
> +((nil
>(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 4e35c12..8be6a30 100644
> --- a/src/gallium/drivers/r600/.dir-locals.el
> +++ b/src/gallium/drivers/r600/.dir-locals.el
> @@ -1,4 +1,4 @@
> -((prog-mode
> +((nil
>(indent-tabs-mode . true)
>(tab-width . 8)
>(c-basic-offset . 8)
> diff --git a/src/gallium/drivers/radeon/.dir-locals.el 
> b/src/gallium/drivers/radeon/.dir-locals.el
> index 4e35c12..8be6a30 100644
> --- a/src/gallium/drivers/radeon/.dir-locals.el
> +++ b/src/gallium/drivers/radeon/.dir-locals.el
> @@ -1,4 +1,4 @@
> -((prog-mode
> +((nil
>(indent-tabs-mode . true)
>(tab-width . 8)
>(c-basic-offset . 8)
> diff --git a/src/gallium/drivers/radeonsi/.dir-locals.el 
> b/src/gallium/drivers/radeonsi/.dir-locals.el
> index 4e35c12..8be6a30 100644
> --- a/src/gallium/drivers/radeonsi/.dir-locals.el
> +++ b/src/gallium/drivers/radeonsi/.dir-locals.el
> @@ -1,4 +1,4 @@
> -((prog-mode
> +((nil
>(indent-tabs-mode . true)
>(tab-width . 8)
>(c-basic-offset . 8)
> diff --git a/src/gallium/drivers/vc4/.dir-locals.el 
> b/src/gallium/drivers/vc4/.dir-locals.el
> index ac94242..ed10dc2 100644
> --- a/src/gallium/drivers/vc4/.dir-locals.el
> +++ b/src/gallium/drivers/vc4/.dir-locals.el
> @@ -1,4 +1,4 @@
> -((prog-mode
> +((nil
>(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 49403de..2e58e90 100644
> --- a/src/gallium/drivers/vc4/kernel/.dir-locals.el
> +++ b/src/gallium/drivers/vc4/kernel/.dir-locals.el
> @@ 

Re: [Mesa-dev] [PATCH] Fix automatic indentation mode for recent emacs, use fewer columns in .git

2015-04-02 Thread Michel Dänzer
On 03.04.2015 06:38, Carl Worth wrote:
> I recently noticed (after upgrading to emacs 24?) that I was no longer
> getting automatic C-style settings in emacs like I was accustomed to
> getting. That is, I was now getting a default indentation of 8 and
> indentation with tabs instead of spaces.
> 
> It appears that the .dir-locals.el file is no longer taking
> effect. Presumably, emacs was previously using "prog-mode" for C and
> C++ source files but is now using a mode with some other name?
> 
> I didn't chase down the name of the current mode, but just using "nil"
> makes these variables get set on all files, (which should be mostly
> harmless), and should be compatible with both old and new emacs.
> 
> I did verify that the later change in this file (to indent with tabs
> when in makefile-mode) still takes precendence as desired.
> 
> While editing these files, I've also set things up to use a smaller
> value for fill-column when editing a file within the ".git"
> directory. This will help avoid commit messages getting wrapped when
> "git log" adds some extra indentation.

Acked-by: Michel Dänzer 

But you should probably confirm with Neil Roberts that this doesn't
break anything for him.


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev