From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Carsten Blaauw Newsgroups: gmane.emacs.devel Subject: Minor bug in Emacs 22 Date: Wed, 20 Feb 2008 14:26:54 +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 1203517821 25372 80.91.229.12 (20 Feb 2008 14:30:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Feb 2008 14:30:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 20 15:30:45 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 1JRpy7-0004Ay-6a for ged-emacs-devel@m.gmane.org; Wed, 20 Feb 2008 15:30:43 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JRpxc-0000gS-36 for ged-emacs-devel@m.gmane.org; Wed, 20 Feb 2008 09:30:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JRpxX-0000gA-Rf for emacs-devel@gnu.org; Wed, 20 Feb 2008 09:30:07 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JRpxV-0000et-WB for emacs-devel@gnu.org; Wed, 20 Feb 2008 09:30:06 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JRpxV-0000eV-QK for emacs-devel@gnu.org; Wed, 20 Feb 2008 09:30:05 -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 1JRpxV-00065K-Ft for emacs-devel@gnu.org; Wed, 20 Feb 2008 09:30:05 -0500 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1JRpxS-0005VG-Sx for emacs-devel@gnu.org; Wed, 20 Feb 2008 14:30: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 ; Wed, 20 Feb 2008 14:30:02 +0000 Original-Received: from it-media.blaauw by 53.122.196.39 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Feb 2008 14:30: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-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:89687 Archived-At: Hello Emacs developers, in version 22.1 and 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 culprit. 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 cope with that situation. The patch has been diffed to the cvs version 22.1.91 from this morning. Thanks to all of you for your work. Regards, 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.