GNU bug report logs - #24518
25.2.50; dired-mark-extension with prefix arg fails

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Fri, 23 Sep 2016 14:16:01 UTC

Severity: normal

Tags: patch

Found in version 25.2.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#24518: closed (25.2.50; dired-mark-extension with prefix arg
 fails)
Date: Sat, 24 Sep 2016 15:12:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 24 Sep 2016 18:11:58 +0300
with message-id <83wpi1badd.fsf <at> gnu.org>
and subject line Re: bug#24518: 25.2.50; dired-mark-extension with prefix arg fails
has caused the debbugs.gnu.org bug report #24518,
regarding 25.2.50; dired-mark-extension with prefix arg fails
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
24518: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24518
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Tino Calancha <tino.calancha <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: tino.calancha <at> gmail.com
Subject: 25.2.50; dired-mark-extension with prefix arg fails
Date: Fri, 23 Sep 2016 23:13:52 +0900 (JST)
emacs -Q ~ -eval "(require 'dired-x)"
C-u * . el RET
;; signal error:
Wrong type argument: char-or-string-p, (4)

Because the interactive specification read MARKER-CHAR using 'P'.
That would be sensical if prefix argument has the meaning of unmark
files.  That behaviour is found elsewhere in Dired, for instance,
`dired-mark-executables', `dired-mark-directories',
`dired-mark-files-regexp'.

In following patch, `dired-mark-extension' with a prefix argument
unmark files:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 8f24f389b19a700b6cf48c187273234ae889aae4 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha <at> gmail.com>
Date: Fri, 23 Sep 2016 23:06:28 +0900
Subject: [PATCH] dired-mark-extension: With prefix arg unmark files

* lisp/dired-x.el (dired-mark-extension): When called interactively
with prefix argument, then unmark files (Bug#24518).
---
 lisp/dired-x.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 41c2256..834c0de 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -331,10 +331,13 @@ dired-extra-startup
 ;; Mark files with some extension.
 (defun dired-mark-extension (extension &optional marker-char)
   "Mark all files with a certain EXTENSION for use in later commands.
+A prefix argument means to unmark them instead.
 A `.' is *not* automatically prepended to the string entered.
 EXTENSION may also be a list of extensions instead of a single one.
 Optional MARKER-CHAR is marker to use."
-  (interactive "sMarking extension: \nP")
+  (interactive
+   (list (read-string "Marking extension: ")
+	 (and current-prefix-arg ?\s)))
   (or (listp extension)
       (setq extension (list extension)))
   (dired-mark-files-regexp
-- 
2.9.3


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

In GNU Emacs 25.2.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.0)
 of 2016-09-23
Repository revision: 65dc67c87553bec4c8b36432246b13f09d653118


[Message part 3 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 24518-done <at> debbugs.gnu.org, schwab <at> linux-m68k.org
Subject: Re: bug#24518: 25.2.50; dired-mark-extension with prefix arg fails
Date: Sat, 24 Sep 2016 18:11:58 +0300
> From: Tino Calancha <tino.calancha <at> gmail.com>
> Date: Sat, 24 Sep 2016 23:06:46 +0900 (JST)
> cc: Andreas Schwab <schwab <at> linux-m68k.org>, tino.calancha <at> gmail.com, 
>     24518 <at> debbugs.gnu.org
> 
> Feel free to fix the bug as you wish and push it to the repository.
> I don't want to do it myself, because i don't want my name appear in
> the git log as the author of that solution.

Done.


This bug report was last modified 8 years and 296 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.