all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: Bastien <bzg@altern.org>, 12399@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	[thread overview]
Message-ID: <87627k41rj.fsf@mail.jurta.org> (raw)
In-Reply-To: <jwvwr005lx9.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 11 Sep 2012 16:46:10 -0400")

> 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)))





  reply	other threads:[~2012-09-11 22:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-09 22:43 bug#12399: 24.2.50; dired-do-touch doesn't recognize empty input in minibuffer Juri Linkov
2012-09-11 14:41 ` Bastien
2012-09-11 19:05   ` Juri Linkov
2012-09-11 20:46     ` Stefan Monnier
2012-09-11 22:50       ` Juri Linkov [this message]
2012-09-13 23:42         ` Juri Linkov
2012-09-14 22:59           ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87627k41rj.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=12399@debbugs.gnu.org \
    --cc=bzg@altern.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.