* Minor bug in Emacs 22
@ 2008-02-20 14:26 Carsten Blaauw
0 siblings, 0 replies; only message in thread
From: Carsten Blaauw @ 2008-02-20 14:26 UTC (permalink / raw)
To: emacs-devel
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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-02-20 14:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-20 14:26 Minor bug in Emacs 22 Carsten Blaauw
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).