[PATCH] Add dir-locals style variables for C++ and Elisp code.

Austin Clements amdragon at MIT.EDU
Mon Jun 6 23:57:54 PDT 2011


Quoth Dmitry Kurochkin on Jun 07 at  9:27 am:
> Hi Austin.
> 
> On Tue,  7 Jun 2011 01:20:25 -0400, Austin Clements <amdragon at MIT.EDU> wrote:
> > Also, slightly reformat dir-locals.el so that the settings align and
> > to make it friendlier for future additions.
> > ---
> >  .dir-locals.el |   18 ++++++++++++++----
> >  1 files changed, 14 insertions(+), 4 deletions(-)
> > 
> > diff --git a/.dir-locals.el b/.dir-locals.el
> > index cbdb1f9..eff29fc 100644
> > --- a/.dir-locals.el
> > +++ b/.dir-locals.el
> > @@ -1,7 +1,17 @@
> >  ; emacs local configuration settings for notmuch source
> >  ; surmised by dkg on 2010-11-23 13:43:18-0500
> > +; amended by amdragon on 2011-06-06
> >  
> > -((c-mode . ((indent-tabs-mode . t)
> > -            (tab-width . 8)
> > -            (c-basic-offset . 4)
> > -            (c-file-style . "linux"))))
> > +((c-mode
> > +  (indent-tabs-mode . t)
> > +  (tab-width . 8)
> > +  (c-basic-offset . 4)
> > +  (c-file-style . "linux"))
> > + (c++-mode
> > +  (indent-tabs-mode . t)
> > +  (tab-width . 8)
> > +  (c-basic-offset . 4)
> > +  (c-file-style . "linux"))
> > + (emacs-lisp-mode
> > +  (indent-tabs-mode . t))
> > + )
> 
> Why tab-width is not set for the emacs-lisp-mode?

Because I forgot to set it.  ]:--8)

> Also, perhaps we should set these variables for all modes?  Setting
> c-basic-offset and c-file-style should not hurt.  And indent-tabs-mode
> and tab-width should be relevant for any file in notmuch (shell, python,
> probably even text files), no?

Personally, I would prefer to keep .dir-locals conservative, rather
than make sweeping settings.  For example, the Python code isn't (and
definitely shouldn't be) using tabs.  Adding settings for shell is a
good idea, though.

> Regards,
>   Dmitry


More information about the notmuch mailing list