From: Tino Calancha <tino.calancha@gmail.com>
To: 24518@debbugs.gnu.org
Cc: tino.calancha@gmail.com
Subject: bug#24518: 25.2.50; dired-mark-extension with prefix arg fails
Date: Fri, 23 Sep 2016 23:13:52 +0900 (JST) [thread overview]
Message-ID: <alpine.DEB.2.20.1609232312530.14847@calancha-pc> (raw)
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@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
next reply other threads:[~2016-09-23 14:13 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-23 14:13 Tino Calancha [this message]
2016-09-24 11:52 ` bug#24518: 25.2.50; dired-mark-extension with prefix arg fails Eli Zaretskii
2016-09-24 12:30 ` Tino Calancha
2016-09-24 12:53 ` Eli Zaretskii
2016-09-24 13:02 ` Tino Calancha
2016-09-24 13:49 ` Eli Zaretskii
2016-09-24 13:15 ` Andreas Schwab
2016-09-24 13:51 ` Eli Zaretskii
2016-09-24 14:06 ` Tino Calancha
2016-09-24 15:11 ` Eli Zaretskii
2016-09-24 16:48 ` Andreas Schwab
2016-09-24 16:58 ` Eli Zaretskii
2016-09-24 17:14 ` Tino Calancha
2016-09-24 17:39 ` Eli Zaretskii
2016-09-24 17:49 ` Tino Calancha
2016-09-24 19:23 ` Andreas Schwab
2016-09-24 19:13 ` Andreas Schwab
2016-09-24 19:29 ` Eli Zaretskii
2016-09-24 19:41 ` Andreas Schwab
2016-09-25 18:34 ` John Wiegley
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1609232312530.14847@calancha-pc \
--to=tino.calancha@gmail.com \
--cc=24518@debbugs.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 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).