Package: emacs Severity: minor Please consider the patch MIMEd. * lisp/files.el (dir-locals-collect-variables): Use default-directory in place of the file name while working on non-file buffers (as hack-dir-local-variables already does.) The issue I observe is as follows. First, I create ~/foo and ~/foo/ru directories, and a ~/foo/.dir-locals.el file like: ((nil (ispell-local-dictionary . "esperanto")) ("ru" (nil (ispell-local-dictionary . "russian")))) Then: (with-temp-buffer (cd "~/foo/ru/") (hack-dir-local-variables-non-file-buffer) ;; . dir-local-variables-alist) The result is '((ispell-local-dictionary . "esperanto")), contrary to the expected '((… . "russian")). This does not happen for buffers associated with files: (with-current-buffer (find-file-noselect "~/foo/ru/bar") (hack-dir-local-variables) ;; . dir-local-variables-alist) Reading the code suggests that dir-locals-collect-variables fails to handle the (stringp key) case properly when ‘file-name’ is nil, which is what my patch is intended to fix. -- FSF associate member #7257 np. Conclusion — Apocalyptica … B6A0 230E 334A