emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patch for dired.el


From: Carsten Blaauw
Subject: patch for dired.el
Date: Fri, 22 Feb 2008 12:11:14 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

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.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]