From unknown Fri Sep 05 18:57:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12399: 24.2.50; dired-do-touch doesn't recognize empty input in minibuffer Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Sep 2012 22:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12399 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 12399@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13472309613732 (code B ref -1); Sun, 09 Sep 2012 22:50:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Sep 2012 22:49:21 +0000 Received: from localhost ([127.0.0.1]:50788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TAqJc-0000y9-Tb for submit@debbugs.gnu.org; Sun, 09 Sep 2012 18:49:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50654) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TAqJa-0000y2-WC for submit@debbugs.gnu.org; Sun, 09 Sep 2012 18:49:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TAqJ4-0001ZC-LF for submit@debbugs.gnu.org; Sun, 09 Sep 2012 18:48:47 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:42726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAqJ4-0001Z7-I8 for submit@debbugs.gnu.org; Sun, 09 Sep 2012 18:48:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAqJ3-0004Fh-Os for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2012 18:48:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TAqJ2-0001Yo-W1 for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2012 18:48:45 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:49605 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAqJ2-0001Ye-QC for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2012 18:48:44 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 5D643451CCA5 for ; Sun, 9 Sep 2012 15:48:43 -0700 (PDT) From: Juri Linkov Organization: JURTA Date: Mon, 10 Sep 2012 01:43:14 +0300 Message-ID: <878vciakcd.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) `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))) From unknown Fri Sep 05 18:57:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12399: 24.2.50; dired-do-touch doesn't recognize empty input in minibuffer 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: To: Juri Linkov Cc: 12399@debbugs.gnu.org Received: via spool by 12399-submit@debbugs.gnu.org id=B12399.134737451726889 (code B ref 12399); Tue, 11 Sep 2012 14:42:02 +0000 Received: (at 12399) by debbugs.gnu.org; 11 Sep 2012 14:41:57 +0000 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 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 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== Received: by 10.180.14.8 with SMTP id l8mr25663186wic.6.1347374472108; Tue, 11 Sep 2012 07:41:12 -0700 (PDT) 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) Received: by myhost.localdomain (Postfix, from userid 1000) id 5809C89A2; Tue, 11 Sep 2012 16:41:13 +0200 (CEST) From: Bastien In-Reply-To: <878vciakcd.fsf@mail.jurta.org> (Juri Linkov's message of "Mon, 10 Sep 2012 01:43:14 +0300") References: <878vciakcd.fsf@mail.jurta.org> User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (gnu/linux) Date: Tue, 11 Sep 2012 16:41:13 +0200 Message-ID: <87k3w01v1y.fsf@altern.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) --=-=-= 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 --=-=-=-- From unknown Fri Sep 05 18:57:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12399: 24.2.50; dired-do-touch doesn't recognize empty input in minibuffer Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Sep 2012 19:11: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: To: Bastien Cc: 12399@debbugs.gnu.org Received: via spool by 12399-submit@debbugs.gnu.org id=B12399.134739062629051 (code B ref 12399); Tue, 11 Sep 2012 19:11:02 +0000 Received: (at 12399) by debbugs.gnu.org; 11 Sep 2012 19:10:26 +0000 Received: from localhost ([127.0.0.1]:55140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TBVqs-0007YW-Ds for submit@debbugs.gnu.org; Tue, 11 Sep 2012 15:10:26 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:58350 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TBVqn-0007YG-PU for 12399@debbugs.gnu.org; Tue, 11 Sep 2012 15:10:24 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 71A99451CC7D; Tue, 11 Sep 2012 12:09:37 -0700 (PDT) From: Juri Linkov Organization: JURTA References: <878vciakcd.fsf@mail.jurta.org> <87k3w01v1y.fsf@altern.org> Date: Tue, 11 Sep 2012 22:05:01 +0300 In-Reply-To: <87k3w01v1y.fsf@altern.org> (Bastien's message of "Tue, 11 Sep 2012 16:41:13 +0200") Message-ID: <87sjao5r1y.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > 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. Sorry, but it removes using the modification time of current file for editing in the minibuffer via M-n, and what is worse, it uses the current time as the argument of `touch' that might cause race conditions as described in http://thread.gmane.org/gmane.emacs.devel/142449/focus=142494 Fortunately, thanks to `completing-read-function' it's easy to fix this with a small change that adds a new function `completing-read-without-default' that works like `completing-read-default' but returns the empty string for empty input like `read-from-minibuffer': === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2012-09-08 14:48:27 +0000 +++ lisp/dired-aux.el 2012-09-11 19:04:20 +0000 @@ -391,10 +391,11 @@ (defun dired-mark-read-string (prompt in Optional arg COLLECTION is a collection of possible completions, passed as the second arg to `completing-read'." + (let ((completing-read-function 'completing-read-without-default)) (dired-mark-pop-up nil op-symbol files 'completing-read (format prompt (dired-mark-prompt arg files)) - collection nil nil initial nil default-value nil)) + collection nil nil initial nil default-value nil))) ;;; Cleaning a directory: flagging some backups for deletion. === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2012-09-01 04:28:24 +0000 +++ lisp/minibuffer.el 2012-09-11 19:03:14 +0000 @@ -3089,11 +3108,14 @@ (defvar completing-read-function 'comple "The function called by `completing-read' to do its work. It should accept the same arguments as `completing-read'.") -(defun completing-read-default (prompt collection &optional predicate +(defun completing-read-without-default (prompt collection &optional predicate require-match initial-input hist def inherit-input-method) - "Default method for reading from the minibuffer with completion. -See `completing-read' for the meaning of the arguments." + "Read a string with completion and without returning the default value. +See `completing-read' for the meaning of the arguments. +Unlike `completing-read-default', for empty input it returns +the empty string instead of the default value. Thus it handles +empty input like `read-from-minibuffer'." (when (consp initial-input) (setq initial-input @@ -3121,10 +3143,23 @@ (defun completing-read-default (prompt c base-keymap))) (result (read-from-minibuffer prompt initial-input keymap nil hist def inherit-input-method))) + result)) + +(defun completing-read-default (prompt collection &optional predicate + require-match initial-input + hist def inherit-input-method) + "Default method for reading from the minibuffer with completion. +See `completing-read' for the meaning of the arguments. +Unlike `completing-read-without-default', for empty input it returns +the default value instead of the empty string." + (let ((result (completing-read-without-default + prompt collection predicate require-match + initial-input hist def inherit-input-method))) (when (and (equal result "") def) (setq result (if (consp def) (car def) def))) result)) From unknown Fri Sep 05 18:57:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12399: 24.2.50; dired-do-touch doesn't recognize empty input in minibuffer Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Sep 2012 20:48:01 +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: To: Juri Linkov Cc: Bastien , 12399@debbugs.gnu.org Received: via spool by 12399-submit@debbugs.gnu.org id=B12399.13473964225523 (code B ref 12399); Tue, 11 Sep 2012 20:48:01 +0000 Received: (at 12399) by debbugs.gnu.org; 11 Sep 2012 20:47:02 +0000 Received: from localhost ([127.0.0.1]:55277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TBXML-0001Qv-Ck for submit@debbugs.gnu.org; Tue, 11 Sep 2012 16:47:01 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:45150) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TBXMI-0001Qn-GR for 12399@debbugs.gnu.org; Tue, 11 Sep 2012 16:46:59 -0400 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id q8BKkAfm004125; Tue, 11 Sep 2012 16:46:10 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id B253DB4085; Tue, 11 Sep 2012 16:46:10 -0400 (EDT) From: Stefan Monnier Message-ID: References: <878vciakcd.fsf@mail.jurta.org> <87k3w01v1y.fsf@altern.org> <87sjao5r1y.fsf@mail.jurta.org> Date: Tue, 11 Sep 2012 16:46:10 -0400 In-Reply-To: <87sjao5r1y.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 11 Sep 2012 22:05:01 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.9 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.9 (---) > Fortunately, thanks to `completing-read-function' > it's easy to fix this with a small change that adds > a new function `completing-read-without-default' > that works like `completing-read-default' > but returns the empty string for empty input > like `read-from-minibuffer': 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'. Stefan From unknown Fri Sep 05 18:57:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12399: 24.2.50; dired-do-touch doesn't recognize empty input in minibuffer Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Sep 2012 22:54: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: To: Stefan Monnier Cc: Bastien , 12399@debbugs.gnu.org Received: via spool by 12399-submit@debbugs.gnu.org id=B12399.134740401016397 (code B ref 12399); Tue, 11 Sep 2012 22:54:02 +0000 Received: (at 12399) by debbugs.gnu.org; 11 Sep 2012 22:53:30 +0000 Received: from localhost ([127.0.0.1]:55375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TBZKj-0004GP-T1 for submit@debbugs.gnu.org; Tue, 11 Sep 2012 18:53:30 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:33692 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TBZKf-0004GF-8H for 12399@debbugs.gnu.org; Tue, 11 Sep 2012 18:53:26 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 83AF2451CCB7; Tue, 11 Sep 2012 15:52:40 -0700 (PDT) From: Juri Linkov Organization: JURTA References: <878vciakcd.fsf@mail.jurta.org> <87k3w01v1y.fsf@altern.org> <87sjao5r1y.fsf@mail.jurta.org> Date: Wed, 12 Sep 2012 01:50:35 +0300 In-Reply-To: (Stefan Monnier's message of "Tue, 11 Sep 2012 16:46:10 -0400") Message-ID: <87627k41rj.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > 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))) From unknown Fri Sep 05 18:57:53 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Juri Linkov Subject: bug#12399: closed (Re: bug#12399: 24.2.50; dired-do-touch doesn't recognize empty input in minibuffer) Message-ID: References: <87r4q5cww2.fsf@mail.jurta.org> <878vciakcd.fsf@mail.jurta.org> X-Gnu-PR-Message: they-closed 12399 X-Gnu-PR-Package: emacs Reply-To: 12399@debbugs.gnu.org Date: Thu, 13 Sep 2012 23:46:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1347579962-24430-1" This is a multi-part message in MIME format... ------------=_1347579962-24430-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #12399: 24.2.50; dired-do-touch doesn't recognize empty input in minibuffer which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 12399@debbugs.gnu.org. --=20 12399: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D12399 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1347579962-24430-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 12399-done) by debbugs.gnu.org; 13 Sep 2012 23:45:22 +0000 Received: from localhost ([127.0.0.1]:60840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCJ62-0006Kw-0E for submit@debbugs.gnu.org; Thu, 13 Sep 2012 19:45:22 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:57403 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCJ5y-0006Ki-Vw for 12399-done@debbugs.gnu.org; Thu, 13 Sep 2012 19:45:19 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 97DDD451CCBE; Thu, 13 Sep 2012 16:44:23 -0700 (PDT) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#12399: 24.2.50; dired-do-touch doesn't recognize empty input in minibuffer Organization: JURTA References: <878vciakcd.fsf@mail.jurta.org> <87k3w01v1y.fsf@altern.org> <87sjao5r1y.fsf@mail.jurta.org> <87627k41rj.fsf@mail.jurta.org> Date: Fri, 14 Sep 2012 02:42:53 +0300 In-Reply-To: <87627k41rj.fsf@mail.jurta.org> (Juri Linkov's message of "Wed, 12 Sep 2012 01:50:35 +0300") Message-ID: <87r4q5cww2.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 12399-done Cc: Bastien , 12399-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) >> 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. Installed. ------------=_1347579962-24430-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 Sep 2012 22:49:21 +0000 Received: from localhost ([127.0.0.1]:50788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TAqJc-0000y9-Tb for submit@debbugs.gnu.org; Sun, 09 Sep 2012 18:49:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50654) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TAqJa-0000y2-WC for submit@debbugs.gnu.org; Sun, 09 Sep 2012 18:49:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TAqJ4-0001ZC-LF for submit@debbugs.gnu.org; Sun, 09 Sep 2012 18:48:47 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:42726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAqJ4-0001Z7-I8 for submit@debbugs.gnu.org; Sun, 09 Sep 2012 18:48:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAqJ3-0004Fh-Os for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2012 18:48:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TAqJ2-0001Yo-W1 for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2012 18:48:45 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:49605 helo=ps18281.dreamhostps.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAqJ2-0001Ye-QC for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2012 18:48:44 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 5D643451CCA5 for ; Sun, 9 Sep 2012 15:48:43 -0700 (PDT) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: 24.2.50; dired-do-touch doesn't recognize empty input in minibuffer Organization: JURTA Date: Mon, 10 Sep 2012 01:43:14 +0300 Message-ID: <878vciakcd.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) `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))) ------------=_1347579962-24430-1-- From unknown Fri Sep 05 18:57:53 2025 X-Loop: help-debbugs@gnu.org Subject: bug#12399: 24.2.50; dired-do-touch doesn't recognize empty input in minibuffer Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Sep 2012 23:02:03 +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: To: 12399@debbugs.gnu.org Received: via spool by 12399-submit@debbugs.gnu.org id=B12399.134766368626297 (code B ref 12399); Fri, 14 Sep 2012 23:02:03 +0000 Received: (at 12399) by debbugs.gnu.org; 14 Sep 2012 23:01:26 +0000 Received: from localhost ([127.0.0.1]:34427 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCet2-0006q2-Fg for submit@debbugs.gnu.org; Fri, 14 Sep 2012 19:01:25 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:55117 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCesx-0006ps-T9 for 12399@debbugs.gnu.org; Fri, 14 Sep 2012 19:01:20 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 5FF9D451CC45 for <12399@debbugs.gnu.org>; Fri, 14 Sep 2012 16:00:19 -0700 (PDT) From: Juri Linkov Organization: JURTA References: <878vciakcd.fsf@mail.jurta.org> <87k3w01v1y.fsf@altern.org> <87sjao5r1y.fsf@mail.jurta.org> <87627k41rj.fsf@mail.jurta.org> <87r4q5cww2.fsf@mail.jurta.org> Date: Sat, 15 Sep 2012 01:59:31 +0300 In-Reply-To: <87r4q5cww2.fsf@mail.jurta.org> (Juri Linkov's message of "Fri, 14 Sep 2012 02:42:53 +0300") Message-ID: <87627g5jfw.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) >>> 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. > > Installed. I noticed the same problem in `dired-do-chmod' and fixed it the same way.