emacs-devel
[Top][All Lists]
Advanced

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

Minor bug in Emacs 22


From: Carsten Blaauw
Subject: Minor bug in Emacs 22
Date: Wed, 20 Feb 2008 14:26:54 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

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.






reply via email to

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