From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bastien Newsgroups: gmane.emacs.bugs Subject: bug#12399: 24.2.50; dired-do-touch doesn't recognize empty input in minibuffer Date: Tue, 11 Sep 2012 16:41:13 +0200 Message-ID: <87k3w01v1y.fsf@altern.org> References: <878vciakcd.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1347374496 5101 80.91.229.3 (11 Sep 2012 14:41:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Sep 2012 14:41:36 +0000 (UTC) Cc: 12399@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 11 16:41:39 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TBRek-0003tT-Rx for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Sep 2012 16:41:39 +0200 Original-Received: from localhost ([::1]:36775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBReh-0002Qh-DN for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Sep 2012 10:41:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBReZ-0002QX-N3 for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2012 10:41:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBReT-0008WS-Q7 for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2012 10:41:27 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBReT-0008WO-MN for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2012 10:41:21 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TBRf8-0006zx-3r for bug-gnu-emacs@gnu.org; Tue, 11 Sep 2012 10:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Bastien Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Sep 2012 14:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12399 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12399-submit@debbugs.gnu.org id=B12399.134737451726889 (code B ref 12399); Tue, 11 Sep 2012 14:42:02 +0000 Original-Received: (at 12399) by debbugs.gnu.org; 11 Sep 2012 14:41:57 +0000 Original-Received: from localhost ([127.0.0.1]:54801 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TBRf2-0006ze-Ve for submit@debbugs.gnu.org; Tue, 11 Sep 2012 10:41:57 -0400 Original-Received: from mail-wg0-f42.google.com ([74.125.82.42]:40870) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TBRf0-0006zV-QJ for 12399@debbugs.gnu.org; Tue, 11 Sep 2012 10:41:55 -0400 Original-Received: by wgbfm10 with SMTP id fm10so2011448wgb.3 for <12399@debbugs.gnu.org>; Tue, 11 Sep 2012 07:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=JYq/vMPoIgBKfYmLMEop9Ev7m1CcMHXAgHN2ZdkPSzE=; b=ijCIa0QkPOuyh199jEIZnXMd54nKwb2twYxjhtoHVhRjdfdAQeyKdy4uHI/LegYOrl aeAHTCuOWPEid67DTFMbmvB/o29Bk3QMQuHEM9WtwMU616x7ZKq5bzIh8wYPS1Bf3ehy iPBW2KU2xTpKKl3I/sfLkN5k+PHwAQf797jqMZbOyZd7luGXxWryvoJEG91eLX0eKYx6 XITgSlx6eA4EdY4vyexhDOdkwDIxvZDMdJUREEM+50eu4ZtfKzRoViSuWYZWOuh46vzJ oRM5WDQJXSbvYzGC7nG5LzDOmXXWH2aA1l7btEksdF7ikbZsGO/IzSWJEnBd+d8pG5t1 Bbvg== Original-Received: by 10.180.14.8 with SMTP id l8mr25663186wic.6.1347374472108; Tue, 11 Sep 2012 07:41:12 -0700 (PDT) Original-Received: from myhost.localdomain (mar75-2-81-56-68-112.fbx.proxad.net. [81.56.68.112]) by mx.google.com with ESMTPS id b7sm4349170wiz.9.2012.09.11.07.41.10 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Sep 2012 07:41:11 -0700 (PDT) Original-Received: by myhost.localdomain (Postfix, from userid 1000) id 5809C89A2; Tue, 11 Sep 2012 16:41:13 +0200 (CEST) In-Reply-To: <878vciakcd.fsf@mail.jurta.org> (Juri Linkov's message of "Mon, 10 Sep 2012 01:43:14 +0300") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:64114 Archived-At: --=-=-= Content-Type: text/plain Hi Juri, Juri Linkov writes: > `dired-do-touch' used to get the current time for empty input. > Its prompt says that the default value is "now". > > But currently its default value is the file modification time, > not the current time. Thus `T RET' has no effect in dired. > > The problem is that `dired-mark-read-string' now uses `completing-read' > (to be able to provide completion) instead of `read-from-minibuffer'. > > These functions differ in how they handle defaults: > `read-from-minibuffer' returns the empty string for empty input, but > `completing-read' returns the default value and can't recognize > empty input. > > This requires a new function that provides completion like > `completing-read-default' but without these two lines: > > (when (and (equal result "") def) > (setq result (if (consp def) (car def) def))) I'm not sure why the simple patch below should not be enough, taking the current time instead of the one from the first file in the set of marked file. If it's good for you, I'll apply this within this week. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=dired-aux.el.patch === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2012-09-08 14:48:26 +0000 +++ lisp/dired-aux.el 2012-09-11 14:38:39 +0000 @@ -225,8 +225,7 @@ (let* ((files (dired-get-marked-files t arg)) (default (and (eq op-symbol 'touch) (stringp (car files)) - (format-time-string "%Y%m%d%H%M.%S" - (nth 5 (file-attributes (car files)))))) + (format-time-string "%Y%m%d%H%M.%S"))) (prompt (concat "Change " attribute-name " of %s to" (if (eq op-symbol 'touch) " (default now): " --=-=-= Content-Type: text/plain -- Bastien --=-=-=--