From: Juri Linkov <juri@linkov.net>
To: Chunyang Xu <mail@xuchunyang.me>
Cc: 25578@debbugs.gnu.org
Subject: bug#25578: [PATCH] Prompt default extension in dired-mark-extension
Date: Mon, 06 Feb 2017 01:20:23 +0200 [thread overview]
Message-ID: <87r33cuw4w.fsf@mail.linkov.net> (raw)
In-Reply-To: <m2y3xsek7b.fsf@xuchunyang.me> (Chunyang Xu's message of "Mon, 30 Jan 2017 21:44:24 +0800")
> I want 'M-x dired-mark-extension' (from dired-x) in Dired to use the
> extension of the file at point as default extension, when it is
> possible. Because, in this way, I usually no longer need to type the
> extension manually, which saves some time for me–someone can't type
> English words quickly and accurately.
Thanks, I think your patch is a useful addition.
Also I'm using a similar feature for another Dired command
‘dired-mark-files-regexp’ that could provide similar defaults
based on the current file and its extension:
diff --git a/lisp/dired.el b/lisp/dired.el
index 2733372..7d7af0b 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3361,7 +3361,12 @@ (defun dired-mark-files-regexp (regexp &optional marker-char)
(interactive
(list (read-regexp (concat (if current-prefix-arg "Unmark" "Mark")
" files (regexp): ")
- nil 'dired-regexp-history)
+ (delq nil (list (dired-get-filename t t)
+ (and (dired-get-filename nil t)
+ (concat (regexp-quote (file-name-extension
+ (dired-get-filename nil t) t))
+ "\\'"))))
+ 'dired-regexp-history)
(if current-prefix-arg ?\040)))
(let ((dired-marker-char (or marker-char dired-marker-char)))
(dired-mark-if
next prev parent reply other threads:[~2017-02-05 23:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-30 13:44 bug#25578: [PATCH] Prompt default extension in dired-mark-extension Chunyang Xu
2017-02-05 23:20 ` Juri Linkov [this message]
2017-02-06 13:58 ` Tino Calancha
2017-02-27 22:45 ` Juri Linkov
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=87r33cuw4w.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=25578@debbugs.gnu.org \
--cc=mail@xuchunyang.me \
/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.