From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#25578: [PATCH] Prompt default extension in dired-mark-extension Date: Mon, 06 Feb 2017 01:20:23 +0200 Organization: LINKOV.NET Message-ID: <87r33cuw4w.fsf@mail.linkov.net> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1486338855 975 195.159.176.226 (5 Feb 2017 23:54:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 5 Feb 2017 23:54:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu) Cc: 25578@debbugs.gnu.org To: Chunyang Xu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 06 00:54:12 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1caWdH-00006J-Dq for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Feb 2017 00:54:11 +0100 Original-Received: from localhost ([::1]:44916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caWdN-00070Y-1E for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Feb 2017 18:54:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caWdD-000704-Li for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2017 18:54:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1caWd9-0007Bs-95 for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2017 18:54:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58811) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1caWd9-0007Bn-6V for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2017 18:54:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1caWd8-0000jg-W7 for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2017 18:54:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Feb 2017 23:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25578 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 25578-submit@debbugs.gnu.org id=B25578.14863387902743 (code B ref 25578); Sun, 05 Feb 2017 23:54:02 +0000 Original-Received: (at 25578) by debbugs.gnu.org; 5 Feb 2017 23:53:10 +0000 Original-Received: from localhost ([127.0.0.1]:57005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1caWcG-0000i4-Sg for submit@debbugs.gnu.org; Sun, 05 Feb 2017 18:53:09 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:53985 helo=homiemail-a13.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1caWcE-0000hn-OH for 25578@debbugs.gnu.org; Sun, 05 Feb 2017 18:53:07 -0500 Original-Received: from homiemail-a13.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a13.g.dreamhost.com (Postfix) with ESMTP id 72068334075; Sun, 5 Feb 2017 15:53:03 -0800 (PST) Original-Received: from localhost.linkov.net (m213-100-245-249.cust.tele2.ee [213.100.245.249]) (Authenticated sender: jurta@jurta.org) by homiemail-a13.g.dreamhost.com (Postfix) with ESMTPA id 98DE433406C; Sun, 5 Feb 2017 15:53:02 -0800 (PST) In-Reply-To: (Chunyang Xu's message of "Mon, 30 Jan 2017 21:44:24 +0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129012 Archived-At: > 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=E2=80=93someone 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 =E2=80=98dired-mark-files-regexp=E2=80=99 that could provide similar defa= ults 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 m= arker-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-n= ame-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