Subject: bug#6799: 24.0.50; Please add dired-details.el to Emacs [patch]

From: "Drew Adams" <[email-masked]>
Date: Sat, 16 Feb 2013 14:58:41 -0800

> Usually I don't do this but when I called in a dired buffer
> `M-x text-mode RET' it unexpectedly removed from display all text
> except filenames (i.e. made other text invisible).
> 
> I wonder should such cases be handled e.g. by disabling
> `dired-hide-details-mode' in the hook `after-change-major-mode-hook'?

They should definitely be handled, one way or another.

`dired-hide-details-mode' makes sense only in a mode derived from Dired mode.

Your suggested fix sounds like the right approach in general, but I think
turning off `dired-hide-details-mode' should somehow be done BEFORE changing to
a mode that is not dired-derived, not afterward.

Can you use `change-major-mode-hook' instead, to do this before changing the
mode?  Is it possible at that point to test whether the target mode is
(derived-mode-p dired-mode)?