[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#12399: 24.2.50; dired-do-touch doesn't recognize empty input in mini
From: |
Juri Linkov |
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 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) |
> 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)))