GNU bug report logs - #12399
24.2.50; dired-do-touch doesn't recognize empty input in minibuffer

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Sun, 9 Sep 2012 22:50:01 UTC

Severity: normal

Found in version 24.2.50

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: Bastien <bzg <at> altern.org>, 12399 <at> debbugs.gnu.org
Subject: bug#12399: 24.2.50; dired-do-touch doesn't recognize empty input in minibuffer
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)))




This bug report was last modified 12 years and 330 days ago.

Previous Next


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