[Top][All Lists]

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

dir-locals, major-mode, etc..

From: Stefan Monnier
Subject: dir-locals, major-mode, etc..
Date: Thu, 01 Aug 2013 13:18:08 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Going back to bug#7169, I think we need to rework the way we handle
file-local vars, and determine major modes.

Would someone like to take a look at it?

- The way I see it, we should first try to figure out the mode to use (or
  the kind of file it is, in the mime-type sense), based on .dir-local.el
  settings, the file's name, and finally the file's contents (magic
  bytes and file-local settings).
- There shouldn't be an imposed precedence between file name and file
  content: if they indicate different modes, then consult some
  conflict-resolution table (or ask the user, or pick one and warn the
  user about the conflict).
- The file content's parsing should have access to the mode
  determined from the file's name (and the .dir-local.el data).
- Only once the mode is determined, we try to determine the
  coding-system in use.  So .dir-locals.el can set `coding' on
  a per-mode basis (and similarly file-coding-system-alist can use
  modes rather than file names).


reply via email to

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