Trying to set indent-tabs-mode to nil in f90-mode with .dir-locals.el

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Trying to set indent-tabs-mode to nil in f90-mode with .dir-locals.el

Alberto Luaces
Hi,

f90-mode sets by default indent-tabs-mode to nil, which is good for me.

If I want to set automatically (indent-tabs-mode t) for the rest of the
modes, I set .dir-locals.el to

--8<---------------cut here---------------start------------->8---
((nil (indent-tabs-mode . t)))
--8<---------------cut here---------------end--------------->8---

However, that sets the variable to nil even in f90-mode, as expected.
The problem is that I cannot revert that setting for f90-mode even being
specific in .dir-locals.el:

--8<---------------cut here---------------start------------->8---
((nil (indent-tabs-mode . t))
 (f90-mode . ((indent-tabs-mode . nil)))) ; It is evaluated to t nevertheless
--8<---------------cut here---------------end--------------->8---

This is somewhat strange, according to the manual.  Are there any
pointers for further debugging this issue?

Thanks!

--
Alberto

signature.asc (279 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Trying to set indent-tabs-mode to nil in f90-mode with .dir-locals.el

Stefan Kangas
Alberto Luaces <[hidden email]> writes:

> f90-mode sets by default indent-tabs-mode to nil, which is good for me.
[...]
> The problem is that I cannot revert that setting for f90-mode even being
> specific in .dir-locals.el:
>
> --8<---------------cut here---------------start------------->8---
> ((nil (indent-tabs-mode . t))

BTW, I think you are missing a parenthesis here:

((nil . ((indent-tabs-mode . t)))

It doesn't seem to make a difference in this case, though.

>  (f90-mode . ((indent-tabs-mode . nil)))) ; It is evaluated to t nevertheless
> --8<---------------cut here---------------end--------------->8---
>
> This is somewhat strange, according to the manual.  Are there any
> pointers for further debugging this issue?

The manual (info "(emacs)Directory Variables") indeed says:

   If the ‘.dir-locals.el’ file contains multiple different values for a
variable using different mode names or directories, the values will be
applied in an order such that the values for more specific modes take
priority over more generic modes.

I tried, but I can't reproduce this issue here (using the upcoming
Emacs 27 development branch).  I would try using "emacs -Q" to rule
out that there is something in your local configuration which causes
this.

Best regards,
Stefan Kangas

Reply | Threaded
Open this post in threaded view
|

Re: Trying to set indent-tabs-mode to nil in f90-mode with .dir-locals.el

Robert Pluim
>>>>> On Fri, 29 Nov 2019 13:01:51 +0100, Stefan Kangas <[hidden email]> said:
    Stefan> The manual (info "(emacs)Directory Variables") indeed says:

    Stefan>    If the ‘.dir-locals.el’ file contains multiple different values for a
    Stefan> variable using different mode names or directories, the values will be
    Stefan> applied in an order such that the values for more specific modes take
    Stefan> priority over more generic modes.

    Stefan> I tried, but I can't reproduce this issue here (using the upcoming
    Stefan> Emacs 27 development branch).  I would try using "emacs -Q" to rule
    Stefan> out that there is something in your local configuration which causes
    Stefan> this.

This is <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33400>, which
was fixed in emacs-26.3

Robert

Reply | Threaded
Open this post in threaded view
|

Re: Trying to set indent-tabs-mode to nil in f90-mode with .dir-locals.el

Alberto Luaces
In reply to this post by Stefan Kangas
Stefan Kangas writes:

> I tried, but I can't reproduce this issue here (using the upcoming
> Emacs 27 development branch).  I would try using "emacs -Q" to rule
> out that there is something in your local configuration which causes
> this.

Thanks for your help!  Indeed I tried all of this first with "-Q",
wanting to be a good emacs citizen :-)

My version is 26.1.

--
Alberto


Reply | Threaded
Open this post in threaded view
|

Re: Trying to set indent-tabs-mode to nil in f90-mode with .dir-locals.el

Alberto Luaces
In reply to this post by Robert Pluim
Robert Pluim writes:

>>>>>> On Fri, 29 Nov 2019 13:01:51 +0100, Stefan Kangas said:
>     Stefan> The manual (info "(emacs)Directory Variables") indeed says:
>
>     Stefan>    If the ‘.dir-locals.el’ file contains multiple different values for a
>     Stefan> variable using different mode names or directories, the values will be
>     Stefan> applied in an order such that the values for more specific modes take
>     Stefan> priority over more generic modes.
>
>     Stefan> I tried, but I can't reproduce this issue here (using the upcoming
>     Stefan> Emacs 27 development branch).  I would try using "emacs -Q" to rule
>     Stefan> out that there is something in your local configuration which causes
>     Stefan> this.
>
> This is <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33400>, which
> was fixed in emacs-26.3

Thanks a lot for the info!  Specially for the pointer to the bug,
because understanding the bug I discovered a workaround: reordering the
list so f90-mode appears first, things work as expected.

--
Alberto