From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#17205: 24.3.50; dired and directory variables Date: Sun, 06 Apr 2014 14:55:19 +0200 Message-ID: <877g72d3d4.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1396788992 17890 80.91.229.3 (6 Apr 2014 12:56:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Apr 2014 12:56:32 +0000 (UTC) To: 17205@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 06 14:56:25 2014 Return-path: Envelope-to: geb-bug-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 1WWmcb-0003b8-A9 for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Apr 2014 14:56:25 +0200 Original-Received: from localhost ([::1]:58007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWmcb-0002SG-1F for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Apr 2014 08:56:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWmcQ-0002Rs-Lu for bug-gnu-emacs@gnu.org; Sun, 06 Apr 2014 08:56:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WWmcJ-0004pc-Bc for bug-gnu-emacs@gnu.org; Sun, 06 Apr 2014 08:56:14 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWmcJ-0004pX-8Z for bug-gnu-emacs@gnu.org; Sun, 06 Apr 2014 08:56:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WWmcH-0004nq-Qi for bug-gnu-emacs@gnu.org; Sun, 06 Apr 2014 08:56:06 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Apr 2014 12:56:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17205 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.139678895918442 (code B ref -1); Sun, 06 Apr 2014 12:56:05 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Apr 2014 12:55:59 +0000 Original-Received: from localhost ([127.0.0.1]:37506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WWmc8-0004nM-Li for submit@debbugs.gnu.org; Sun, 06 Apr 2014 08:55:58 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53433) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WWmc4-0004n7-DD for submit@debbugs.gnu.org; Sun, 06 Apr 2014 08:55:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WWmbw-0004lj-KC for submit@debbugs.gnu.org; Sun, 06 Apr 2014 08:55:51 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:59746) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWmbw-0004lf-Gq for submit@debbugs.gnu.org; Sun, 06 Apr 2014 08:55:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWmbq-0001cB-7i for bug-gnu-emacs@gnu.org; Sun, 06 Apr 2014 08:55:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WWmbh-0004iR-0w for bug-gnu-emacs@gnu.org; Sun, 06 Apr 2014 08:55:38 -0400 Original-Received: from mout.web.de ([212.227.15.4]:49646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWmbg-0004iC-Nr for bug-gnu-emacs@gnu.org; Sun, 06 Apr 2014 08:55:28 -0400 Original-Received: from drachen.dragon ([90.186.47.182]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0LxOHm-1X4RKp2G7O-016tDp for ; Sun, 06 Apr 2014 14:55:26 +0200 X-Provags-ID: V03:K0:CQC7Mkca1QJYbMASXP1J4AG2OkUxZtXlTt/qi5FLYflvX1w8pDo ouOROg8hCWkpM33JeV7mEAJgpgorXyE1a9Y3OYQE5HvmL5APvWSv9Pt1BugLlJPY4e5tWF2 de8hILdfU+5CodKJJIYBRQYz6Y1cI17XkUk/fKPUqxL6P8XQKFTmprYmuJNApJo2FdTOrKE dvdxJnXqujJRl8HsufqBg== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:87797 Archived-At: Hello, dired doesn't play well with directory local variables. The manual (info "(emacs) Directory Variables") seems to say that they would work with dired, but I found several problems with that (all this in emacs -Q): 1. In dired, they (sometimes?) take effect only in subdirectories, but not in the directory where they are specified. Example: In my ~, I create a .dir-locals.el with the content ((nil . ((a . "hallo")))) When I now open a dired buffer of ~, `a' is undefined. When I open any file below ~, `a' is bound as expected. 2. Being able to use use `dired-listing-switches' as a directory variable would obviously be very useful. But it has no effect, even not in subdirectories. OTOH, using `dired-actual-switches' has an effect, it leads to a sorting as expected, even (contrary to 1.) in the directory that contains the dir locals file. 3. `dir-locals-collect-variables' "destroys" any (subdirs . nil) specification: I change the .dir-locals.el in my ~ to the following content: ((nil . ((a . "hallo") (subdirs . nil)))) and restart Emacs. Now I dired ~. After that, I visit any file somewhere under ~ (this can be a regular file or a directory). `a' will be bound in that buffer. This doesn't happen if I don't dired ~ before. The cause seems to be this line in `dir-locals-collect-variables': (setq alist (delq subdirs alist)) which modifies the cached alist sturcture destructively (permanently!). The `delq' should be a `remq', I guess. Many thanks, Michael. In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.7) of 2014-03-28 on drachen Windowing system distributor `The X.Org Foundation', version 11.0.11500000 System Description: Debian GNU/Linux testing (jessie)