GNU bug report logs - #28807
25.2; dired-actual-switches` and .dir-locals.el

Previous Next

Package: emacs;

Reported by: leo <dev <at> halloleo.hailmail.net>

Date: Fri, 13 Oct 2017 08:29:02 UTC

Severity: minor

Found in version 25.2

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28807 in the body.
You can then email your comments to 28807 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#28807; Package emacs. (Fri, 13 Oct 2017 08:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to leo <dev <at> halloleo.hailmail.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 13 Oct 2017 08:29:02 GMT) Full text and rfc822 format available.

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

From: leo <dev <at> halloleo.hailmail.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.2; dired-actual-switches` and .dir-locals.el
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))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28807; Package emacs. (Fri, 13 Oct 2017 09:10:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: leo <dev <at> halloleo.hailmail.net>
Cc: 28807 <at> debbugs.gnu.org
Subject: Re: bug#28807: 25.2; dired-actual-switches` and .dir-locals.el
Date: Fri, 13 Oct 2017 12:09:09 +0300
> From: leo <dev <at> halloleo.hailmail.net>
> Date: Fri, 13 Oct 2017 19:16:08 +1100
> 
>     ;;; 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)

I think this is because both settings take their effect before the
Dired mode is turned on in the buffer.  IOW, these customizations
simply cannot have the desired effect, as they are conditioned on
the wrong condition.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28807; Package emacs. (Sat, 14 Oct 2017 09:54:02 GMT) Full text and rfc822 format available.

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

From: leo <dev <at> halloleo.hailmail.net>
To: Eli Zaretskii <eliz <at> gnu.org>,
 28807 <at> debbugs.gnu.org
Subject: Re: bug#28807: 25.2; dired-actual-switches` and .dir-locals.el
Date: Sat, 14 Oct 2017 19:49:53 +1100
> On 13 Oct 2017, at 20:09, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: leo <dev <at> halloleo.hailmail.net>
>> Date: Fri, 13 Oct 2017 19:16:08 +1100
>> 
>>    ;;; 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)
> 
> I think this is because both settings take their effect before the
> Dired mode is turned on in the buffer.  IOW, these customizations
> simply cannot have the desired effect, as they are conditioned on
> the wrong condition.

Mmmh, the dired-actual-switches variable *did* work with the dired-x package (when using its own .dired files) - but the newest dired-x manual states that the .dired mechanism is depreciated over the .dir-locals.el system. However as tested the .dir-locals.el mechanism does not work.



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28807; Package emacs. (Sun, 04 Jul 2021 14:15:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: leo <dev <at> halloleo.hailmail.net>
Cc: 28807 <at> debbugs.gnu.org
Subject: Re: bug#28807: 25.2; dired-actual-switches` and .dir-locals.el
Date: Sun, 04 Jul 2021 16:14:07 +0200
leo <dev <at> halloleo.hailmail.net> writes:

> * 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)

I can reproduce some of this in various older Emacs versions, but this
seems to work fine for me in Emacs 28 (and I remember doing some work in
this area some months ago), so I'm going to go ahead and guess that this
has been fixed, and I'm closing this bug report.  If you're still seeing
this issue, please respond to the debbugs address and we'll reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 28807 <at> debbugs.gnu.org and leo <dev <at> halloleo.hailmail.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 04 Jul 2021 14:15:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28807; Package emacs. (Mon, 05 Jul 2021 01:30:02 GMT) Full text and rfc822 format available.

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

From: leo <dev <at> halloleo.hailmail.net>
To: 28807 <at> debbugs.gnu.org
Subject: Re: bug#28807: 25.2; dired-actual-switches` and .dir-locals.el
Date: Mon, 05 Jul 2021 11:28:54 +1000
On 5 Jul 2021, at 0:14, Lars Ingebrigtsen wrote:

> leo <dev <at> halloleo.hailmail.net> writes:
>
>> * 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)
>
> I can reproduce some of this in various older Emacs versions, but this
> seems to work fine for me in Emacs 28 (and I remember doing some work in
> this area some months ago), so I'm going to go ahead and guess that this
> has been fixed, and I'm closing this bug report.  If you're still seeing
> this issue, please respond to the debbugs address and we'll reopen.

Thanks for looking into this.

I am still on Emacs 27. Is Emacs 28 out on “stable”?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28807; Package emacs. (Mon, 05 Jul 2021 13:34:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: leo <dev <at> halloleo.hailmail.net>
Cc: 28807 <at> debbugs.gnu.org
Subject: Re: bug#28807: 25.2; dired-actual-switches` and .dir-locals.el
Date: Mon, 05 Jul 2021 15:33:33 +0200
leo <dev <at> halloleo.hailmail.net> writes:

> I am still on Emacs 27. Is Emacs 28 out on “stable”?

Emacs 28 is the current development branch of Emacs.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 03 Aug 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 237 days ago.

Previous Next


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