GNU bug report logs - #17489
24.3; Major mode spec in .dir-locals.el breaks dired

Previous Next

Package: emacs;

Reported by: Sergio Pokrovskij <sergio.pokrovskij <at> gmail.com>

Date: Wed, 14 May 2014 07:29:01 UTC

Severity: minor

Merged with 13685

Found in version 24.3

Full log


Message #8 received at 17489 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sergio Pokrovskij <sergio.pokrovskij <at> gmail.com>
Cc: 17489 <at> debbugs.gnu.org
Subject: Re: bug#17489: 24.3; Major mode spec in .dir-locals.el breaks dired
Date: Wed, 14 May 2014 18:10:04 +0300
> From: Sergio Pokrovskij <sergio.pokrovskij <at> gmail.com>
> Date: Wed, 14 May 2014 14:14:48 +0700
> 
> Given a .dir-locals.el file of the form:
> 
> --8<---------------cut here---------------start------------->8---
> % ls -al /tmp/tst/
> total 16
> drwxrwxr-x  2 sergio sergio 4096 мая   14 12:01 .
> drwxrwxrwt 17 root   root   4096 мая   14 14:06 ..
> -rw-rw-r--  1 sergio sergio   44 мая   14 12:01 .dir-locals.el
> -rw-rw-r--  1 sergio sergio    4 мая   14 11:58 t.t
> % 
> % cat /tmp/tst/.dir-locals.el 
> ((nil . ((mode . c) (fill-column . 80))))
> 
> %
> --8<---------------cut here---------------end--------------->8---
> 
> it works okay for the local files which are read with a path in the
> command-line or with a find-file:
> 
> --8<---------------cut here---------------start------------->8---
> % emacs -nw -Q /tmp/tst/t.t
> --8<---------------cut here---------------end--------------->8---
> 
> The file is open in c-mode, the *Messages* contains:
> 
> --8<---------------cut here---------------start------------->8---
> ("emacs" "/tmp/tst/t.t")
> For information about GNU Emacs and the GNU system, type C-h C-a.
> Loading cc-langs...done
> --8<---------------cut here---------------end--------------->8---
> 
> Yet it prevents the dired buffer for /tmp/tst/ to be displayed; a
> "Wrong type argument: stringp, nil" message is issued.
> 
> This seems to occur for any major mode; I tried it for psgml-mode,
> text-mode, c-mode.

It's not clear what did you expect instead.  Did you expect that
unconditionally turning on some mode in a Dired buffer be ignored,
just because it's a Dired buffer?  Or did you expect that your
.dir-locals.el settings be in effect only for files, not for
directories?  Or did you expect that cc-mode somehow gracefully does
nothing when the buffer text is not a C-like program source?  Or
something else?

IOW, why isn't that .dir-locals.el setting of yours not a cockpit
error?




This bug report was last modified 3 years and 111 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.