all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Carsten Blaauw <it-media.blaauw@daimler.com>
To: emacs-pretest-bug@gnu.org
Subject: patch for dired.el
Date: Fri, 22 Feb 2008 12:11:14 +0000 (UTC)	[thread overview]
Message-ID: <loom.20080222T120618-568@post.gmane.org> (raw)

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	other threads:[~2008-02-22 12:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-22 12:11 Carsten Blaauw [this message]
2008-02-22 15:26 ` patch for dired.el Mathias Dahl
2008-02-22 18:47 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20080222T120618-568@post.gmane.org \
    --to=it-media.blaauw@daimler.com \
    --cc=emacs-pretest-bug@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.