bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs local variables


From: Bruno Haible
Subject: Re: Emacs local variables
Date: Fri, 29 Apr 2011 22:48:06 +0200
User-agent: KMail/1.9.9

Hi Reuben,

> Basically, the bug (at least in 23.3) is that when a file's mode is
> set by its local variables, as in the case for example of
> announce-gen, then any directory-local variables are ignored.
> 
> To work around this, would it be alright to add a setting for
> indent-tabs-mode to such files?

Adding  indent-tabs-mode: nil  to files that have a dozen of Emacs
variable settings seems acceptable to me.

But first, did you try / are you using the code from gnulib/README?

      ;; In gnulib, indent with spaces everywhere (not TABs).
      ;; Exceptions: Makefile and ChangeLog modes.
      (add-hook 'find-file-hook '(lambda ()
        (if (and buffer-file-name
                 (string-match "/gnulib\\>" (buffer-file-name))
                 (not (string-equal mode-name "Change Log"))
                 (not (string-equal mode-name "Makefile")))
            (setq indent-tabs-mode nil))))

Does this code help?

> I was going to suggest that it would also help to have .dir-locals.el
> files instead of repeating the same settings in each file, but the bug
> to which I've just referred militates against that.

Also, gnulib-tool does not (and probably should not) copy files that
affect an entire directory.

> However, since my .dir-locals.el file is still useful in many cases
> (for files with explicit suffixes, where the bug does not show up), it
> would seem reasonable to add .dir-locals.el to the top-level
> .gitignore.

You can place files to be ignored also in .git/info/exclude. .gitignore
is to list files that everyone has or is likely to have.

Bruno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]