-(defvar dired-use-ls-dired (not (not (string-match "gnu" system-configuration)))
- "Non-nil means Dired should use `ls --dired'.")
+(defcustom dired-use-ls-dired 'unspecified
+ "Non-nil means Dired should use \"ls --dired\".
+The special value of `unspecified' means to check explicitly, and
+save the result in this variable. This is performed the first
+time `dired-insert-directory' is called."
+ :group 'dired
+ :type '(choice (const :tag "Check for --dired support" unspecified)
+ (const :tag "Do not use --dired" nil)
+ (other :tag "Use --dired" t)))