From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] fix goto-line Date: Fri, 29 Jul 2011 18:28:46 +0300 Organization: JURTA Message-ID: <8762mlglnt.fsf@mail.jurta.org> References: <874o26muk2.fsf@gnu.org> <8762ml5odm.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1311954033 6383 80.91.229.12 (29 Jul 2011 15:40:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 29 Jul 2011 15:40:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 29 17:40:29 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QmpAr-0004Lg-26 for ged-emacs-devel@m.gmane.org; Fri, 29 Jul 2011 17:40:29 +0200 Original-Received: from localhost ([::1]:34905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmpAq-0003pr-Dg for ged-emacs-devel@m.gmane.org; Fri, 29 Jul 2011 11:40:28 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:42481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmpAn-0003pY-IM for emacs-devel@gnu.org; Fri, 29 Jul 2011 11:40:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QmpAl-0003Fi-Sy for emacs-devel@gnu.org; Fri, 29 Jul 2011 11:40:25 -0400 Original-Received: from smarty.dreamhost.com ([208.113.175.8]:49897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmpAl-0003FS-Oc for emacs-devel@gnu.org; Fri, 29 Jul 2011 11:40:23 -0400 Original-Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id 736DC6E805E; Fri, 29 Jul 2011 08:40:22 -0700 (PDT) Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 7DE63451C287; Fri, 29 Jul 2011 08:40:21 -0700 (PDT) In-Reply-To: (Juanma Barranquero's message of "Fri, 29 Jul 2011 13:22:31 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.113.175.8 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:142490 Archived-At: > There are improvements and not bug fixes, so please file this as a > wishlist item for 24.2 (and do not forget to add the "patch" tag). These are improvements, but changes in the default value of `dired-do-touch' is a regression. I'd like to fix this regression with the following patch. It restores the old pre-24 essential behavior, but still keeps the requirement asked by the reporter of bug#6887 to use the current time. More changes from http://thread.gmane.org/gmane.emacs.devel/81414/focus=82988 could be postponed to 24.2. === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2011-07-25 08:23:29 +0000 +++ lisp/dired-aux.el 2011-07-29 15:27:45 +0000 @@ -227,20 +227,6 @@ (defun dired-files-attributes (dir) (directory-files dir))) -(defun dired-touch-initial (files) - "Create initial input value for `touch' command." - ;; Nobody can explain what this version is supposed to do. (Bug#6887) - ;; Also, the manual says it uses "the present time". - ;;; (let (initial) - ;;; (while files - ;;; (let ((current (nth 5 (file-attributes (car files))))) - ;;; (if (and initial (not (equal initial current))) - ;;; (setq initial (current-time) files nil) - ;;; (setq initial current)) - ;;; (setq files (cdr files)))) - ;;; (format-time-string "%Y%m%d%H%M.%S" initial))) - (format-time-string "%Y%m%d%H%M.%S" (current-time))) - (defun dired-do-chxxx (attribute-name program op-symbol arg) ;; Change file attributes (mode, group, owner, timestamp) of marked files and ;; refresh their file lines. @@ -249,11 +235,18 @@ (defun dired-do-chxxx (attribute-name pr ;; OP-SYMBOL is the type of operation (for use in dired-mark-pop-up). ;; ARG describes which files to use, as in dired-get-marked-files. (let* ((files (dired-get-marked-files t arg)) + (initial + (if (eq op-symbol 'touch) + (format-time-string "%Y%m%d%H%M.%S" (current-time)))) + (default + (if (eq op-symbol 'touch) + (and (stringp (car files)) + (format-time-string "%Y%m%d%H%M.%S" + (nth 5 (file-attributes (car files))))))) (new-attribute (dired-mark-read-string (concat "Change " attribute-name " of %s to: ") - (if (eq op-symbol 'touch) (dired-touch-initial files)) - op-symbol arg files)) + initial op-symbol arg files default)) (operation (concat program " " new-attribute)) failures) (setq failures