* patch for dired.el
@ 2008-02-22 12:11 Carsten Blaauw
2008-02-22 15:26 ` Mathias Dahl
2008-02-22 18:47 ` Stefan Monnier
0 siblings, 2 replies; 3+ messages in thread
From: Carsten Blaauw @ 2008-02-22 12:11 UTC (permalink / raw)
To: emacs-pretest-bug
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: patch for dired.el
2008-02-22 12:11 patch for dired.el Carsten Blaauw
@ 2008-02-22 15:26 ` Mathias Dahl
2008-02-22 18:47 ` Stefan Monnier
1 sibling, 0 replies; 3+ messages in thread
From: Mathias Dahl @ 2008-02-22 15:26 UTC (permalink / raw)
To: Carsten Blaauw; +Cc: emacs-pretest-bug
> 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.
Maybe I should add to make it more clear that it is only the *prompt*
that is wrong, i.e. the message the user sees. The list of files still
contain only the marked file.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: patch for dired.el
2008-02-22 12:11 patch for dired.el Carsten Blaauw
2008-02-22 15:26 ` Mathias Dahl
@ 2008-02-22 18:47 ` Stefan Monnier
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2008-02-22 18:47 UTC (permalink / raw)
To: Carsten Blaauw; +Cc: emacs-pretest-bug
> 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
Thanks for tracking it down, I installed a slightly different fix.
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-02-22 18:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-22 12:11 patch for dired.el Carsten Blaauw
2008-02-22 15:26 ` Mathias Dahl
2008-02-22 18:47 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.