Subject: 25.2; dired-actual-switches` and .dir-locals.el

From: leo <[email-masked]>
Date: Fri, 13 Oct 2017 19:16:08 +1100

Setup
=====

* Create a directory `mydir` somewhere accessible to you.
* Create some files with different timestamp and different names in there.
* Craete a `.dir-locals.el` file in teher with the follwoing content:

    ;;; Directory Local Variables
    ;;; For more information see (info "(emacs) Directory Variables")
    
    ((dired-mode .
      ((dired-actual-switches . "-laht")
       (subdirs . nil))))
       
* Create a subirectory `subdir` inside `mydir`
* Create some files with different timestamp and different names in there.

Bug 1: .dir-locals.el not applied the first time
================================================

* Launch `emacs -Q`
* Open `mydir` via `M-x find-file` as a dired buffer
* Observe that `mydir` is **not** in date order sorted
* Kill `mydir` buffer.
* Open again `mydir` via `M-x find-file` as a dired buffer
* Observe that `mydir` **is**  in date order sorted (as it should be)

Bug 2: (subdirs . nil) rule not obeyed
======================================

* Stay in that `emacs -Q` session
* Kill `mydir` buffer.
* Open `mydir/subdir` via `M-x find-file` as a dired buffer
* Observe that `mydir` **is**  in date order sorted (as it **not** should be)

Hope this helps!

* * *

In GNU Emacs 25.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23)
 of 2017-09-01 built on ACCRAD01
Windowing system distributor 'MobaXterm', version 11.0.10605000
System Description:	Oracle Linux Server release 6.9

Configured features:
XPM JPEG TIFF GIF PNG SOUND GPM DBUS GCONF NOTIFY LIBSELINUX LIBXML2
FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Dired by date

Minor modes in effect:
  diff-auto-refine-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  auto-revert-mode: t
  async-bytecomp-package-mode: t
  helm-autoresize-mode: t
  savehist-mode: t
  shell-dirtrack-mode: t
  delete-selection-mode: t
  google-this-mode: t
  recentf-mode: t
  dired-omit-mode: t
  winner-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Omitted 2 lines.
Mark set
Reverting buffer ‘devel’.
Omitting...
(Nothing to omit)
Omitting...
Omitted 2 lines.
Directory /home/broleo/tmp/emacs-test/

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail arc-mode archive-mode doc-view
image-mode sql whitespace dabbrev find-file cus-edit cus-start cus-load
conf-mode view nroff-mode pcmpl-unix diff vc-git magit-extras
magit-bookmark magit-obsolete magit-blame magit-stash magit-bisect
magit-remote magit-commit magit-sequence magit-notes magit-worktree
magit-branch magit-files magit-refs magit-status subr-x magit
magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode
diff-mode magit-core magit-autorevert magit-process magit-margin
magit-mode magit-git magit-section magit-popup git-commit log-edit
message rfc822 mml mml-sec epg mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils gmm-utils
mailheader pcvs-util add-log with-editor sh-script smie executable
tramp-cmds tramp-cache markdown-mode derived rx color noutline outline
helm-misc tabify imenu man eieio-opt speedbar sb-image ezimage dframe
dirtrack ibuf-ext ibuffer helm-ring magit-utils crm dash jka-compr
em-unix em-term term disp-table ehelp em-script em-prompt em-ls em-hist
em-pred em-glob em-dirs em-cmpl em-basic em-banner em-alias esh-var
esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups eshell
esh-module esh-mode esh-util helm-command helm-elisp helm-eval edebug
helm-mode pulse find-dired semantic/fw mode-local xref project grep
image-file dired-aux warnings autorevert filenotify misearch
multi-isearch filecache ido helm-x-files helm-for-files helm-bookmark
helm-adaptive helm-info bookmark pp helm-external helm-net browse-url
xml ffap thingatpt smart-tab flyspell ispell bash-completion
shell-command helm-files helm-buffers helm-tags helm-locate helm-grep
helm-regexp helm-utils helm-help helm-types helm-config helm-easymenu
async-bytecomp helm helm-source eieio-compat helm-multi-match helm-lib
async tsdh-light-theme savehist server python tramp-sh tramp
tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
format-spec json map find-func real-auto-save delsel google-this
easy-mmode compile url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util url-parse auth-source cl-seq
eieio eieio-core gnus-util mm-util help-fns mail-prsvr password-cache
url-vars mailcap recentf tree-widget goto-chg locate dired-x
dired-sort-menu ange-ftp comint ansi-color dired advice cl-macs ls-lisp
edmacro kmacro deft wid-edit cl ediff-merg ediff-wind ediff-diff
ediff-mult ediff-help ediff-init ediff-util ediff buffer-move windmove
winner ring finder-inf package epg-config seq byte-opt gv bytecomp
byte-compile cl-extra help-mode cconv cl-loaddefs pcase cl-lib info
easymenu time-date mule-util tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame
cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote dbusbind inotify
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 976231 115019)
 (symbols 48 47193 0)
 (miscs 40 5736 3045)
 (strings 32 128077 17592)
 (string-bytes 1 4133074)
 (vectors 16 96180)
 (vector-slots 8 1723509 60572)
 (floats 8 1495 1377)
 (intervals 56 72285 1915)
 (buffers 976 212)
 (heap 1024 81934 17163))