all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* tab-width ignored in .dir-locals.el
@ 2021-11-12 17:56 Grant Edwards
  2021-11-12 18:15 ` Grant Edwards
  0 siblings, 1 reply; 2+ messages in thread
From: Grant Edwards @ 2021-11-12 17:56 UTC (permalink / raw)
  To: help-gnu-emacs

How do you set the tab width for C-mode in a .dir-locals.el file?

All the documentation I can find says this should work:

------------------------------------------------------------------------
((nil . ((indent-tabs-mode . t)
         (tab-width . 4)
              ))
 (c-mode . ((c-file-style . "BSD")
            (subdirs . t)
			))
 )
------------------------------------------------------------------------

But when I edit a .c file, the tab width is always 8.

What am I doing wrong?

I tried adding (subdirs . t) to the first list, but that made no difference.




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: tab-width ignored in .dir-locals.el
  2021-11-12 17:56 tab-width ignored in .dir-locals.el Grant Edwards
@ 2021-11-12 18:15 ` Grant Edwards
  0 siblings, 0 replies; 2+ messages in thread
From: Grant Edwards @ 2021-11-12 18:15 UTC (permalink / raw)
  To: help-gnu-emacs

On 2021-11-12, Grant Edwards <grant.b.edwards@gmail.com> wrote:

> How do you set the tab width for C-mode in a .dir-locals.el file?
>
> All the documentation I can find says this should work:
>
> ------------------------------------------------------------------------
> ((nil . ((indent-tabs-mode . t)
>          (tab-width . 4)
>               ))
>  (c-mode . ((c-file-style . "BSD")
>             (subdirs . t)
> 			))
>  )
> ------------------------------------------------------------------------
>
> But when I edit a .c file, the tab width is always 8.

Aargh. I just realized it's not tab size that's wrong, it's the
c-file-offsets...






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-12 18:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-12 17:56 tab-width ignored in .dir-locals.el Grant Edwards
2021-11-12 18:15 ` Grant Edwards

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.