From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Carsten Blaauw Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: patch for dired.el Date: Fri, 22 Feb 2008 12:11:14 +0000 (UTC) Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1203691371 5183 80.91.229.12 (22 Feb 2008 14:42:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Feb 2008 14:42:51 +0000 (UTC) To: emacs-pretest-bug@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 22 15:43:16 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JSZ7A-0000YN-Sa for ged-emacs-devel@m.gmane.org; Fri, 22 Feb 2008 15:43:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JSZ6f-0002jO-BV for ged-emacs-devel@m.gmane.org; Fri, 22 Feb 2008 09:42:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JSWoC-0007Ir-LI for emacs-devel@gnu.org; Fri, 22 Feb 2008 07:15:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JSWoA-0007Ho-K1 for emacs-devel@gnu.org; Fri, 22 Feb 2008 07:15:19 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JSWoA-0007HY-4q for emacs-devel@gnu.org; Fri, 22 Feb 2008 07:15:18 -0500 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JSWo9-0001ln-SE for emacs-devel@gnu.org; Fri, 22 Feb 2008 07:15:17 -0500 Original-Received: from mail.gnu.org ([199.232.76.166] helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JSWo9-0001ha-JM for emacs-pretest-bug@gnu.org; Fri, 22 Feb 2008 07:15:17 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JSWo5-0001kf-V4 for emacs-pretest-bug@gnu.org; Fri, 22 Feb 2008 07:15:17 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JSWo5-0001k5-Cd for emacs-pretest-bug@gnu.org; Fri, 22 Feb 2008 07:15:13 -0500 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1JSWnu-0005hy-ES for emacs-pretest-bug@gnu.org; Fri, 22 Feb 2008 12:15:02 +0000 Original-Received: from 53.122.196.39 ([53.122.196.39]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Feb 2008 12:15:02 +0000 Original-Received: from it-media.blaauw by 53.122.196.39 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Feb 2008 12:15:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 62 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 53.122.196.39 (Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Fri, 22 Feb 2008 09:40:53 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:89963 gmane.emacs.pretest.bugs:21264 Archived-At: Hello Emacs developers, I posted the following already to emacs-devel, but nobody responded, maybe the subject was too general. This group might be suited better, even if not only the pretest is affected but also the alreday released version 22.1.1 In version 22.1.91 when marking a single file in dired and invoking operations on that file via the menu (e.g. byte compile or compress), the dialog asks about 2 files. After having looked to the sources in dired.el and dired-aux.el I found the reason. The function dired-get-marked-files calls dired-map-over-marks with the optional parameter distinguish-one-marked set to true; the resulting list contains a t as first element to indicate, that only one file is marked. Later the function dired-mark-prompt is called with that list and assumes more than one file is selected, because the list has more than one element. Attached is a patch to dired.el. The patch has been diffed to the cvs version 22.1.91 from this morning. Hope this helps Carsten *** dired.el.orig 2008-02-20 09:57:56.107748600 +0100 --- dired.el 2008-02-20 14:57:52.805985900 +0100 *************** *** 2536,2551 **** ;; Return a string for use in a prompt, either the current file ;; name, or the marker and a count of marked files. (let ((count (length files))) ! (if (= count 1) ! (car files) ! ;; more than 1 file: ! (if (integerp arg) ! ;; abs(arg) = count ! ;; Perhaps this is nicer, but it also takes more screen space: ! ;;(format "[%s %d files]" (if (> arg 0) "next" "previous") ! ;; count) ! (format "[next %d files]" arg) ! (format "%c [%d files]" dired-marker-char count))))) (defun dired-pop-to-buffer (buf) ;; Pop up buffer BUF. --- 2536,2553 ---- ;; Return a string for use in a prompt, either the current file ;; name, or the marker and a count of marked files. (let ((count (length files))) ! (cond ((= count 1) ! (car files)) ! ((and (= count 2) (eq (car files) t)) ! (cadr files)) ! ((integerp arg) ! ;; abs(arg) = count ! ;; Perhaps this is nicer, but it also takes more screen space: ! ;;(format "[%s %d files]" (if (> arg 0) "next" "previous") ! ;; count) ! (format "[next %d files]" arg)) ! (t ! (format "%c [%d files]" dired-marker-char count))))) (defun dired-pop-to-buffer (buf) ;; Pop up buffer BUF.