Subject: bug#12399: 24.2.50; dired-do-touch doesn't recognize empty input in minibuffer

From: Juri Linkov <[email-masked]>
Date: Wed, 12 Sep 2012 01:50:35 +0300

> There's another way to do that: check (eq val default), since the
> returned value will be `eq' to the `default' if the minibuffer was
> empty, whereas if it comes from a non-empty minibuffer it will at best
> be `equal'.

I tried this in the following patch and it works.
There is too little space in comments to explain
this hack, so I added a bug reference.

Old (string-equal new-attribute "") remains as
a precaution against possible unexpected changes in
`dired-mark-read-string'.

=== modified file 'lisp/dired-aux.el'
--- lisp/dired-aux.el	2012-09-08 14:48:27 +0000
+++ lisp/dired-aux.el	2012-09-11 22:48:01 +0000
@@ -244,7 +244,10 @@ (defun dired-do-chxxx (attribute-name pr
 			     (function dired-check-process)
 			     (append
 			      (list operation program)
-			      (unless (string-equal new-attribute "")
+			      (unless (or (string-equal new-attribute "")
+					  ;; Use `eq' instead of `equal'
+					  ;; to detect empty input (bug#12399).
+					  (eq new-attribute default))
 				(if (eq op-symbol 'touch)
 				    (list "-t" new-attribute)
 				  (list new-attribute)))