From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?Q?Arne_J=F8rgensen?= Newsgroups: gmane.emacs.help Subject: Re: Problem with `dir-locals-set-class-variables' Date: Sun, 08 Apr 2012 11:09:26 +0200 Organization: Arne Joergensen -- http://arnested.dk/ Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1333876218 29091 80.91.229.3 (8 Apr 2012 09:10:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 8 Apr 2012 09:10:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Apr 08 11:10:18 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SGo8T-0000Lf-FO for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Apr 2012 11:10:13 +0200 Original-Received: from localhost ([::1]:47228 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGo8S-0001NW-LJ for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Apr 2012 05:10:12 -0400 Original-Path: usenet.stanford.edu!news.glorb.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.0.94 (darwin) Cancel-Lock: sha1:2SSiBu4cy8xvWjztDghUEy5oQBI= Original-Lines: 57 Original-NNTP-Posting-Host: 85.81.8.159 Original-X-Trace: news.sunsite.dk DXC=1NJn]18[`gN3j@n`X75YjCYSB=nbEKnkKZ5:SgDH2CiK3`c7HBK2ekJ28]Zoe[3K_C2eeioNb=`gNL`7aD@9:59KT1MLbPdK; CD Original-X-Complaints-To: staff@sunsite.dk Original-Xref: usenet.stanford.edu gnu.emacs.help:191960 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84375 Archived-At: Glenn Morris writes: > Arne Jørgensen wrote: > >> But if I want to use the other form of `dir-locals-set-class-variables' >> where variables is of the form (DIRECTORY . LIST) like this: >> >> (dir-locals-set-class-variables 'my-test '(("~/my-test-dir" . ((nil . ((my-test-var . "some-value"))))))) >> >> and then visit a file i.e. ~/my-test-dir/my-test-file the variable is >> NOT applied. > > I don't see this form documented anywhere. What makes you think it > should work? > > C-h f dir-locals-set-class-variables > > (dir-locals-set-directory-class DIRECTORY CLASS &optional MTIME) > [...] > CLASS is the name of a project class, a symbol. C-h f dir-locals-set-class-variables dir-locals-set-class-variables is a compiled Lisp function in `files.el'. (dir-locals-set-class-variables CLASS VARIABLES) Map the type CLASS to a list of variable settings. CLASS is the project class, a symbol. VARIABLES is a list that declares directory-local variables for the class. An element in VARIABLES is either of the form: (MAJOR-MODE . ALIST) or (DIRECTORY . LIST) In the first form, MAJOR-MODE is a symbol, and ALIST is an alist whose elements are of the form (VARIABLE . VALUE). In the second form, DIRECTORY is a directory name (a string), and LIST is a list of the form accepted by the function. When a file is visited, the file's class is found. A directory may be assigned a class using `dir-locals-set-directory-class'. Then variables are set in the file's buffer according to the class' LIST. The list is processed in order. * If the element is of the form (MAJOR-MODE . ALIST), and the buffer's major mode is derived from MAJOR-MODE (as determined by `derived-mode-p'), then all the variables in ALIST are applied. A MAJOR-MODE of nil may be used to match any buffer. `make-local-variable' is called for each variable before it is set. * If the element is of the form (DIRECTORY . LIST), and DIRECTORY is an initial substring of the file's directory, then LIST is applied by recursively following these rules.