From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 29 07:43:28 2018 Received: (at submit) by debbugs.gnu.org; 29 Jan 2018 12:43:28 +0000 Received: from localhost ([127.0.0.1]:47165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eg8mW-0006FH-FD for submit@debbugs.gnu.org; Mon, 29 Jan 2018 07:43:28 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eg8mV-0006F5-Ae for submit@debbugs.gnu.org; Mon, 29 Jan 2018 07:43:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eg8mL-0007Tv-9k for submit@debbugs.gnu.org; Mon, 29 Jan 2018 07:43:21 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50340) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eg8mL-0007Ta-6J for submit@debbugs.gnu.org; Mon, 29 Jan 2018 07:43:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eg8mG-00018j-C9 for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2018 07:43:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eg8mB-0007GP-GJ for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2018 07:43:12 -0500 Received: from homie.mail.dreamhost.com ([208.97.132.208]:33278 helo=homiemail-a62.g.dreamhost.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eg8mA-0007DN-UT for bug-gnu-emacs@gnu.org; Mon, 29 Jan 2018 07:43:07 -0500 Received: from homiemail-a62.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a62.g.dreamhost.com (Postfix) with ESMTP id D2DF163406F for ; Mon, 29 Jan 2018 04:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to :subject:date:message-id:mime-version:content-type; s= jidanni.org; bh=UNpsJO1Czcm/ryiko2/kFomc8pE=; b=jo/P35DMp3eiSkLq /GMpaSI/4AFUJiZOfdfNcwWOsAE4U0EUuQXQRORg8d9zNf2FExIjiTFQ3FSX8xu4 v15cy29p6yLN/tAMsFYgBJaNFLKBo1H8KgJQDvPtV11gdwjGAwGPqM6jjLbp7LbR jK4IcBafEaU7bKsP8aQb8xsNIf4= Received: from jidanni.org (111-246-87-124.dynamic-ip.hinet.net [111.246.87.124]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni@jidanni.org) by homiemail-a62.g.dreamhost.com (Postfix) with ESMTPSA id 97ECB634075 for ; Mon, 29 Jan 2018 04:43:03 -0800 (PST) From: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson To: bug-gnu-emacs@gnu.org Subject: dired-do-chmod vs. top line of dired Date: Mon, 29 Jan 2018 20:32:51 +0800 Message-ID: <87mv0wg80c.fsf@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) M runs the command dired-do-chmod. If used on the very top line of dired (the directory name,) it says: "Change mode of * [0 files] to: " which doesn't make a lot of sense. emacs-version "25.2.2" Same problem if used on the second line, (total...). (Why doesn't it just complain "can't operate on" like it does for the third line, ".".) From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 29 10:14:16 2018 Received: (at 30285) by debbugs.gnu.org; 29 Jan 2018 15:14:17 +0000 Received: from localhost ([127.0.0.1]:48023 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egB8S-0005Os-KN for submit@debbugs.gnu.org; Mon, 29 Jan 2018 10:14:16 -0500 Received: from mail-pg0-f51.google.com ([74.125.83.51]:43550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egB8Q-0005OX-Kz for 30285@debbugs.gnu.org; Mon, 29 Jan 2018 10:14:15 -0500 Received: by mail-pg0-f51.google.com with SMTP id n17so4681233pgf.10 for <30285@debbugs.gnu.org>; Mon, 29 Jan 2018 07:14:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=esNEVPt5xpJ8y9BIUp0unTxbXG3Hk4K3s1HdbNTYzHQ=; b=jN9uJDu66U1JCAlDqTe9mWRp/1gFdqHwsfMcSc9uZiueD9YtQh1XCf2yfwq5Cq27sk SLpAeQXU11zRAj03JLcHDht5yB7rhyvmxHMW2wcLJ5liOl4NnDIouISDhFPUBQ1XuPa0 bujQHsDlqcWhy/czxVWFvWd/3eCEmvg2+QFPIU1CDe/4k3rkZfRBRw/rj7sS9/LVlrZZ +kxrU9x2WxgKtCFAAKGy0SyNDy7BRDJZ1droAsJDCe7Mi5df9yQM5NB7i0zDLoSAA1q6 rAPQiaB6LK+iP6R4/QHogFmWi5Xaw/eDJKBRHgJPOBZGKnHJUr1iq/msE9XJ5QZVoXRo GZFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=esNEVPt5xpJ8y9BIUp0unTxbXG3Hk4K3s1HdbNTYzHQ=; b=NxRrXQA4xTBlY+K7oFAvNz5Xu6NX3lkhud+iLcK8uiksZEO7kn6aKIU9dr9afynVSu mPTO/SReuCWKbX8K+fpOwnNYPLi0AHpP7zrHpCuRgXDQqtQnET/OkWckEsESYreNE8L7 L6Hsyev4Bh4bX6nXe2hcs9Pb1UqGbG5C9f8brUEqesa+PS5VoBbhXldNodhUXt5rCafx NI6vbmPKTU8R+/1n8U0k8qW4uSGtsoUafiyn47gv9AEe6phOXb3Vvsg6WQuDZ6F/U7dP /j8zjaNdzex05ca1LpyBMgT8//RDRYSGdpc3zdvG1uji4r9/Z1LIsClKgDjl1g8WSYuF oFLw== X-Gm-Message-State: AKwxyteS6Faa4zrPLpIRVffzHPdMsSdHDRiXMRcuD1AxiFOdQ47F/c/T BZLq/woUHAv/TqRduF9XrgeDwg== X-Google-Smtp-Source: AH8x227ZpEmuWrl278ZxkQ4QL1SgfryZObIvlm6RlKopwVg+wNHMXtvCEXicDlgpDhi7FjsuS9pjHg== X-Received: by 10.98.232.14 with SMTP id c14mr27648214pfi.215.1517238848750; Mon, 29 Jan 2018 07:14:08 -0800 (PST) Received: from calancha-pc (146.219.128.101.dy.bbexcite.jp. [101.128.219.146]) by smtp.gmail.com with ESMTPSA id j4sm35361724pfe.53.2018.01.29.07.14.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Jan 2018 07:14:07 -0800 (PST) From: Tino Calancha To: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson Subject: Re: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> Date: Tue, 30 Jan 2018 00:14:00 +0900 In-Reply-To: <87mv0wg80c.fsf@jidanni.org> (=?utf-8?B?IuepjeS4ueWwvA==?= Dan Jacobson"'s message of "Mon, 29 Jan 2018 20:32:51 +0800") Message-ID: <87efm8snnr.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: 30285@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan Jacobson writes: Thank you for your report. > M runs the command dired-do-chmod. > If used on the very top line of dired > (the directory name,) it says: > "Change mode of * [0 files] to: " > which doesn't make a lot of sense. Agreed. > emacs-version "25.2.2" > > Same problem if used on the second line, (total...). > > (Why doesn't it just complain "can't operate on" like it does for the > third line, ".".) Following patch just do nothing in these cases. That's OK for me. Do you prefer to inform the user in this case that there is no file to change the mode? --8<-----------------------------cut here---------------start------------->= 8--- commit 9b10f6ef6fbb3e6c50ffb04b97fc5b0b86d3e559 Author: tino calancha Date: Tue Jan 30 00:02:00 2018 +0900 dired-do-chmod: Avoid unecessary prompt =20=20=20=20 * lisp/dired-aux.el (dired-do-chmod): Offer to change mode just if there are any marked files or there is a file at point (Bug#30285). diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 55b68a372e..3868efe0c1 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -361,40 +361,42 @@ dired-do-chmod Type M-n to pull the file attributes of the file at point into the minibuffer." (interactive "P") - (let* ((files (dired-get-marked-files t arg)) - ;; The source of default file attributes is the file at point. - (default-file (dired-get-filename t t)) - (modestr (when default-file - (nth 8 (file-attributes default-file)))) - (default - (and (stringp modestr) - (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr) - (replace-regexp-in-string - "-" "" - (format "u=3D%s,g=3D%s,o=3D%s" - (match-string 1 modestr) - (match-string 2 modestr) - (match-string 3 modestr))))) - (modes (dired-mark-read-string - "Change mode of %s to: " - nil 'chmod arg files default)) - num-modes) - (cond ((or (equal modes "") - ;; Use `eq' instead of `equal' - ;; to detect empty input (bug#12399). - (eq modes default)) - ;; We used to treat empty input as DEFAULT, but that is not - ;; such a good idea (Bug#9361). - (error "No file mode specified")) - ((string-match-p "^[0-7]+" modes) - (setq num-modes (string-to-number modes 8)))) - - (dolist (file files) - (set-file-modes - file - (if num-modes num-modes - (file-modes-symbolic-to-number modes (file-modes file))))) - (dired-do-redisplay arg))) + (when (or (cdr (dired-get-marked-files nil nil nil 'distinguish-1-marked= )) + (dired-get-filename t t)) + (let* ((files (dired-get-marked-files t arg)) + ;; The source of default file attributes is the file at point. + (default-file (dired-get-filename t t)) + (modestr (when default-file + (nth 8 (file-attributes default-file)))) + (default + (and (stringp modestr) + (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr) + (replace-regexp-in-string + "-" "" + (format "u=3D%s,g=3D%s,o=3D%s" + (match-string 1 modestr) + (match-string 2 modestr) + (match-string 3 modestr))))) + (modes (dired-mark-read-string + "Change mode of %s to: " + nil 'chmod arg files default)) + num-modes) + (cond ((or (equal modes "") + ;; Use `eq' instead of `equal' + ;; to detect empty input (bug#12399). + (eq modes default)) + ;; We used to treat empty input as DEFAULT, but that is not + ;; such a good idea (Bug#9361). + (error "No file mode specified")) + ((string-match-p "^[0-7]+" modes) + (setq num-modes (string-to-number modes 8)))) + + (dolist (file files) + (set-file-modes + file + (if num-modes num-modes + (file-modes-symbolic-to-number modes (file-modes file))))) + (dired-do-redisplay arg)))) =20 ;;;###autoload (defun dired-do-chgrp (&optional arg) --8<-----------------------------cut here---------------end--------------->= 8--- In GNU Emacs 27.0.50 (build 7, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) Repository revision: ea8c0e1b9eaa6651919fb4e039e3fcb5a1fa73db From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 29 10:24:43 2018 Received: (at 30285) by debbugs.gnu.org; 29 Jan 2018 15:24:44 +0000 Received: from localhost ([127.0.0.1]:48030 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egBIZ-0005dz-Ns for submit@debbugs.gnu.org; Mon, 29 Jan 2018 10:24:43 -0500 Received: from homie.mail.dreamhost.com ([208.97.132.208]:50569 helo=homiemail-a62.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egBIY-0005dr-0p for 30285@debbugs.gnu.org; Mon, 29 Jan 2018 10:24:42 -0500 Received: from homiemail-a62.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a62.g.dreamhost.com (Postfix) with ESMTP id 2B9BE634075; Mon, 29 Jan 2018 07:24:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to:cc :subject:references:date:message-id:mime-version:content-type; s=jidanni.org; bh=z5t6STJkEOZUfhoSGsP5J0+SBBE=; b=G6f81MZQHqoNB tT4ECNSD5epBHyKGrIUlwCblQoMTGSpohbl7m6bPNavHCeGnE9Jb7Qwg/owYRtX8 YoQwswCTspO2mo/I+7GhaoLDwPQuGyb1QDDk4GJKjUL3b4+FExnq+6AZ+FT9QN6m NhOkXwDZA8Bw0j/CuCelnAImYMSMMo= Received: from jidanni.org (111-246-87-124.dynamic-ip.hinet.net [111.246.87.124]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni@jidanni.org) by homiemail-a62.g.dreamhost.com (Postfix) with ESMTPSA id DE49263406C; Mon, 29 Jan 2018 07:24:40 -0800 (PST) From: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson To: Tino Calancha Subject: Re: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> Date: Mon, 29 Jan 2018 23:24:36 +0800 Message-ID: <87efm8elhn.fsf@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: 30285@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) >>>>> "TC" == Tino Calancha writes: TC> Do you prefer to inform the user in this case that there is no file TC> to change the mode? (All I know is I found it odd I couldn't change . or .. but OK you must have your reasons. Maybe say "use a prefix argument to really change . "...) From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 29 11:05:52 2018 Received: (at 30285) by debbugs.gnu.org; 29 Jan 2018 16:05:52 +0000 Received: from localhost ([127.0.0.1]:48050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egBwN-0006eI-Rf for submit@debbugs.gnu.org; Mon, 29 Jan 2018 11:05:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egBwL-0006e4-Jo for 30285@debbugs.gnu.org; Mon, 29 Jan 2018 11:05:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1egBwB-0005I8-Rq for 30285@debbugs.gnu.org; Mon, 29 Jan 2018 11:05:44 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1egBwB-0005Hy-O7; Mon, 29 Jan 2018 11:05:39 -0500 Received: from [176.228.60.248] (port=1764 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1egBwA-00008e-M2; Mon, 29 Jan 2018 11:05:39 -0500 Date: Mon, 29 Jan 2018 18:05:47 +0200 Message-Id: <83efm8irac.fsf@gnu.org> From: Eli Zaretskii To: Tino Calancha In-reply-to: <87efm8snnr.fsf@gmail.com> (message from Tino Calancha on Tue, 30 Jan 2018 00:14:00 +0900) Subject: Re: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 30285 Cc: 30285@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Tino Calancha > Date: Tue, 30 Jan 2018 00:14:00 +0900 > Cc: 30285@debbugs.gnu.org > > > (Why doesn't it just complain "can't operate on" like it does for the > > third line, ".".) > Following patch just do nothing in these cases. That's OK for me. > Do you prefer to inform the user in this case that there is no file > to change the mode? Yes, I think we should produce some message in these cases. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 29 18:14:12 2018 Received: (at 30285) by debbugs.gnu.org; 29 Jan 2018 23:14:12 +0000 Received: from localhost ([127.0.0.1]:48339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egIct-0001jp-U8 for submit@debbugs.gnu.org; Mon, 29 Jan 2018 18:14:12 -0500 Received: from mail-pf0-f179.google.com ([209.85.192.179]:46298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egIcs-0001jb-7O for 30285@debbugs.gnu.org; Mon, 29 Jan 2018 18:14:10 -0500 Received: by mail-pf0-f179.google.com with SMTP id y5so6825337pff.13 for <30285@debbugs.gnu.org>; Mon, 29 Jan 2018 15:14:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=6NKHqmRzF1DMUVL95tAlPhzIgoV9DXAO6tRz9z5hA5Y=; b=aTS/bsW0qMpZ0odPClnm1dPP1xZUpa+Q1BvrdnE9D9zYMPCj41yOqNOF2oOpe1Jypb fv1XsK8B3437LFURD4sKBB9ES4PuQKa0YPEvItwnTTx05gwT2hJTTsryy9/ALd6OQJTf XULY8oJcOMYHSnN7gOBwymC9ULZ021hoqcyMt+qIfuFqkxIAttleOBkM/Ka5eXmOjTLF pe3j5CdTsjIuWcr2FEznzFeSy/32eCcnZVcMQ3gf19XRS1D+XvyU3z0IfHTCFi4U0id5 VnbbNBtxrRi+EWN8z2Hf2Oo86t12lDWpbtaqDHfLb7gzeWOWQ+QUG1f0u7GU7FI6JaTZ 1khA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=6NKHqmRzF1DMUVL95tAlPhzIgoV9DXAO6tRz9z5hA5Y=; b=fWUARLqZUl2aaU1xj4igxgErsmDfy2hKQ9/v64g0oTvUpcIoT5f2XV6kBEzCRYj913 XMZIyrCm3hf1RHpjVmtu4lq9mM9Fb6jUG+ef8ETacad4xeS65o8ZahQBQIS9eWKiVjsc wIujvkgvytNG+XPL0HPdiTnk0ybng5auKFb5umgzyssLULQLTc4QG4zLuFCPbYQvhE52 HBfVOqQLySFTd+x87vp8FhPkF5e3h9iiDq6XYJErA7WC1Q7zYlaZyc1Upj9lvsVf2VHY MbOq4hfF6+NwP3jZR4qi6HNFbzDrTZ2Ld1LDaUqtEZSobUDr64cwsUOumZrd6XuHj9/Z /1Mg== X-Gm-Message-State: AKwxytdRtzhPNPuGuri8CYBMbsI71yrrObdxjR9aCK5ZFLznwURzF31s sJ1DWAzsYEFh96YbeUK/AME= X-Google-Smtp-Source: AH8x2271/q91Dgft66/BA3zpk8F+J7e+vsS7Nuy27Frm9khRZlunlknQoHS48QzMQpHqf+pL94SnVQ== X-Received: by 10.98.163.131 with SMTP id q3mr27620681pfl.87.1517267644323; Mon, 29 Jan 2018 15:14:04 -0800 (PST) Received: from calancha-pc (FL1-125-193-170-29.tky.mesh.ad.jp. [125.193.170.29]) by smtp.gmail.com with ESMTPSA id q27sm44179498pfd.14.2018.01.29.15.14.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jan 2018 15:14:03 -0800 (PST) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Tue, 30 Jan 2018 08:14:00 +0900 (JST) X-X-Sender: calancha@calancha-pc To: =?ISO-2022-JP?Q?=1B$B=40QC0Ft=1B=28J_Dan_Jacobson?= Subject: Re: bug#30285: dired-do-chmod vs. top line of dired In-Reply-To: <87efm8elhn.fsf@jidanni.org> Message-ID: References: <87mv0wg80c.fsf@jidanni.org> <87efm8elhn.fsf@jidanni.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-855318589-1517267642=:16513" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: 30285@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --8323329-855318589-1517267642=:16513 Content-Type: text/plain; format=flowed; charset=ISO-2022-JP On Mon, 29 Jan 2018, $B@QC0Ft(J Dan Jacobson wrote: >>>>>> "TC" == Tino Calancha writes: > TC> Do you prefer to inform the user in this case that there is no file > TC> to change the mode? > > (All I know is I found it odd I couldn't change . or .. but OK you must > have your reasons. Maybe say "use a prefix argument to really change . "...) I'd rather prefer fix the case when: * there is no marked files ** We are in a line without file at point. Whether if an user should be able to `chmod' '.' or '..' seems a bit orthogonal to *, ** above; maybe better to discuss such issue in a separated bug report. --8323329-855318589-1517267642=:16513-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 29 18:21:51 2018 Received: (at 30285) by debbugs.gnu.org; 29 Jan 2018 23:21:51 +0000 Received: from localhost ([127.0.0.1]:48346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egIkJ-0001vj-00 for submit@debbugs.gnu.org; Mon, 29 Jan 2018 18:21:51 -0500 Received: from mail-pf0-f172.google.com ([209.85.192.172]:39263) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egIkH-0001vO-8i for 30285@debbugs.gnu.org; Mon, 29 Jan 2018 18:21:49 -0500 Received: by mail-pf0-f172.google.com with SMTP id e11so6848063pff.6 for <30285@debbugs.gnu.org>; Mon, 29 Jan 2018 15:21:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=WPBlMWkUJ19fpjvkt+/rp1Iu/ZEo3Exyfonhrabb6O4=; b=AJSyM2QRmT7Z3IKjkkE+s7r9pRt3p536bVSx1Fr3++bK5jugsLAMCQOEARKmGkn6iW AmFoKgyzoT4z7npuaT75LU62nfzQJdr1ztEcBpwgTkxOvv6hSJnCmlgE8XUvlnSWCO4/ nynWa0P5F2RJW9LTG55HNUS2tyW6k05quUmvqkl3hlwk/Mm9z6AT7ihfc/W5RWnwJZMv MXbP5/IOdLY7VyRGkLymII72KLUzO/0vdfZYDQA/e/7ZYQWL6LGCDXt56KKHBaTwzOlF DeB0KSDKeeXdom4h2JVgv4QEn40+6wflRozrs7McwGUsU1I+fj9ZVz1bvcUHqNX9Slx+ lh2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=WPBlMWkUJ19fpjvkt+/rp1Iu/ZEo3Exyfonhrabb6O4=; b=hCFYiNQ7jhqGTNBjsBS2XsX5SJ3ZFXOBlF/+/0C3tosPSUiQcBy7HsMCl+PGwaHlsc +7L5PQldg03rGRGYm48ZsetC+3zAbmdNAMOGY67uVgxLetNW5bNSHnY7jWkTxpuD1yb+ z9Dqhq+QV+IkIIJFZG4WJexXcRc+noPcPZ9fTscOwSnBHBxi0FkXhilax5THLSfQtdGN 9IMJhQ/Vqo5TR9HzqaBl4Tk4yyFa6p2x0tuCFtWAYWMrOHf8oSaI1JInsSUDNBCQq+PE KpKblHA8QNtf5u71ugGWXz/HPjtCpCOm04OYy7/aEWxQZC0Xbk/QXOh0TUtHdO9P9+ij Nrnw== X-Gm-Message-State: AKwxytfjfLSHZH/QfDazZeCvylXrxvLrO9mLV9Hy6jbullOjKNj1t/f5 nepSYBIVz5jzWiv8I0GrIFY= X-Google-Smtp-Source: AH8x226K3/j3ugx+IVoAYvV2ihzQfh9+vqnwJpco1jStiR0mLrQOjaija+tqPnGwDBXTdyKRGVCNNA== X-Received: by 2002:a17:902:51e9:: with SMTP id y96-v6mr3589040plh.344.1517268103418; Mon, 29 Jan 2018 15:21:43 -0800 (PST) Received: from calancha-pc (FL1-125-193-170-29.tky.mesh.ad.jp. [125.193.170.29]) by smtp.gmail.com with ESMTPSA id l88sm35748018pfb.149.2018.01.29.15.21.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Jan 2018 15:21:42 -0800 (PST) From: Tino Calancha To: Eli Zaretskii Subject: Re: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> Date: Tue, 30 Jan 2018 08:21:36 +0900 In-Reply-To: <83efm8irac.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 29 Jan 2018 18:05:47 +0200") Message-ID: <87d11sl08v.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: 30285@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: >> From: Tino Calancha >> Date: Tue, 30 Jan 2018 00:14:00 +0900 >> Cc: 30285@debbugs.gnu.org >> >> > (Why doesn't it just complain "can't operate on" like it does for the >> > third line, ".".) >> Following patch just do nothing in these cases. That's OK for me. >> Do you prefer to inform the user in this case that there is no file >> to change the mode? > > Yes, I think we should produce some message in these cases. OK. Then, we must adjust other siblings commands (dired-do-chgrp, dired-do-chown); otherwise they might become jealous. I propose to add a new predicate `dired-marked-files-or-file-at-point-p', and used it in all those commands. --8<-----------------------------cut here---------------start------------->8--- commit a66d02f56f3b1019009c21997b0064f1fb26a03f Author: tino calancha Date: Tue Jan 30 08:18:07 2018 +0900 dired-do-chmod: Avoid unecessary prompt Prompt user only if there are any marked files or a file at point (Bug#30285). * lisp/dired.el (dired-marked-files-or-file-at-point-p): New defun. * lisp/dired-aux.el (dired-do-chmod) (dired-do-chmod, dired-do-chgrp, dired-do-chown): Use it. diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 55b68a372e..02febbe570 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -361,40 +361,42 @@ dired-do-chmod Type M-n to pull the file attributes of the file at point into the minibuffer." (interactive "P") - (let* ((files (dired-get-marked-files t arg)) - ;; The source of default file attributes is the file at point. - (default-file (dired-get-filename t t)) - (modestr (when default-file - (nth 8 (file-attributes default-file)))) - (default - (and (stringp modestr) - (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr) - (replace-regexp-in-string - "-" "" - (format "u=%s,g=%s,o=%s" - (match-string 1 modestr) - (match-string 2 modestr) - (match-string 3 modestr))))) - (modes (dired-mark-read-string - "Change mode of %s to: " - nil 'chmod arg files default)) - num-modes) - (cond ((or (equal modes "") - ;; Use `eq' instead of `equal' - ;; to detect empty input (bug#12399). - (eq modes default)) - ;; We used to treat empty input as DEFAULT, but that is not - ;; such a good idea (Bug#9361). - (error "No file mode specified")) - ((string-match-p "^[0-7]+" modes) - (setq num-modes (string-to-number modes 8)))) - - (dolist (file files) - (set-file-modes - file - (if num-modes num-modes - (file-modes-symbolic-to-number modes (file-modes file))))) - (dired-do-redisplay arg))) + (if (not (dired-marked-files-or-file-at-point-p)) + (user-error "No marked files") + (let* ((files (dired-get-marked-files t arg)) + ;; The source of default file attributes is the file at point. + (default-file (dired-get-filename t t)) + (modestr (when default-file + (nth 8 (file-attributes default-file)))) + (default + (and (stringp modestr) + (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr) + (replace-regexp-in-string + "-" "" + (format "u=%s,g=%s,o=%s" + (match-string 1 modestr) + (match-string 2 modestr) + (match-string 3 modestr))))) + (modes (dired-mark-read-string + "Change mode of %s to: " + nil 'chmod arg files default)) + num-modes) + (cond ((or (equal modes "") + ;; Use `eq' instead of `equal' + ;; to detect empty input (bug#12399). + (eq modes default)) + ;; We used to treat empty input as DEFAULT, but that is not + ;; such a good idea (Bug#9361). + (error "No file mode specified")) + ((string-match-p "^[0-7]+" modes) + (setq num-modes (string-to-number modes 8)))) + + (dolist (file files) + (set-file-modes + file + (if num-modes num-modes + (file-modes-symbolic-to-number modes (file-modes file))))) + (dired-do-redisplay arg)))) ;;;###autoload (defun dired-do-chgrp (&optional arg) @@ -404,7 +406,9 @@ dired-do-chgrp (interactive "P") (if (memq system-type '(ms-dos windows-nt)) (error "chgrp not supported on this system")) - (dired-do-chxxx "Group" "chgrp" 'chgrp arg)) + (if (not (dired-marked-files-or-file-at-point-p)) + (user-error "No marked files") + (dired-do-chxxx "Group" "chgrp" 'chgrp arg))) ;;;###autoload (defun dired-do-chown (&optional arg) @@ -414,7 +418,9 @@ dired-do-chown (interactive "P") (if (memq system-type '(ms-dos windows-nt)) (error "chown not supported on this system")) - (dired-do-chxxx "Owner" dired-chown-program 'chown arg)) + (if (not (dired-marked-files-or-file-at-point-p)) + (user-error "No marked files") + (dired-do-chxxx "Owner" dired-chown-program 'chown arg))) ;;;###autoload (defun dired-do-touch (&optional arg) @@ -423,7 +429,9 @@ dired-do-touch Type M-n to pull the file attributes of the file at point into the minibuffer." (interactive "P") - (dired-do-chxxx "Timestamp" dired-touch-program 'touch arg)) + (if (not (dired-marked-files-or-file-at-point-p)) + (user-error "No marked files") + (dired-do-chxxx "Timestamp" dired-touch-program 'touch arg))) ;; Process all the files in FILES in batches of a convenient size, ;; by means of (FUNCALL FUNCTION ARGS... SOME-FILES...). diff --git a/lisp/dired.el b/lisp/dired.el index eade11bc7f..79486c8b8e 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2385,6 +2385,11 @@ dired-get-filename (t (concat (dired-current-directory localp) file))))) +(defun dired-marked-files-or-file-at-point-p () + "Return non-nil if there are marked files or a file at point." + (and (or (cdr (dired-get-marked-files nil nil nil 'distinguish-1-marked)) + (dired-get-filename nil 'no-error)) t)) + (defun dired-string-replace-match (regexp string newtext &optional literal global) "Replace first match of REGEXP in STRING with NEWTEXT. --8<-----------------------------cut here---------------end--------------->8--- In GNU Emacs 27.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) Repository revision: 29abae3572090a86beedb66822ccf34356c8a00c From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 29 19:00:38 2018 Received: (at 30285) by debbugs.gnu.org; 30 Jan 2018 00:00:38 +0000 Received: from localhost ([127.0.0.1]:48359 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egJLq-0002oc-H1 for submit@debbugs.gnu.org; Mon, 29 Jan 2018 19:00:38 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:45142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egJLo-0002oO-Is for 30285@debbugs.gnu.org; Mon, 29 Jan 2018 19:00:37 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0TNvO51046173; Tue, 30 Jan 2018 00:00:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=zQc5t7PLNN1pkJU01PM7vYzHsjA2pwWA7uo2DHjZg4I=; b=nxk21dkUz+wYOQDDCTqL6o/160yULSElUnD6cPEElnRGwo5psAw4fCWGz5nUQ9F1nrt+ Oucfgj+CO816SSLmdNdvCGtJpc1wk0/HrefUERqwoyM7l5BYjXIu37woyFbGF3sokg+Z U9kdtx9qxO+teLat+ABoIbuuV/kO+qaUaVuxKR4BS1dlpdRW/37NSmsxxpFSG+DnlWw8 OhS3gdsRjfr1aIOzcqrPu6gZyl33teiW8kUt/tv2q0Kr89DF5VLHHR1HNPDSezjBBgAv D3iYz7N3CmUvwNfEYSuoch1Do3GOZDqb3x4EgS8XZeBxHu5FZvgCmGiqPZuExM7zZqVX 0w== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2ftdmtr253-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Jan 2018 00:00:30 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w0TNh404012816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 29 Jan 2018 23:43:05 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w0TNh1hl006969; Mon, 29 Jan 2018 23:43:01 GMT MIME-Version: 1.0 Message-ID: Date: Mon, 29 Jan 2018 15:42:59 -0800 (PST) From: Drew Adams To: Tino Calancha , Eli Zaretskii Subject: RE: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> In-Reply-To: <87d11sl08v.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4639.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8789 signatures=668655 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=977 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801290304 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: 30285@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > >> > (Why doesn't it just complain "can't operate on" like it does for > the > >> > third line, ".".) > >> Following patch just do nothing in these cases. That's OK for me. > >> Do you prefer to inform the user in this case that there is no file > >> to change the mode? > > > > Yes, I think we should produce some message in these cases. > OK. Then, we must adjust other siblings commands (dired-do-chgrp, > dired-do-chown); otherwise they might become jealous. > I propose to add a new predicate > `dired-marked-files-or-file-at-point-p', and used it in all those > commands. Please don't do any such thing. Yes, it makes sense for such commands to do nothing or to show an error message when on the "top line of dired", as described in the bug report. No, we don't need a function `dired-marked-files-or-file-at-point-p', for that or anything else. The `dired-do-*' commands already DTRT wrt the marked-files-or-file-at-point. And no, it doesn't make sense to act that way on `.' - it's OK to change the properties of the current directory (provided you have the necessary permissions). And that's not even part of this bug report, is it? The question of `..' is arguable, but I'd say the same thing for it as for `.': It's OK to change its properties, provided you have permission to do so. After all, `..' is just a (unique) directory. How did this bug report move from being about behavior on the top line (and the second, "total" etc. line) to being also about the lines for `.' and `..'? From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 29 22:53:17 2018 Received: (at 30285) by debbugs.gnu.org; 30 Jan 2018 03:53:17 +0000 Received: from localhost ([127.0.0.1]:48429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egMyz-0001V3-AD for submit@debbugs.gnu.org; Mon, 29 Jan 2018 22:53:17 -0500 Received: from mail-pf0-f179.google.com ([209.85.192.179]:41737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egMyy-0001Ur-36 for 30285@debbugs.gnu.org; Mon, 29 Jan 2018 22:53:16 -0500 Received: by mail-pf0-f179.google.com with SMTP id c6so7501976pfi.8 for <30285@debbugs.gnu.org>; Mon, 29 Jan 2018 19:53:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=j37+1oZC9QdEL12FUC8VzEAUQ0p1bT3bp2XxhT2VdRs=; b=k3zPX/QMBmGrLdzqqZQyScBnqdOPgM2khDduErwclZqO7A+6/Vi78vvN4daaWtg3lS fBRxqbGssXknXrhRfrWoDL008dNqgvZ1nhipgT28tB3301g3ERs9G2B7oGb42Ki70+2p /kBbwFAsA9wULuPWq2FKcgifaP2vYeysPPq7ECjMcn0E/jZ8IVQAhu6MD/o2TasYEnq4 i0KVUUmDo7X93Y3jxAYAnkz6JLoqnpuhCOoHDyVGmS5jLJ+30K6Vj3BG5OaarHAyRmtP lTsaMGPL4fxX6kLcPzs98yDNFsO1CxzwcE426vROvr7P1xKN8PXMIzHuhi887l+Au5vj 9kvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=j37+1oZC9QdEL12FUC8VzEAUQ0p1bT3bp2XxhT2VdRs=; b=XCwu9zjeczrr2Qec8+oNxF7oGYAsuRGhAEimkM7xmKFkxYO8KfT3Mw8DPbSC1VM9J/ pLL1TNIGjmfMyjF7bkGj1pCfILeKQOXD95lTAKiXbIOI5vEpHwJH1HpBL37CuT0f+59O QCS1rShpunx526NL+a282fK7JWs/UtNTgvL0l2HJKzvPKPx36fioAf7bDxfl6QSG6r/2 pZ1kIYGjAbv+5BFZnCqvkjMV98pHSy2MLiMAztVtCiY0I+hDFGtGKiOMGd/Nbw22YGqw v6JCBM3XxN9mLRvp+xV2yHpyGpXiBeG8bjsX2xCyHZlVvIuPCU2bUz6BivopxpEJPavC Trjw== X-Gm-Message-State: AKwxyteUkscXBp1TKnrfg6drquAzcXV7sa2cIzr9wFji09nWD5qyw+s7 PxGJvVidBw5DK7RPPW/8bQU= X-Google-Smtp-Source: AH8x224n4QBKhBe7er7+9Kd4r7tZUf0iWXk5c0YSG95brs3RZBLeLTRqdiTiwHTOpnX9DPlsluQ38g== X-Received: by 10.98.103.83 with SMTP id b80mr28681111pfc.223.1517284390173; Mon, 29 Jan 2018 19:53:10 -0800 (PST) Received: from calancha-pc (FL1-125-193-170-29.tky.mesh.ad.jp. [125.193.170.29]) by smtp.gmail.com with ESMTPSA id o7sm16824710pgp.18.2018.01.29.19.53.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jan 2018 19:53:09 -0800 (PST) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Tue, 30 Jan 2018 12:53:05 +0900 (JST) X-X-Sender: calancha@calancha-pc To: Drew Adams Subject: RE: bug#30285: dired-do-chmod vs. top line of dired In-Reply-To: Message-ID: References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: Eli Zaretskii , 30285@debbugs.gnu.org, jidanni@jidanni.org, Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Mon, 29 Jan 2018, Drew Adams wrote: >>>>> (Why doesn't it just complain "can't operate on" like it does for >> the >>>>> third line, ".".) >>>> Following patch just do nothing in these cases. That's OK for me. >>>> Do you prefer to inform the user in this case that there is no file >>>> to change the mode? >>> >>> Yes, I think we should produce some message in these cases. >> OK. Then, we must adjust other siblings commands (dired-do-chgrp, >> dired-do-chown); otherwise they might become jealous. >> I propose to add a new predicate >> `dired-marked-files-or-file-at-point-p', and used it in all those >> commands. > > Please don't do any such thing. > > Yes, it makes sense for such commands to do nothing or to show an > error message when on the "top line of dired", as described in the > bug report. OK, I see you agree with Eli and me. the rest I believe is just funny misunderstanding :-) > No, we don't need a function `dired-marked-files-or-file-at-point-p', > for that or anything else. Probably not, but it looks tidy in my patch to add one to reinforce DRY. > The `dired-do-*' commands already DTRT wrt the marked-files-or-file-at-point. No, they don't. They annoying users asking a useless prompt, like: Change mode of * [0 files] to: ;; Just to notify the user after his input: No file on this line This is like if I ask my gf: Dear, do you want I change diapers to [0 of our children]? ;; After she answer... Ohhh, I just remembered we have no kids!!! ;; After that silly question probably I will not have gf either... > And no, it doesn't make sense to act that way on `.' - it's OK to > change the properties of the current directory (provided you have > the necessary permissions). Indeed, I don't want to change that and I agree with you. I just offered the OP to open another bug report with this topic if he likes. This bug report is just about the unnecessary prompt in the top line. > The question of `..' is arguable, but I'd say the same thing for > it as for `.': It's OK to change its properties, provided you have > permission to do so. After all, `..' is just a (unique) directory. Nobody said the opposite :-D > > How did this bug report move from being about behavior on the top > line (and the second, "total" etc. line) to being also about the > lines for `.' and `..'? No idea... maybe it just happened in your mind, or you had a dream last night about it ;-) From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 29 23:43:22 2018 Received: (at 30285) by debbugs.gnu.org; 30 Jan 2018 04:43:22 +0000 Received: from localhost ([127.0.0.1]:48443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egNlS-0002fa-IU for submit@debbugs.gnu.org; Mon, 29 Jan 2018 23:43:22 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:44352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egNlQ-0002fM-UN for 30285@debbugs.gnu.org; Mon, 29 Jan 2018 23:43:21 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0U4gGiw042789; Tue, 30 Jan 2018 04:43:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=XAWKUr9haEJGjz4KoiryjnNBVV6d6fYoe2Y6ACPVsGY=; b=PBIS7e+d3tTzAUN/L6cFJShKsSgbn+gdqQerDA6oENacNCO0q4i+xvhOYYnLLFP6aYxD 6JexY2gmoQrFPV1kXm5tHe46dKtCRAQAJGKWhx8FZPIx1W813zRSqQhlMKnzL5ogHJGP mE73XfiLPuhbG2fiYOYqK7vOL4o53XjD0F8CpENHGVnEFs8FKCFzqupmS3KPYtUjh8yt OnLWRrcNkNBufHnF00YU2AKHRDPAhGl8C2wRrAOo5+vOm4c/ovfJhh3wRaifc10G4COf 3AEWQAzZJEmrN/d36DRC5STTHyyXTYaXPlHH5d+X8kPHb5CGaxDWVBK0iXVP3yVryYVQ Ug== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2ftfm5ga51-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Jan 2018 04:43:12 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w0U4hB2X025506 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 30 Jan 2018 04:43:12 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w0U4h8qe032022; Tue, 30 Jan 2018 04:43:08 GMT MIME-Version: 1.0 Message-ID: <1dd0ec16-7f13-4753-beef-0daeaf84ed8d@default> Date: Mon, 29 Jan 2018 20:43:06 -0800 (PST) From: Drew Adams To: Tino Calancha Subject: RE: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4639.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8789 signatures=668655 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801300060 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: Eli Zaretskii , 30285@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > > The `dired-do-*' commands already DTRT wrt the marked-files-or-file- > > at-point. > > No, they don't. They annoying users asking a useless prompt, like: >=20 > Change mode of * [0 files] to: > ;; Just to notify the user after his input: > No file on this line I see that only for the reported places (this bug). Dunno if that's what you meant. Otherwise I don't see that at all. With point on a file or dir line (even on `.' or `..') and no files marked I get this prompt, where THE-FILE-OR-DIR is the name of the file or directory: Change mode of `THE-FILE-OR-DIR' to:=20 IOW, except for the bug case it works fine, and there is no function `dired-marked-files-or-file-at-point-p'. Likewise, for other `dired-do-*' commands. The marked-files-or-file-at-point behavior is done by `dired-get-marked-files'. That's exactly what it does. (defun dired-do-chmod (&optional arg) "..." (interactive "P") (let* ((files (dired-get-marked-files t arg)) ; <=3D=3D=3D=3D=3D=3D ...)) All that's needed is to test for FILES =3D nil. > This bug report is just about the unnecessary prompt in the top line. OK. We agree that the bug is only about the top line (or top two lines, if details are not hidden). Well, not really. It's really about point on any line where there is no file or dir. That includes: 1. The empty line at the end of the buffer. 2. The empty line before each inserted subdir listing. 3. The first two lines of the main dir and of each inserted subdir - that is, the highlighted line with the full (sub)dir name and the "total..." information line that follows it. The right thing to do is to test first for whether point is on a file or dir line. There are several ways to do that. One is shown above: (dired-get-marked-files t arg), and that's already used by commands such as `dired-do-chmod'. We just need to test its return value. Another is to use (dired-move-to-filename). One of the main uses of that simple function is to test whether or not point is on a file or dir line. A third way, more costly, is to use `dired-get-filename', Some of these ways give you a choice of whether to raise an error or just return nil when point is not on a file or dir line, i.e., when we are in one of the cases where we don't want to try to act on the indicated file(s), because there are none. For `dired-do-chmod' and similar, I'd say just test the return value of `dired-get-marked-files' which is already called at the beginning of the function. If, in some other `dired-do-*' command that function is not called at the beginning anyway, just use `dired-move-to-filename':=20 (defun dired-do-whatever (&optional arg) "..." (interactive (progn (dired-move-to-filename 'RAISE-ERROR) (list current-prefix-arg)))) ...) From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 30 10:16:09 2018 Received: (at 30285) by debbugs.gnu.org; 30 Jan 2018 15:16:09 +0000 Received: from localhost ([127.0.0.1]:49712 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egXdo-0003PU-Q0 for submit@debbugs.gnu.org; Tue, 30 Jan 2018 10:16:08 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:59480) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egXdm-0003Ol-FL for 30285@debbugs.gnu.org; Tue, 30 Jan 2018 10:16:07 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0UF7MeQ083705; Tue, 30 Jan 2018 15:16:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=GVZUXKDpNdPIKJVQdkU9qZuGCNKw3frwakoyhn3pju8=; b=vvEr8u9CyFEiEuX3OBMU6Gn5R5+dH3kEiByeaUrM+b/a6c0yokFzkMxOkjohcN9+wLw1 eO7YITkse2iCo/JVb65sKc8/0V4IklLEjcDLhdL3AmMw7TuP1EiqqsWmj8RXDYhFF1wI p1ow37dJO5nI0n1AHKfJTDdiGWtu/Zs+7F9WLmuWjXrs93CWD8X5/h8qTbVkSQEp0YBj 1qWlwkVt8GDd7apnF+/VKTYSyP3d6N+Cs2ROmlownzZzxyyOa9Ai1AP6REg/nCX3UUX5 TizVSmNJSC2feTf+/VY247hKPfkExw5CAmDc8uKT94+CDNz8c1OF67JNvrwCsL7EA/i6 ig== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2ftsgm0pfx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Jan 2018 15:15:59 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w0UFFwmv015724 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 30 Jan 2018 15:15:58 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w0UFFv4f019920; Tue, 30 Jan 2018 15:15:57 GMT MIME-Version: 1.0 Message-ID: <91a8c271-5d11-4ec9-ac95-ed8de1badc4b@default> Date: Tue, 30 Jan 2018 07:15:56 -0800 (PST) From: Drew Adams To: Tino Calancha Subject: RE: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <1dd0ec16-7f13-4753-beef-0daeaf84ed8d@default> In-Reply-To: <1dd0ec16-7f13-4753-beef-0daeaf84ed8d@default> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4639.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8789 signatures=668655 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=959 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801300191 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: 30285@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Sorry; I realize that my last msg was probably not clear about the possibility of using `dired-move-to-filename' or `dired-get-filename'. Obviously, for `dired-do-*' commands we still need to handle the case where files or dirs are marked. And in that case the command should DTRT even if called from a non-file line, i.e., one of the problematic places we've been discussing - it should not raise an error in that context. For `dired-do-*' commands that already call `dired-get-marked-files' the clear solution, I think, is to just test that return value and raise an error if it is nil. If there is are `dired-do-*' commands that do not call `dired-get-marked-files' then we have a choice how to solve the problem. But it might well be that even then the best solution is to use `dired-get-marked-files'. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 31 04:49:31 2018 Received: (at 30285) by debbugs.gnu.org; 31 Jan 2018 09:49:31 +0000 Received: from localhost ([127.0.0.1]:50306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egp1G-00064i-Rj for submit@debbugs.gnu.org; Wed, 31 Jan 2018 04:49:31 -0500 Received: from mail-it0-f42.google.com ([209.85.214.42]:40585) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egp1F-00064W-IE for 30285@debbugs.gnu.org; Wed, 31 Jan 2018 04:49:29 -0500 Received: by mail-it0-f42.google.com with SMTP id 196so4296759iti.5 for <30285@debbugs.gnu.org>; Wed, 31 Jan 2018 01:49:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=2e7fCFsjR3x9slVt/hUDtJM1utxcDodb7c5nCHebAw8=; b=aEfyhqMYFohe9xZNAGCljfdev1p4+1ZXPOKCBiY1xCCzyHVh+61dUoH1ujNTM+Ncfi Ip+GX6QV03AjjAGd+imbS3nfuK2Q0ousY2Wvqpg1VpUjM9ZMRtIuarj6AzzFrwGdtnk8 LghB1w/8+Lwo+niouAvF/WpGFb4sJQZET19hPjznrXDbRyucHr6JfR5Rk/qKXwffRbzj Il0KMQkyJExkYmcm8IQQUTcpLUB2rglgTGPHGX9NdNBi5YasUBKfrRVKPHt51bhQotC0 uS/3KZ8g4ottP4OhKKfT3D9SapcMDPdK20b1IXmzffLCCcNTpj/TU+KE2aS+zOODMl8v 9Tbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=2e7fCFsjR3x9slVt/hUDtJM1utxcDodb7c5nCHebAw8=; b=s8ec5wP3t6Y4GYs3H2LmqevDVPMV1YCNEyLkuOzSenoFPNVn+q+i0bHhiaszrjEMPZ bTduYb56gnxWqjvbIqSElJWLujRrTpyBySGCzePsHYMvhZSC0A5HpmT4GVjE0G4nyoKd 6KaxM3BtkLrgq7LRRkjf8hEA4NPbJkXEuW23lRRLAVTTjs9NVGOBCgscJMfmjCrEqpho 8S24Jx6UG9Myn4PBcPyMgH10v1wP8MBVP4uxgw6BoWW3e2ZfqZDod2Y9HnoraHrkow8B eoPmPntpsRUnhrqYMuNC/6MfyXm8MjOGI1n9I9VTjQJTilW1WWJ41G+EaDTq1+zHFIzn zSqw== X-Gm-Message-State: AKwxytfAQQ18XsE81s6/EhD4jtwz6HP3jGZMqA7wZ/uSFQPE7aKTnl7U 4Z+dBamtd6O1iqKByI5DbF8= X-Google-Smtp-Source: AH8x224yYa4hBdr4P+yBdiQoKvqcjjAduFdLQhiMRzjcKXOzxg9VH1chk2FDPQb8rPEgCLiDFX06iQ== X-Received: by 10.36.1.66 with SMTP id 63mr36019926itk.104.1517392163969; Wed, 31 Jan 2018 01:49:23 -0800 (PST) Received: from calancha-pc (FL1-125-193-170-29.tky.mesh.ad.jp. [125.193.170.29]) by smtp.gmail.com with ESMTPSA id d3sm8888432itf.1.2018.01.31.01.49.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Jan 2018 01:49:23 -0800 (PST) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Wed, 31 Jan 2018 18:49:19 +0900 (JST) X-X-Sender: calancha@calancha-pc To: Drew Adams Subject: RE: bug#30285: dired-do-chmod vs. top line of dired In-Reply-To: <91a8c271-5d11-4ec9-ac95-ed8de1badc4b@default> Message-ID: References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <1dd0ec16-7f13-4753-beef-0daeaf84ed8d@default> <91a8c271-5d11-4ec9-ac95-ed8de1badc4b@default> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: 30285@debbugs.gnu.org, jidanni@jidanni.org, Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Tue, 30 Jan 2018, Drew Adams wrote: > Obviously, for `dired-do-*' commands we still need to > handle the case where files or dirs are marked. And > in that case the command should DTRT even if called from > a non-file line, i.e., one of the problematic places > we've been discussing - it should not raise an error > in that context. IIRC, my latest patch handle those situations pretty well. Could you tested it and provide feedback about how to improve it? > For `dired-do-*' commands that already call > `dired-get-marked-files' the clear solution, I think, > is to just test that return value and raise an error > if it is nil. > > If there is are `dired-do-*' commands that do not call > `dired-get-marked-files' then we have a choice how to > solve the problem. But it might well be that even then > the best solution is to use `dired-get-marked-files'. Since you are reluctant to the addition of the new predicate. That's fine. May I ask you to provide an alternative patch to compare with mine? Then, people here might do further feedback based on those 2 alternatives. Thank you very much! From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 31 14:05:00 2018 Received: (at 30285) by debbugs.gnu.org; 31 Jan 2018 19:05:00 +0000 Received: from localhost ([127.0.0.1]:51512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egxgq-0003LL-Dz for submit@debbugs.gnu.org; Wed, 31 Jan 2018 14:05:00 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:43616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1egxgn-0003L4-HP for 30285@debbugs.gnu.org; Wed, 31 Jan 2018 14:04:57 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0VJ2Gcc129926; Wed, 31 Jan 2018 19:04:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=oEJIftcbkGOjv7WRHCaX7vkL/IkX9I8F6oWXxZu5AAI=; b=dUdDiXkT2wWnh+IDMsa8F3hvVcp8aB6c8DXzB8otejjsNj5gLQNqR3FCGnkvqmv7/dK2 bBi9ZW4/MN9L5afvgh7ke56u2arNXjieGB/YugugdITnecyFb4in5zOTQ7uIacEbmWZl ljECpGEhkmIhbuzRDaat/n3BokSVRFM4nBrLxIipQ1E4rZBs51zdwB7+zMyvyESy6L0X uTMQ5vacgAG8a4FJPDkaAL8bAQaRC5SlWZsE+RAIQtn+L3L7A2gQL3Tb+PkigTtxyhM8 UT0n23bBfnKqj953bBH614gdJkATdAOkCcjqOi2zNyvcRzuR2e9U7IR2uNFFciFbNTMZ vg== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2fuc8kjhu8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 31 Jan 2018 19:04:50 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w0VJ4n85015229 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 31 Jan 2018 19:04:49 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w0VJ4ldV028916; Wed, 31 Jan 2018 19:04:47 GMT MIME-Version: 1.0 Message-ID: Date: Wed, 31 Jan 2018 11:04:46 -0800 (PST) From: Drew Adams To: Tino Calancha Subject: RE: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <1dd0ec16-7f13-4753-beef-0daeaf84ed8d@default> <91a8c271-5d11-4ec9-ac95-ed8de1badc4b@default> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4639.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8791 signatures=668659 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=876 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801310241 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: 30285@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > > Obviously, for `dired-do-*' commands we still need to > > handle the case where files or dirs are marked. And > > in that case the command should DTRT even if called from > > a non-file line, i.e., one of the problematic places > > we've been discussing - it should not raise an error > > in that context. > > IIRC, my latest patch handle those situations pretty well. > Could you tested it and provide feedback about how to > improve it? >=20 > > For `dired-do-*' commands that already call > > `dired-get-marked-files' the clear solution, I think, > > is to just test that return value and raise an error > > if it is nil. > > > > If there are `dired-do-*' commands that do not call > > `dired-get-marked-files' then we have a choice how to > > solve the problem. But it might well be that even then > > the best solution is to use `dired-get-marked-files'. > > Since you are reluctant to the addition of the new predicate. > That's fine. > > May I ask you to provide an alternative patch to compare > with mine? Then, people here might do further feedback based > on those 2 alternatives. Sorry; I don't have time to work on this. I've already provided my suggestions - hope they help. Whatever you decide is fine by me. Thx. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 31 16:57:03 2018 Received: (at 30285) by debbugs.gnu.org; 31 Jan 2018 21:57:03 +0000 Received: from localhost ([127.0.0.1]:51558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eh0NJ-00079C-Bt for submit@debbugs.gnu.org; Wed, 31 Jan 2018 16:57:03 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:35178 helo=homiemail-a20.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eh0NH-000794-Ad for 30285@debbugs.gnu.org; Wed, 31 Jan 2018 16:56:59 -0500 Received: from homiemail-a20.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTP id 55CC07EC064; Wed, 31 Jan 2018 13:56:58 -0800 (PST) Received: from localhost.linkov.net (m91-129-107-8.cust.tele2.ee [91.129.107.8]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPSA id AB5A47EC063; Wed, 31 Jan 2018 13:56:56 -0800 (PST) From: Juri Linkov To: Drew Adams Subject: Re: bug#30285: dired-do-chmod vs. top line of dired Organization: LINKOV.NET References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> Date: Wed, 31 Jan 2018 23:35:09 +0200 In-Reply-To: (Drew Adams's message of "Mon, 29 Jan 2018 15:42:59 -0800 (PST)") Message-ID: <87fu6lwxxu.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: Eli Zaretskii , 30285@debbugs.gnu.org, jidanni@jidanni.org, Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) >> I propose to add a new predicate >> `dired-marked-files-or-file-at-point-p', and used it in all those >> commands. > > Please don't do any such thing. > > Yes, it makes sense for such commands to do nothing or to show an > error message when on the "top line of dired", as described in the > bug report. Instead of doing nothing or showing an error message, how about doing a more useful thing: when on the top line, =E2=80=98dired-do-chmod=E2= =80=99 could do chmod on all files in the dir. This is exactly what other Dired commands already do: e.g. typing =E2=80=98= m=E2=80=99 on the top line or on any other subdir headerline, they perform their actions on all files. For example, see the docstring of =E2=80=98dired-mark=E2=80=99: =E2=80=9CIf on a subdir headerline, mark all its files except `.' and `= ..'.=E2=80=9D > No, we don't need a function `dired-marked-files-or-file-at-point-p', > for that or anything else. The `dired-do-*' commands already DTRT > wrt the marked-files-or-file-at-point. I agree that it's better to check the =E2=80=98files=E2=80=99 returned fr= om =E2=80=98dired-get-marked-files=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 31 18:20:39 2018 Received: (at 30285) by debbugs.gnu.org; 31 Jan 2018 23:20:39 +0000 Received: from localhost ([127.0.0.1]:51652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eh1gF-0006Va-0J for submit@debbugs.gnu.org; Wed, 31 Jan 2018 18:20:39 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:35538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eh1gD-0006VN-5S for 30285@debbugs.gnu.org; Wed, 31 Jan 2018 18:20:37 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0VNGikq137732; Wed, 31 Jan 2018 23:20:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=QKoE9a68c4YlT9F3WWD/b1YYo0HcbZLCzOmpOI4Yb2Y=; b=d83VEHTM/5vhuSRBSJI9jvBgyoSfpb8l7y2rL8T37/frNAeu0sJfEdsTnMy8k9rFQh+j Prxdnguv+vhWQ80zba/w+9NVjis1s0n3alD4LhrWguuS0pUEMwUiUsUM1M0RsObBojtX qojf6ntQTIK+x2na4cPJ0t7nrzS105mBkxGZwPq6Wk9DNIGVGlT2UtMIhqvosePIkb8Q fUjuzYG8dlkz1p6RIWPeX9sS3erEPoazryHRMkzuMOS9sZVyDT6ejyF70KB/iM3twT3S 5WrldqsTCgObMd+7RN3rjdAgaMR4KBvEaIy1Bwx84DbbrOs93jsgDnZr05/dPzO7RwS3 dg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2fucd9kg4u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 31 Jan 2018 23:20:30 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w0VNKS3I031135 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 31 Jan 2018 23:20:28 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w0VNKNCQ029955; Wed, 31 Jan 2018 23:20:23 GMT MIME-Version: 1.0 Message-ID: <5dd33d7a-b418-4c60-9891-ec2e21f21fe1@default> Date: Wed, 31 Jan 2018 15:20:22 -0800 (PST) From: Drew Adams To: Juri Linkov Subject: RE: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> In-Reply-To: <87fu6lwxxu.fsf@mail.linkov.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4639.0 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8791 signatures=668659 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=869 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801310286 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: Eli Zaretskii , 30285@debbugs.gnu.org, jidanni@jidanni.org, Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > > Yes, it makes sense for such commands to do nothing or to show an > > error message when on the "top line of dired", as described in the > > bug report. >=20 > Instead of doing nothing or showing an error message, how about > doing a more useful thing: when on the top line, =E2=80=98dired-do-chmod= =E2=80=99 > could do chmod on all files in the dir. Not a good idea, IMO. Too easy to do accidentally. At the very least it would need to ask for confirmation specially. `m', `d', and `w', which are the keys that you are talking about, to not do anything to the files in question. They affect only the Dired listing or the `kill-ring'. That's quite different from something like `chmod'. And in any case, such shortcut behavior is not needed at all (see next). > This is exactly what other Dired commands already do: e.g. typing =E2=80= =98m=E2=80=99 > on the top line or on any other subdir headerline, they perform > their actions on all files. Which is why what you propose isn't needed. Just `m' then `M'. If someone is going to act on lots of files, s?he had better be aware of that. Best is that they are first marked before acting on them. But yes, it's true that not needing to change marks can be handy. I.e., you have some files marked for a given reason already, and you want to keep those markings. (You could use `* c' to temporarily change marks, but that's a bit roundabout.) That handiness (not losing existing markings) is the reason why in my Dired+ code, for commands that normally act on the marked files (or the N next files, with numeric prefix arg N), you can use multiple plain `C-u' to act on all files, ignoring markings: Just what "all" files means changes with the number of `C-u', as follows: `C-u C-u' - Use all files present, but no directories. `C-u C-u C-u' - Use all files and dirs except `.' and `..'. `C-u C-u C-u C-u' - use all files and dirs, `.' and `..'. (More than four `C-u' act the same as two.) But I don't think that's a good idea in the current context. I'd suggest that we just let someone use `m' (on that non-file line) followed by `M' etc. I think that this bug should be handled by doing what Dired usually does when point is on a non-file line (_anywhere_, not just on a directory header line or its "total..." line) - as I said earlier: just raise a `user-error'. You'll note too that `m' on a non-file line other than the dir header line does _not_ do what you describe. * On the "total..." line it marks the first file line (which is now `..' in Windows but used to be `.'). * On the blank line before an inserted subdir header it does the same thing: it marks the first file line of that subdir listing. * On any other non-file line, such as the blank line at the end of the buffer, it does nothing at all. So the `m' (`dired-mark') behavior is quite variable, even if it can be useful. Note too that the other two commands that act specially on a (sub)dir header line do not do the same thing as `dired-mark'. * `dired-copy-filename-as-kill' does not act similarly at all. It copies the subdir name instead of names of any files in its listing. * `dired-flag-file-deletion' does act somewhat similarly to `dired-mark': it flags all of the files (other than `.' and `..') in the subdir listing - except if the region is active. In the latter case it flags the files in the region. And that need not mean any files in the subdir listing - it could be just files in the previous listing. Or it could be files in the subdir listing plus files in other, subsequent subdir listings. > For example, see the docstring of =E2=80=98dired-mark=E2=80=99: > =E2=80=9CIf on a subdir headerline, mark all its files except `.' > and `..'.=E2=80=9D >=20 > > No, we don't need a function `dired-marked-files-or-file-at-point-p', > > for that or anything else. The `dired-do-*' commands already DTRT > > wrt the marked-files-or-file-at-point. >=20 > I agree that it's better to check the =E2=80=98files=E2=80=99 returned fr= om > =E2=80=98dired-get-marked-files=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 01 03:16:43 2018 Received: (at 30285) by debbugs.gnu.org; 1 Feb 2018 08:16:43 +0000 Received: from localhost ([127.0.0.1]:51765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehA30-0002Td-Om for submit@debbugs.gnu.org; Thu, 01 Feb 2018 03:16:43 -0500 Received: from mail-it0-f48.google.com ([209.85.214.48]:56281) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehA2y-0002TQ-Dh for 30285@debbugs.gnu.org; Thu, 01 Feb 2018 03:16:41 -0500 Received: by mail-it0-f48.google.com with SMTP id c16so3081459itc.5 for <30285@debbugs.gnu.org>; Thu, 01 Feb 2018 00:16:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=yuaNS1eippICliiqaYyYmAq6ryXFbJ/mxisnv8xqQj0=; b=nJ5m3ZgLjLN9/kXaZeKLFWkkdEYR6UXfB2w63Z4DtGWiCBHwupVCteAZFwLkjluRSn 4brcZ7/vwrK/8F+398X6064yG7eLH9YjOHANg0VurNp6ASqOEsqm8U9HGvu7dfFJSilk 0+9Ap9k5o0AZvCWmTnSTVWou8G+K6mEH0ekKLTFXYuK6KXE6jUz92v85yTs0/Mu53ydK 9MaGxfeWSQxE34rPmKKN5tmGzhaZmkz+bOPnHBiFA0StEfbQeUCsr/+5bIq6/00pxy3i 7MVVq359QMxzYOWzGMFF6pbwkr2Jd+TQGxD6pTDpiz+Whun+lRXHSz5XHMFsOTZFcK+O iStQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=yuaNS1eippICliiqaYyYmAq6ryXFbJ/mxisnv8xqQj0=; b=o7TLzsM3dBLYicTIz2G+eRGFdbcSNV6vsVCgYayl4kmYjumKAZWKszpdL1id1l05fg vNWrZyDCHdc9M1oVQ/dX4eNuZI8O4EvjmjkuUhIkt+d0nMUPHJxqGudYpv/lBX+rYamx Qyi69DhvuJ6V+urLY7zSiTBkkpKk+CVoqu4QemyCR7i1UBaWSBHHibsOznTqo1wubMTo hmo4m3BGPnUUS6RjSww3b8pWxftSyaGEP5/x/10/XsAfMo8J+Q67hIz9jcYtgIoA0QtS LwyUF3y4EYfkcc2rp35tYERswTY3B7X8bbGSkEaqOlwvp0N+zkgxFwHa5GFm3fvyai9M UySg== X-Gm-Message-State: AKwxyte7dc3T/qWM3bQyBFs508/M1vb/4ECFsNzqEl+BdcfMzA/4QtI/ lYfhTCtxGAc5l57LGHMkIks= X-Google-Smtp-Source: AH8x224bG9c2dDnFT6XOP5k2nZJ7nUuoh12x6dMeBszafjFvAxC9XSigDyDO+Et30gaVcjw76j+j+w== X-Received: by 10.36.124.197 with SMTP id a188mr42123330itd.5.1517472994519; Thu, 01 Feb 2018 00:16:34 -0800 (PST) Received: from calancha-pc (FL1-125-193-170-29.tky.mesh.ad.jp. [125.193.170.29]) by smtp.gmail.com with ESMTPSA id m63sm1303788itm.12.2018.02.01.00.16.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 00:16:32 -0800 (PST) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Thu, 1 Feb 2018 17:16:26 +0900 (JST) X-X-Sender: calancha@calancha-pc To: Juri Linkov Subject: Re: bug#30285: dired-do-chmod vs. top line of dired In-Reply-To: <87fu6lwxxu.fsf@mail.linkov.net> Message-ID: References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-862728792-1517472991=:19997" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: jidanni@jidanni.org, Eli Zaretskii , 30285@debbugs.gnu.org, Drew Adams , Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --8323329-862728792-1517472991=:19997 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Wed, 31 Jan 2018, Juri Linkov wrote: >>> I propose to add a new predicate >>> `dired-marked-files-or-file-at-point-p', and used it in all those >>> commands. >> >> Please don't do any such thing. >> >> Yes, it makes sense for such commands to do nothing or to show an >> error message when on the "top line of dired", as described in the >> bug report. > > Instead of doing nothing or showing an error message, how about > doing a more useful thing: when on the top line, ‘dired-do-chmod’ > could do chmod on all files in the dir. > > This is exactly what other Dired commands already do: e.g. typing ‘m’ > on the top line or on any other subdir headerline, they perform > their actions on all files. > > For example, see the docstring of ‘dired-mark’: > > “If on a subdir headerline, mark all its files except `.' and `..'.” Yeah, that's another possibility (not my preference). IMO marking commands are at at different level than commands that operate on marked files; we don't need to mimic such feature of the `dired-mark'. Indeed, if the user want to operate on all files, she can easily do `dired-mark' followed by the command in question; I tend to think calling `dired-do...' things without marked files from the top line as an user mistake. I would like all `dired-do...' commands behave the same under the 'X condition': * called from the top line ** no marked files. >> No, we don't need a function `dired-marked-files-or-file-at-point-p', >> for that or anything else. The `dired-do-*' commands already DTRT >> wrt the marked-files-or-file-at-point. > > I agree that it's better to check the ‘files’ returned from > ‘dired-get-marked-files’. Today I took a deeper look in the train and I saw there are several more commands that don't protect against X. Some even breaks (e.g., dired-do-shell-command, dired-do-async-shell-command). Below patch introduce a macro to systematically handle the 'X condition', what do you think? --8<-----------------------------cut here---------------start------------->8--- commit 193ba8fe6225093a0fc96e4bea7eec21a1643d4b Author: tino calancha Date: Thu Feb 1 10:32:30 2018 +0900 dired-do-chmod: Avoid unecessary prompt Prompt user only if there are any marked files or a file at point (Bug#30285). * lisp/dired.el (dired-marked-files-or-file-at-point-p): New defun. (dired-with-dired-do): New macro. * lisp/dired-aux.el (dired-do-chmod) (dired-do-chmod, dired-do-chgrp, dired-do-chown) (dired-do-touch, dired-do-print, dired-do-async-shell-command) (dired-do-shell-command, dired-query, dired-byte-compile) (dired-load, dired-do-copy, dired-do-symlink, dired-do-hardlink) (dired-do-rename, dired-isearch-filenames-regexp, dired-do-find-regexp) (dired-do-find-regexp-and-replace) * lisp/dired-x.el (dired-do-relsymlink, dired-do-find-marked-files): Use it. diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 55b68a372e..f5f3311ead 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -361,40 +361,41 @@ dired-do-chmod Type M-n to pull the file attributes of the file at point into the minibuffer." (interactive "P") - (let* ((files (dired-get-marked-files t arg)) - ;; The source of default file attributes is the file at point. - (default-file (dired-get-filename t t)) - (modestr (when default-file - (nth 8 (file-attributes default-file)))) - (default - (and (stringp modestr) - (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr) - (replace-regexp-in-string - "-" "" - (format "u=%s,g=%s,o=%s" - (match-string 1 modestr) - (match-string 2 modestr) - (match-string 3 modestr))))) - (modes (dired-mark-read-string - "Change mode of %s to: " - nil 'chmod arg files default)) - num-modes) - (cond ((or (equal modes "") - ;; Use `eq' instead of `equal' - ;; to detect empty input (bug#12399). - (eq modes default)) - ;; We used to treat empty input as DEFAULT, but that is not - ;; such a good idea (Bug#9361). - (error "No file mode specified")) - ((string-match-p "^[0-7]+" modes) - (setq num-modes (string-to-number modes 8)))) - - (dolist (file files) - (set-file-modes - file - (if num-modes num-modes - (file-modes-symbolic-to-number modes (file-modes file))))) - (dired-do-redisplay arg))) + (dired-with-dired-do + (let* ((files (dired-get-marked-files t arg)) + ;; The source of default file attributes is the file at point. + (default-file (dired-get-filename t t)) + (modestr (when default-file + (nth 8 (file-attributes default-file)))) + (default + (and (stringp modestr) + (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr) + (replace-regexp-in-string + "-" "" + (format "u=%s,g=%s,o=%s" + (match-string 1 modestr) + (match-string 2 modestr) + (match-string 3 modestr))))) + (modes (dired-mark-read-string + "Change mode of %s to: " + nil 'chmod arg files default)) + num-modes) + (cond ((or (equal modes "") + ;; Use `eq' instead of `equal' + ;; to detect empty input (bug#12399). + (eq modes default)) + ;; We used to treat empty input as DEFAULT, but that is not + ;; such a good idea (Bug#9361). + (error "No file mode specified")) + ((string-match-p "^[0-7]+" modes) + (setq num-modes (string-to-number modes 8)))) + + (dolist (file files) + (set-file-modes + file + (if num-modes num-modes + (file-modes-symbolic-to-number modes (file-modes file))))) + (dired-do-redisplay arg)))) ;;;###autoload (defun dired-do-chgrp (&optional arg) @@ -404,7 +405,8 @@ dired-do-chgrp (interactive "P") (if (memq system-type '(ms-dos windows-nt)) (error "chgrp not supported on this system")) - (dired-do-chxxx "Group" "chgrp" 'chgrp arg)) + (dired-with-dired-do + (dired-do-chxxx "Group" "chgrp" 'chgrp arg))) ;;;###autoload (defun dired-do-chown (&optional arg) @@ -414,7 +416,8 @@ dired-do-chown (interactive "P") (if (memq system-type '(ms-dos windows-nt)) (error "chown not supported on this system")) - (dired-do-chxxx "Owner" dired-chown-program 'chown arg)) + (dired-with-dired-do + (dired-do-chxxx "Owner" dired-chown-program 'chown arg))) ;;;###autoload (defun dired-do-touch (&optional arg) @@ -423,7 +426,8 @@ dired-do-touch Type M-n to pull the file attributes of the file at point into the minibuffer." (interactive "P") - (dired-do-chxxx "Timestamp" dired-touch-program 'touch arg)) + (dired-with-dired-do + (dired-do-chxxx "Timestamp" dired-touch-program 'touch arg))) ;; Process all the files in FILES in batches of a convenient size, ;; by means of (FUNCALL FUNCTION ARGS... SOME-FILES...). @@ -476,23 +480,24 @@ dired-do-print `lpr-switches' as default." (interactive "P") (require 'lpr) - (let* ((file-list (dired-get-marked-files t arg)) - (lpr-switches - (if (and (stringp printer-name) - (string< "" printer-name)) - (cons (concat lpr-printer-switch printer-name) - lpr-switches) - lpr-switches)) - (command (dired-mark-read-string - "Print %s with: " - (mapconcat 'identity - (cons lpr-command - (if (stringp lpr-switches) - (list lpr-switches) - lpr-switches)) - " ") - 'print arg file-list))) - (dired-run-shell-command (dired-shell-stuff-it command file-list nil)))) + (dired-with-dired-do + (let* ((file-list (dired-get-marked-files t arg)) + (lpr-switches + (if (and (stringp printer-name) + (string< "" printer-name)) + (cons (concat lpr-printer-switch printer-name) + lpr-switches) + lpr-switches)) + (command (dired-mark-read-string + "Print %s with: " + (mapconcat 'identity + (cons lpr-command + (if (stringp lpr-switches) + (list lpr-switches) + lpr-switches)) + " ") + 'print arg file-list))) + (dired-run-shell-command (dired-shell-stuff-it command file-list nil))))) (defun dired-mark-read-string (prompt initial op-symbol arg files &optional default-value collection) @@ -666,7 +671,7 @@ dired-do-async-shell-command The output appears in the buffer `*Async Shell Command*'." (interactive - (let ((files (dired-get-marked-files t current-prefix-arg))) + (dired-with-dired-do (list ;; Want to give feedback whether this file or marked files are used: (dired-read-shell-command "& on %s: " current-prefix-arg files) @@ -727,7 +732,7 @@ dired-do-shell-command ;;Functions dired-run-shell-command and dired-shell-stuff-it do the ;;actual work and can be redefined for customization. (interactive - (let ((files (dired-get-marked-files t current-prefix-arg))) + (dired-with-dired-do (list ;; Want to give feedback whether this file or marked files are used: (dired-read-shell-command "! on %s: " current-prefix-arg files) @@ -1224,7 +1229,8 @@ dired-query (defun dired-do-compress (&optional arg) "Compress or uncompress marked (or next ARG) files." (interactive "P") - (dired-map-over-marks-check #'dired-compress arg 'compress t)) + (dired-with-dired-do + (dired-map-over-marks-check #'dired-compress arg 'compress t))) ;; Commands for Emacs Lisp files - load and byte compile @@ -1252,7 +1258,8 @@ dired-byte-compile (defun dired-do-byte-compile (&optional arg) "Byte compile marked (or next ARG) Emacs Lisp files." (interactive "P") - (dired-map-over-marks-check #'dired-byte-compile arg 'byte-compile t)) + (dired-with-dired-do + (dired-map-over-marks-check #'dired-byte-compile arg 'byte-compile t))) (defun dired-load () ;; Return nil for success, offending file name else. @@ -1269,7 +1276,8 @@ dired-load (defun dired-do-load (&optional arg) "Load the marked (or next ARG) Emacs Lisp files." (interactive "P") - (dired-map-over-marks-check #'dired-load arg 'load t)) + (dired-with-dired-do + (dired-map-over-marks-check #'dired-load arg 'load t))) ;;;###autoload (defun dired-do-redisplay (&optional arg test-for-subdir) @@ -2042,11 +2050,12 @@ dired-do-copy This command copies symbolic links by creating new ones, similar to the \"-d\" option for the \"cp\" shell command." (interactive "P") - (let ((dired-recursive-copies dired-recursive-copies)) - (dired-do-create-files 'copy #'dired-copy-file - "Copy" - arg dired-keep-marker-copy - nil dired-copy-how-to-fn))) + (dired-with-dired-do + (let ((dired-recursive-copies dired-recursive-copies)) + (dired-do-create-files 'copy #'dired-copy-file + "Copy" + arg dired-keep-marker-copy + nil dired-copy-how-to-fn)))) ;;;###autoload (defun dired-do-symlink (&optional arg) @@ -2060,8 +2069,9 @@ dired-do-symlink For relative symlinks, use \\[dired-do-relsymlink]." (interactive "P") - (dired-do-create-files 'symlink #'make-symbolic-link - "Symlink" arg dired-keep-marker-symlink)) + (dired-with-dired-do + (dired-do-create-files 'symlink #'make-symbolic-link + "Symlink" arg dired-keep-marker-symlink))) ;;;###autoload (defun dired-do-hardlink (&optional arg) @@ -2073,8 +2083,9 @@ dired-do-hardlink suggested for the target directory depends on the value of `dired-dwim-target', which see." (interactive "P") - (dired-do-create-files 'hardlink #'dired-hardlink - "Hardlink" arg dired-keep-marker-hardlink)) + (dired-with-dired-do + (dired-do-create-files 'hardlink #'dired-hardlink + "Hardlink" arg dired-keep-marker-hardlink))) (defun dired-hardlink (file newname &optional ok-if-already-exists) (dired-handle-overwrite newname) @@ -2092,8 +2103,9 @@ dired-do-rename The default suggested for the target directory depends on the value of `dired-dwim-target', which see." (interactive "P") - (dired-do-create-files 'move #'dired-rename-file - "Move" arg dired-keep-marker-rename "Rename")) + (dired-with-dired-do + (dired-do-create-files 'move #'dired-rename-file + "Move" arg dired-keep-marker-rename "Rename"))) ;;;###end dired-cp.el ;;; 5K @@ -2798,15 +2810,17 @@ dired-isearch-filenames-regexp (defun dired-do-isearch () "Search for a string through all marked files using Isearch." (interactive) - (multi-isearch-files - (dired-get-marked-files nil nil 'dired-nondirectory-p))) + (dired-with-dired-do + (multi-isearch-files + (dired-get-marked-files nil nil 'dired-nondirectory-p)))) ;;;###autoload (defun dired-do-isearch-regexp () "Search for a regexp through all marked files using Isearch." (interactive) - (multi-isearch-files-regexp - (dired-get-marked-files nil nil 'dired-nondirectory-p))) + (dired-with-dired-do + (multi-isearch-files-regexp + (dired-get-marked-files nil nil 'dired-nondirectory-p)))) ;;;###autoload (defun dired-do-search (regexp) @@ -2847,7 +2861,9 @@ dired-do-find-regexp directories. REGEXP should use constructs supported by your local `grep' command." - (interactive "sSearch marked files (regexp): ") + ;; (interactive "sSearch marked files (regexp): ") + (interactive + (dired-with-dired-do (list (read-string "Search marked files (regexp): ")))) (require 'grep) (defvar grep-find-ignored-files) (defvar grep-find-ignored-directories) @@ -2877,8 +2893,9 @@ dired-do-find-regexp-and-replace REGEXP should use constructs supported by your local `grep' command." (interactive (let ((common - (query-replace-read-args - "Query replace regexp in marked files" t t))) + (dired-with-dired-do + (query-replace-read-args + "Query replace regexp in marked files" t t)))) (list (nth 0 common) (nth 1 common)))) (with-current-buffer (dired-do-find-regexp from) (xref-query-replace-in-results from to))) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index a90f1f4adc..f9aacc97b3 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -1282,8 +1282,9 @@ dired-do-relsymlink For absolute symlinks, use \\[dired-do-symlink]." (interactive "P") - (dired-do-create-files 'relsymlink #'dired-make-relative-symlink - "RelSymLink" arg dired-keep-marker-relsymlink)) + (dired-with-dired-do + (dired-do-create-files 'relsymlink #'dired-make-relative-symlink + "RelSymLink" arg dired-keep-marker-relsymlink))) (autoload 'dired-mark-read-regexp "dired-aux") (autoload 'dired-do-create-files-regexp "dired-aux") @@ -1335,7 +1336,8 @@ dired-do-find-marked-files To keep Dired buffer displayed, type \\[split-window-below] first. To display just marked files, type \\[delete-other-windows] first." (interactive "P") - (dired-simultaneous-find-file (dired-get-marked-files) noselect)) + (dired-with-dired-do + (dired-simultaneous-find-file (dired-get-marked-files) noselect))) (defun dired-simultaneous-find-file (file-list noselect) "Visit all files in FILE-LIST and display them simultaneously. diff --git a/lisp/dired.el b/lisp/dired.el index eade11bc7f..649214612b 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2385,6 +2385,22 @@ dired-get-filename (t (concat (dired-current-directory localp) file))))) +(defun dired-marked-files-or-file-at-point-p () + "Return non-nil if there are marked files or a file at point." + (and (or (cdr (dired-get-marked-files nil nil nil 'distinguish-1-marked)) + (dired-get-filename nil 'no-error)) t)) + +;; Use this macro on `dired-do-' commands that accept as +;; input the marked file or the file at point. +(defmacro dired-with-dired-do (&rest body) + "Run BODY if there are marked files or a file at point. +Signal an error if there is neither marked files nor a file at point. +Return value of the last evaluated form in BODY." + (declare (debug (&body)) (indent 0)) + `(if (null (dired-marked-files-or-file-at-point-p)) + (user-error "No file on this line") + ,@body)) + (defun dired-string-replace-match (regexp string newtext &optional literal global) "Replace first match of REGEXP in STRING with NEWTEXT. --8<-----------------------------cut here---------------end--------------->8--- In GNU Emacs 27.0.50 (build 17, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2018-01-30 built on calancha-pc Repository revision: 29abae3572090a86beedb66822ccf34356c8a00c --8323329-862728792-1517472991=:19997-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 01 04:17:57 2018 Received: (at 30285) by debbugs.gnu.org; 1 Feb 2018 09:17:57 +0000 Received: from localhost ([127.0.0.1]:51808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehB0H-00048L-Jw for submit@debbugs.gnu.org; Thu, 01 Feb 2018 04:17:57 -0500 Received: from mail-pl0-f41.google.com ([209.85.160.41]:33295) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehB0G-000488-86 for 30285@debbugs.gnu.org; Thu, 01 Feb 2018 04:17:56 -0500 Received: by mail-pl0-f41.google.com with SMTP id t4so3040591plo.0 for <30285@debbugs.gnu.org>; Thu, 01 Feb 2018 01:17:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=CEy+c0sQx2XB1AZ2oKHvpBG4gcVUdOarikS0uW5LLXo=; b=ni+XhaMrKkeeX3IE5zLGxO0OEzCxIVmSUHgyisBgqniGsQuO602nFWICge3VOqSk4s 4eh/vcISms58IGmoZI2lg0YdUMrMzttYgjUcQuPCw3b0wP+eYpPNEC/y4R8jwruhsUpv gPLBs0N/MMdZuO/9fZMETI88xKNG8m35oAGZSNLPUTxYqUnZX5fteoYc/FGBkAhqrxoR X3gW2KiE1PSP4K3Q5QP849iP0omV237OablP1Im7pFtgee7zD66xnTh5g2/BNE0CRK4+ hmgrbTNwdUSfT185cYrXPpZmvSAHyaz4OiroMIV9E6AK1w9pfRtYysYdsSkBMnoYx19F 9Oew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=CEy+c0sQx2XB1AZ2oKHvpBG4gcVUdOarikS0uW5LLXo=; b=J3g3DK3oKbEP7Fkel2ktWP0olaQhXZ5WDyWHoGjhRGifz9JkvEeaqAJwFDYpI4/SiC Af62IU4fryJTGAqUleATg82pHXMYjSOyGlDyqCRhzImKgwHMW2Dhc/YXjjuKcllHhj66 9K7J54YIrt+c2dMNgs8Haa5v3ofYt33fQLrpoIbaQJ1TO9HH656C/d9uiOgkRpZNz2OX K4vXJ+eQSNYIvKljFLQ1/O9E7uoAvKZWwJFq4hSgIEytoi1eZOHl8hi9cynCRr/LfGgv Y1tU8FkT7HHFjrNZPtl0+LVPhFW3MRI5R2Nrt/HzI/Q8/c2DI34zVIrGZLgUW8XWygSB Eiwg== X-Gm-Message-State: AKwxytefQ2KJNdO2UPqnJZ9X9TMrRs5eXXqLErWa5/OZqunoNDPmIDBb HzK6+kHDqO6pzxqYGltt4Rqlrw== X-Google-Smtp-Source: AH8x224iHoqCFu+x1PiBYZXcFWBT0hnj14KksM6lTgghIpHmWTp2t6zV9qVBDAtLYhxMUPJinG/L7A== X-Received: by 2002:a17:902:2bc5:: with SMTP id l63-v6mr24284299plb.108.1517476670276; Thu, 01 Feb 2018 01:17:50 -0800 (PST) Received: from calancha-pc (FL1-125-193-170-29.tky.mesh.ad.jp. [125.193.170.29]) by smtp.gmail.com with ESMTPSA id z186sm30761603pgb.70.2018.02.01.01.17.48 for <30285@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 01 Feb 2018 01:17:49 -0800 (PST) From: Tino Calancha To: 30285@debbugs.gnu.org Subject: Re: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> Date: Thu, 01 Feb 2018 18:17:43 +0900 In-Reply-To: (Tino Calancha's message of "Thu, 1 Feb 2018 17:16:26 +0900 (JST)") Message-ID: <87r2q52hmw.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Tino Calancha writes: Below the lines - (let ((files (dired-get-marked-files t current-prefix-arg))) must not be deleted (its a typo), otherwise `files' is unbound. Sorry for the typo (the train was really crowdy!) :-| (defun dired-mark-read-string (prompt initial op-symbol arg files &optional default-value collection) @@ -666,7 +671,7 @@ dired-do-async-shell-command The output appears in the buffer `*Async Shell Command*'." (interactive - (let ((files (dired-get-marked-files t current-prefix-arg))) + (dired-with-dired-do (list ;; Want to give feedback whether this file or marked files are used: (dired-read-shell-command "& on %s: " current-prefix-arg files) @@ -727,7 +732,7 @@ dired-do-shell-command ;;Functions dired-run-shell-command and dired-shell-stuff-it do the ;;actual work and can be redefined for customization. (interactive - (let ((files (dired-get-marked-files t current-prefix-arg))) + (dired-with-dired-do (list ;; Want to give feedback whether this file or marked files are used: (dired-read-shell-command "! on %s: " current-prefix-arg files) From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 01 11:11:01 2018 Received: (at 30285) by debbugs.gnu.org; 1 Feb 2018 16:11:01 +0000 Received: from localhost ([127.0.0.1]:52596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehHS0-0008Hm-O6 for submit@debbugs.gnu.org; Thu, 01 Feb 2018 11:11:00 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:51640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehHRz-0008HZ-CN for 30285@debbugs.gnu.org; Thu, 01 Feb 2018 11:10:59 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w11G7MEU058627; Thu, 1 Feb 2018 16:10:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=MHbyODqeespe3SAMzjVRlAAPl2BfisbA10B49TS2uPg=; b=A0mTd5G2JuwsfXFnz+pOqMphfHE/+Dpcyi4KDsnA14GSbohSc3m0BDpBVMriMdR3zlxA EOvJYupt5NKKP7f39g1pR6dBjU/RDXKvYs67CPC4DVXY2zr6Sz2TRytNrgTEpbkGoy6S r6S0KsQgT55/gGh2SB+zION1r6gYTVFV8mU+2cRIbRcROm5/plTmn8EL/eyrV4PHO6JG zK00i7zzEmFbwM2MWYTREf00VtjQlziY5tMUL56wkBQuGfvUb4r+M5Efh4zR9nnYmkXv SK1eUttAxr8BSOWZeRkqDHhTkY9vEv0IVVR6rVHbskakPWp6kA5kufGc6JZVfU9puItF JA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2fv5r0r5y1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Feb 2018 16:10:53 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w11GArgH001619 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 1 Feb 2018 16:10:53 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w11GAqIS012554; Thu, 1 Feb 2018 16:10:52 GMT MIME-Version: 1.0 Message-ID: Date: Thu, 1 Feb 2018 08:10:51 -0800 (PST) From: Drew Adams To: Tino Calancha , Juri Linkov Subject: RE: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4639.0 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8792 signatures=668660 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802010207 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: Eli Zaretskii , 30285@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > I would like all `dired-do...' commands behave the same under the > 'X condition': * called from the top line ** no marked files. I've already said that it's not only about the top line. It's about the ordinary Dired situation of not being on a file line. Plenty of Dired code already deals (simply) with this "X condition". The important things about a command that acts on the marked files are that (1) it acts on the N next files, if given a numeric prefix arg, (2) if no prefix arg, it acts on the marked files, if any, (3) if not prefix arg and no marked files it acts on the file of the current line, and (4) it doesn't do something confusing if there is no prefix arg, there are no marked files, and there is no file on the current line.=20 This bug is only about case (4) - a corner case. The solution is to just let the user know that s?he is not on a file line. > >> No, we don't need a function `dired-marked-files-or-file-at-point-p', > >> for that or anything else. The `dired-do-*' commands already DTRT > >> wrt the marked-files-or-file-at-point. > > > > I agree that it's better to check the =E2=80=98files=E2=80=99 returned = from > > =E2=80=98dired-get-marked-files=E2=80=99. >=20 > Today I took a deeper look in the train and I saw there are > several more commands that don't protect against X. Some > even breaks (e.g., dired-do-shell-command, > dired-do-async-shell-command). >=20 > Below patch introduce a macro to systematically handle the 'X > condition', what do you think? Sorry, Tino, but I don't have the time or the will to check your large patch. My impression is that you guys are going overboard. This bug is a _trivial_ usability bug. There is nothing really wrong with the existing behavior. But yes, it is unnecessary, and it could be slightly confusing, to prompt the user about acting on zero files. The trivial bug should be fixed; sure. But it's not a big deal. The fix is also trivial. Dired already provides what is needed, as has been pointed out: just check the return value of `dired-get-marked-files'. If no files are marked then handle use of the command as a `user-error': inform the user that there is no file on the current line and no files are marked. End of story. This is trivial to do, and the resulting (corner case) behavior will be simple, consistent, and clear to all users. If some `dired-do-*' command does not already use `dired-get-marked-files' up front, and if it is not appropriate for it to use it, then there are at least two other alternatives that Dired offers to detect this corner case. I already mentioned them. Using either of them to fix the bug is also trivial. In sum: trivial problem, trivial solution. I'm not happy seeing big changes made to Dired code gratuitously. I don't have the time to argue about it or provide alternative patches. But I hope you will not go down the road you seem to be going down. Just one opinion. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 01 15:12:24 2018 Received: (at 30285) by debbugs.gnu.org; 1 Feb 2018 20:12:24 +0000 Received: from localhost ([127.0.0.1]:52754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehLDb-0007Tu-VF for submit@debbugs.gnu.org; Thu, 01 Feb 2018 15:12:24 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:57237 helo=homiemail-a20.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehLDZ-0007Tm-PN for 30285@debbugs.gnu.org; Thu, 01 Feb 2018 15:12:22 -0500 Received: from homiemail-a20.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTP id A93C27EC06F; Thu, 1 Feb 2018 12:12:20 -0800 (PST) Received: from localhost.linkov.net (m91-129-107-8.cust.tele2.ee [91.129.107.8]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPSA id 14FF47EC060; Thu, 1 Feb 2018 12:12:18 -0800 (PST) From: Juri Linkov To: Tino Calancha Subject: Re: bug#30285: dired-do-chmod vs. top line of dired Organization: LINKOV.NET References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> Date: Thu, 01 Feb 2018 22:07:10 +0200 In-Reply-To: (Tino Calancha's message of "Thu, 1 Feb 2018 17:16:26 +0900 (JST)") Message-ID: <87k1vwcwy1.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: Eli Zaretskii , 30285@debbugs.gnu.org, Drew Adams , jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > IMO marking commands are at at different level than commands that opera= te > on marked files; we don't need to mimic such feature of the `dired-mark= '. > Indeed, if the user want to operate on all files, she can easily do > `dired-mark' followed by the command in question; I tend to think call= ing > `dired-do...' things without marked files from the top line as an user = mistake. Since `dired-mark' from the top line followed by the command in question is not obvious for users, we could provide a hint in the error message, i.e. mention the availability of =E2=80=98m=E2=80=99 on the top line with= such message: =E2=80=9CYou can type `m' here to mark all files for this operation=E2=80= =9D. >>> No, we don't need a function `dired-marked-files-or-file-at-point-p', >>> for that or anything else. The `dired-do-*' commands already DTRT >>> wrt the marked-files-or-file-at-point. >> >> I agree that it's better to check the =E2=80=98files=E2=80=99 returned= from >> =E2=80=98dired-get-marked-files=E2=80=99. > > Today I took a deeper look in the train and I saw there are several mor= e > commands that don't protect against X. Some even breaks > (e.g., dired-do-shell-command, dired-do-async-shell-command). > > Below patch introduce a macro to systematically handle the 'X condition= ', > what do you think? I agree with Drew that better to use existing functions, and not to duplicate them. Non sunt multiplicanda entia sine necessitate. Moreover, we should not change the old semantic of Dired commands: if users have a habit of operating on the first files by going to the top line and typing e.g. =E2=80=98M-< C-5 M=E2=80=99 to change modes of the f= irst 5 files, this is just fine, we should not prohobit this behaviour now. So what we need to do is just check if the list of files returned from =E2=80=98dired-get-marked-files=E2=80=99 is nil, and show some message in= this case in all places that you found where the prompt with [0 files] makes no sense. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 01 15:50:30 2018 Received: (at 30285) by debbugs.gnu.org; 1 Feb 2018 20:50:30 +0000 Received: from localhost ([127.0.0.1]:52778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehLoT-0008Nm-QD for submit@debbugs.gnu.org; Thu, 01 Feb 2018 15:50:29 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:52542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehLoS-0008NZ-AT for 30285@debbugs.gnu.org; Thu, 01 Feb 2018 15:50:28 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w11KjrCH076097; Thu, 1 Feb 2018 20:50:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=OS/Td4TY+eJ4s1WBmhC8K1A4XHkuubA5BoMn/NQz8xI=; b=Z1PujiwYywpB7GKj4D1OCrtSMEQ1FMzADo7D38bXXytFAuQMOy75lPOqdUt2wrZPyUHj c62wXm8dE8PwAUo95XU1JPInbvzFzreyTpNiJDPzodwD5KgdFfTrjVGXaruaVBQPVmr7 EEYQ56pLA7UmzdYr2L4Y8UFpjX1exE0hst6VD3yFI6fn8/OFIFwVSwHUcEiMgVEAdk0K Mj6JcLqtBujqLdcXUN4yHjYELarhUJ78shtA30Ij4OkJAQ1agXNLTXUrh+38eveYbpFK kTLnPaDMP/3fIBlla3nMp8QTNlzthPKKsqevKf4/iTdqRo59HQB5O30rRXrrJaQ6mMjL wg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2fva7980k2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Feb 2018 20:50:22 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w11KoJme007833 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 1 Feb 2018 20:50:19 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w11KoIXV028978; Thu, 1 Feb 2018 20:50:18 GMT MIME-Version: 1.0 Message-ID: <5620cf82-9402-4895-bdd1-fdf5401c8172@default> Date: Thu, 1 Feb 2018 12:50:16 -0800 (PST) From: Drew Adams To: Juri Linkov , Tino Calancha Subject: RE: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> <87k1vwcwy1.fsf@mail.linkov.net> In-Reply-To: <87k1vwcwy1.fsf@mail.linkov.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4639.0 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8792 signatures=668660 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802010261 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: Eli Zaretskii , 30285@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > Since `dired-mark' from the top line followed by the command in question > is not obvious for users, we could provide a hint in the error message, > i.e. mention the availability of =E2=80=98m=E2=80=99 on the top line with= such message: > =E2=80=9CYou can type `m' here to mark all files for this operation=E2=80= =9D. Not sure how helpful or necessary that is. It's liable to not be helpful (that use case needs no special advertising). And it might even confuse things. I think it just gets in the way of the message, which is, "You are not on a file line." I think we should show the same error message from any non-file line - not just the top line or top-two lines. And I think it should just say that point is not on a file line. Users who are interested or who wonder about the error message can consult the doc string of the command. That's the place, if any is needed, where such info as you mention should be conveyed. Such info is not part of the message we're trying to get across here, which is just that this command cannot be used if point is not on a file line. Dired lets you do all kinds of things. There are lots of ways top mark files and lots of ways to act on marked files. This command should not be advertising any such ways in its error message. > I agree with Drew that better to use existing functions, and not to > duplicate them. Non sunt multiplicanda entia sine necessitate. ;-) > Moreover, we should not change the old semantic of Dired commands: > if users have a habit of operating on the first files by going to the > top > line and typing e.g. =E2=80=98M-< C-5 M=E2=80=99 to change modes of the f= irst 5 files, > this is just fine, we should not prohobit this behaviour now. >=20 > So what we need to do is just check if the list of files returned from > =E2=80=98dired-get-marked-files=E2=80=99 is nil, and show some message in= this case in > all places that you found where the prompt with [0 files] makes no > sense. Yes. Just a simple fix for this minor usability bug, please. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 01 16:38:24 2018 Received: (at 30285) by debbugs.gnu.org; 1 Feb 2018 21:38:24 +0000 Received: from localhost ([127.0.0.1]:52862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehMYq-00017E-LM for submit@debbugs.gnu.org; Thu, 01 Feb 2018 16:38:24 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:50147 helo=homiemail-a20.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehMYp-000175-6D for 30285@debbugs.gnu.org; Thu, 01 Feb 2018 16:38:23 -0500 Received: from homiemail-a20.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTP id ACEDD7EC072; Thu, 1 Feb 2018 13:38:22 -0800 (PST) Received: from localhost.linkov.net (m91-129-107-8.cust.tele2.ee [91.129.107.8]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPSA id 29D247EC060; Thu, 1 Feb 2018 13:38:20 -0800 (PST) From: Juri Linkov To: Drew Adams Subject: Re: bug#30285: dired-do-chmod vs. top line of dired Organization: LINKOV.NET References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> <87k1vwcwy1.fsf@mail.linkov.net> <5620cf82-9402-4895-bdd1-fdf5401c8172@default> Date: Thu, 01 Feb 2018 23:35:50 +0200 In-Reply-To: <5620cf82-9402-4895-bdd1-fdf5401c8172@default> (Drew Adams's message of "Thu, 1 Feb 2018 12:50:16 -0800 (PST)") Message-ID: <871si475qh.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: Eli Zaretskii , 30285@debbugs.gnu.org, jidanni@jidanni.org, Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >> Since `dired-mark' from the top line followed by the command in questi= on >> is not obvious for users, we could provide a hint in the error message= , >> i.e. mention the availability of =E2=80=98m=E2=80=99 on the top line w= ith such message: >> =E2=80=9CYou can type `m' here to mark all files for this operation=E2= =80=9D. > > Not sure how helpful or necessary that is. It's liable to > not be helpful (that use case needs no special advertising). > And it might even confuse things. I think it just gets in > the way of the message, which is, "You are not on a file line." This message is absolutely wrong, it doesn't describe the state that caus= es the error message. It has a bigger scope than just file lines, it works with marked files, etc. So more correct message would be like this: =E2=80=9CNo files selected.=E2=80=9D Oh, and I discovered that the current state is much worse than I thought: 1. load dired-x 2. type =E2=80=98M-<=E2=80=99 to go to the first line 3. type =E2=80=98!=E2=80=99 (dired-do-shell-command) =E2=80=9CWrong type argument: stringp, nil=E2=80=9D From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 01 17:23:11 2018 Received: (at 30285) by debbugs.gnu.org; 1 Feb 2018 22:23:11 +0000 Received: from localhost ([127.0.0.1]:52898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehNGB-0002AY-DR for submit@debbugs.gnu.org; Thu, 01 Feb 2018 17:23:11 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:52136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehNG9-0002AK-7V for 30285@debbugs.gnu.org; Thu, 01 Feb 2018 17:23:09 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w11MLl8x172942; Thu, 1 Feb 2018 22:23:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=nl+ABqPHVkMbL9KQg3TtlUK9ht3rVrXc6hCgqQl79sU=; b=VcN3pfdj1dKCyWDdBDnbwL5rUkMC0k3ibZ0Ikq1NgMQqFVANKAxz3DBWYIQfpdkj2ljd hN/6YVdLFI51Yd0DnP1m9yhG5l1INR4CH3WTbAox6EoBMxhPBYVkrOBguxCJZS5noqzC enmTYGMnOZUW57hqqNuZUjr6avoEpyDRNjTAYJgFtl8TPv+KbxvTuhjgw5HEc7FUf4/r wx8JuSUAkg4UPn3vtUk53VV/mSYO8ci/dUYqC7aivwTsR/TV+0bpcINkQnqGg21dArlP QdmKyAm/G6+ZTBhftQQ7rH9SjroMF/ZI4c+k8a8pKE5TU/N0pVBrdP4j+W5TOcKceV2F aw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2fvaq0g7us-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Feb 2018 22:23:03 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w11MN2sK021655 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 1 Feb 2018 22:23:02 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w11MN1FF001918; Thu, 1 Feb 2018 22:23:01 GMT MIME-Version: 1.0 Message-ID: Date: Thu, 1 Feb 2018 14:23:00 -0800 (PST) From: Drew Adams To: Juri Linkov Subject: RE: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> <87k1vwcwy1.fsf@mail.linkov.net> <5620cf82-9402-4895-bdd1-fdf5401c8172@default> <871si475qh.fsf@mail.linkov.net> In-Reply-To: <871si475qh.fsf@mail.linkov.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4639.0 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8792 signatures=668660 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802010269 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: Eli Zaretskii , 30285@debbugs.gnu.org, jidanni@jidanni.org, Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > > Not sure how helpful or necessary that is. It's liable to > > not be helpful (that use case needs no special advertising). > > And it might even confuse things. I think it just gets in > > the way of the message, which is, "You are not on a file line." >=20 > This message is absolutely wrong, it doesn't describe the state that > causes the error message. It has a bigger scope than just file lines, > it works with marked files, etc. You're right about that. > So more correct message would be like this: >=20 > =E2=80=9CNo files selected.=E2=80=9D That's better, but it risks confusion over the notion of "selection", especially in the context of marking or using marks (a "selection" of files). This might be better: "No files specified" Or this: "No files chosen" > Oh, and I discovered that the current state is much worse than I > thought: >=20 > 1. load dired-x > 2. type =E2=80=98M-<=E2=80=99 to go to the first line > 3. type =E2=80=98!=E2=80=99 (dired-do-shell-command) >=20 > =E2=80=9CWrong type argument: stringp, nil=E2=80=9D Meme combat - same thing. The return value of `dired-get-marked-files' needs to be tested as soon as it's available. When it is nil we must not call `dired-read-shell-command' or do anything else - just raise a `user-error'. This is a general change that needs to be looked for and made wherever appropriate. From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 03 17:56:00 2018 Received: (at 30285) by debbugs.gnu.org; 3 Feb 2018 22:56:00 +0000 Received: from localhost ([127.0.0.1]:56080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ei6j1-0005Tb-S4 for submit@debbugs.gnu.org; Sat, 03 Feb 2018 17:56:00 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:57029 helo=homiemail-a20.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ei6iz-0005TS-Hx for 30285@debbugs.gnu.org; Sat, 03 Feb 2018 17:55:58 -0500 Received: from homiemail-a20.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTP id 9C9FE7EC063; Sat, 3 Feb 2018 14:55:56 -0800 (PST) Received: from localhost.linkov.net (m91-129-107-8.cust.tele2.ee [91.129.107.8]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPSA id B43E87EC060; Sat, 3 Feb 2018 14:55:54 -0800 (PST) From: Juri Linkov To: Drew Adams Subject: Re: bug#30285: dired-do-chmod vs. top line of dired Organization: LINKOV.NET References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> <87k1vwcwy1.fsf@mail.linkov.net> <5620cf82-9402-4895-bdd1-fdf5401c8172@default> <871si475qh.fsf@mail.linkov.net> Date: Sun, 04 Feb 2018 00:23:38 +0200 In-Reply-To: (Drew Adams's message of "Thu, 1 Feb 2018 14:23:00 -0800 (PST)") Message-ID: <87mv0pk7m5.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: Eli Zaretskii , 30285@debbugs.gnu.org, jidanni@jidanni.org, Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain > This might be better: "No files specified" > Or this: "No files chosen" > [...] > The return value of `dired-get-marked-files' needs to be tested as > soon as it's available. When it is nil we must not call > `dired-read-shell-command' or do anything else - just raise a > `user-error'. > > This is a general change that needs to be looked for and made > wherever appropriate. Agreed. Simplicity is the hallmark of Emacs. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=dired-get-marked-files-user-error.patch diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 55b68a3..f5caa2a 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -301,7 +301,8 @@ dired-do-chxxx ;; PROGRAM is the program used to change the attribute. ;; OP-SYMBOL is the type of operation (for use in `dired-mark-pop-up'). ;; ARG describes which files to use, as in `dired-get-marked-files'. - (let* ((files (dired-get-marked-files t arg)) + (let* ((files (or (dired-get-marked-files t arg) + (user-error "No files specified"))) ;; The source of default file attributes is the file at point. (default-file (dired-get-filename t t)) (default (when default-file @@ -361,7 +362,8 @@ dired-do-chmod Type M-n to pull the file attributes of the file at point into the minibuffer." (interactive "P") - (let* ((files (dired-get-marked-files t arg)) + (let* ((files (or (dired-get-marked-files t arg) + (user-error "No files specified"))) ;; The source of default file attributes is the file at point. (default-file (dired-get-filename t t)) (modestr (when default-file @@ -476,7 +478,8 @@ dired-do-print `lpr-switches' as default." (interactive "P") (require 'lpr) - (let* ((file-list (dired-get-marked-files t arg)) + (let* ((file-list (or (dired-get-marked-files t arg) + (user-error "No files specified"))) (lpr-switches (if (and (stringp printer-name) (string< "" printer-name)) @@ -666,7 +669,8 @@ dired-do-async-shell-command The output appears in the buffer `*Async Shell Command*'." (interactive - (let ((files (dired-get-marked-files t current-prefix-arg))) + (let ((files (or (dired-get-marked-files t current-prefix-arg) + (user-error "No files specified")))) (list ;; Want to give feedback whether this file or marked files are used: (dired-read-shell-command "& on %s: " current-prefix-arg files) @@ -727,7 +731,8 @@ dired-do-shell-command ;;Functions dired-run-shell-command and dired-shell-stuff-it do the ;;actual work and can be redefined for customization. (interactive - (let ((files (dired-get-marked-files t current-prefix-arg))) + (let ((files (or (dired-get-marked-files t current-prefix-arg) + (user-error "No files specified")))) (list ;; Want to give feedback whether this file or marked files are used: (dired-read-shell-command "! on %s: " current-prefix-arg files) @@ -1030,7 +1035,8 @@ dired-do-compress-to Choose the archiving command based on the archive file-name extension and `dired-compress-files-alist'." (interactive) - (let* ((in-files (dired-get-marked-files)) + (let* ((in-files (or (dired-get-marked-files) + (user-error "No files specified"))) (out-file (expand-file-name (read-file-name "Compress to: "))) (rule (cl-find-if (lambda (x) @@ -1153,7 +1159,8 @@ dired-mark-confirm ;; Pass t for DISTINGUISH-ONE-MARKED so that a single file which ;; is marked pops up a window. That will help the user see ;; it isn't the current line file. - (let ((files (dired-get-marked-files t arg nil t)) + (let ((files (or (dired-get-marked-files t arg nil t) + (user-error "No files specified"))) (string (if (eq op-symbol 'compress) "Compress or uncompress" (capitalize (symbol-name op-symbol))))) (dired-mark-pop-up nil op-symbol files #'y-or-n-p @@ -1845,7 +1852,8 @@ dired-do-create-files The rest of into-dir are optional arguments. For any other return value, TARGET is treated as a directory." (or op1 (setq op1 operation)) - (let* ((fn-list (dired-get-marked-files nil arg)) + (let* ((fn-list (or (dired-get-marked-files nil arg) + (user-error "No files specified"))) (rfn-list (mapcar #'dired-make-relative fn-list)) (dired-one-file ; fluid variable inside dired-create-files (and (consp fn-list) (null (cdr fn-list)) (car fn-list))) @@ -2799,14 +2807,16 @@ dired-do-isearch "Search for a string through all marked files using Isearch." (interactive) (multi-isearch-files - (dired-get-marked-files nil nil 'dired-nondirectory-p))) + (or (dired-get-marked-files nil nil 'dired-nondirectory-p) + (user-error "No files specified")))) ;;;###autoload (defun dired-do-isearch-regexp () "Search for a regexp through all marked files using Isearch." (interactive) (multi-isearch-files-regexp - (dired-get-marked-files nil nil 'dired-nondirectory-p))) + (or (dired-get-marked-files nil nil 'dired-nondirectory-p) + (user-error "No files specified")))) ;;;###autoload (defun dired-do-search (regexp) @@ -2827,7 +2837,8 @@ dired-do-query-replace-regexp (query-replace-read-args "Query replace regexp in marked files" t t))) (list (nth 0 common) (nth 1 common) (nth 2 common)))) - (dolist (file (dired-get-marked-files nil nil 'dired-nondirectory-p)) + (dolist (file (or (dired-get-marked-files nil nil 'dired-nondirectory-p) + (user-error "No files specified"))) (let ((buffer (get-file-buffer file))) (if (and buffer (with-current-buffer buffer buffer-read-only)) @@ -2851,7 +2862,8 @@ dired-do-find-regexp (require 'grep) (defvar grep-find-ignored-files) (defvar grep-find-ignored-directories) - (let* ((files (dired-get-marked-files)) + (let* ((files (or (dired-get-marked-files) + (user-error "No files specified"))) (ignores (nconc (mapcar (lambda (s) (concat s "/")) grep-find-ignored-directories) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index a90f1f4..1beeafe 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -1335,7 +1335,9 @@ dired-do-find-marked-files To keep Dired buffer displayed, type \\[split-window-below] first. To display just marked files, type \\[delete-other-windows] first." (interactive "P") - (dired-simultaneous-find-file (dired-get-marked-files) noselect)) + (dired-simultaneous-find-file (or (dired-get-marked-files) + (user-error "No files specified")) + noselect)) (defun dired-simultaneous-find-file (file-list noselect) "Visit all files in FILE-LIST and display them simultaneously. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 04 05:02:39 2018 Received: (at 30285) by debbugs.gnu.org; 4 Feb 2018 10:02:39 +0000 Received: from localhost ([127.0.0.1]:56208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiH8B-0005wL-89 for submit@debbugs.gnu.org; Sun, 04 Feb 2018 05:02:39 -0500 Received: from mout.gmx.net ([212.227.17.22]:61815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiH89-0005w9-UO for 30285@debbugs.gnu.org; Sun, 04 Feb 2018 05:02:38 -0500 Received: from [192.168.1.100] ([212.95.5.118]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lpxdr-1fBY0Q0oFj-00fkwR; Sun, 04 Feb 2018 11:02:21 +0100 Message-ID: <5A76DA29.8030305@gmx.at> Date: Sun, 04 Feb 2018 11:02:17 +0100 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov , Drew Adams Subject: Re: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> <87k1vwcwy1.fsf@mail.linkov.net> <5620cf82-9402-4895-bdd1-fdf5401c8172@default> <871si475qh.fsf@mail.linkov.net> <87mv0pk7m5.fsf@mail.linkov.net> In-Reply-To: <87mv0pk7m5.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:xyL2szgXNaQ/WTJSZKVkTPm/6TpjgncTWGmzVsQzJEl6OTxvoY2 tYPgn6CybvUvPPiaNiambuc6CSimnuV4C4i0JSAHY/A5ZUyuf1C4lkx0bpVfA6nGF8YzxTW 5qXxUfNLnHAaX9pmdATcQMuKJv6Kk07jSy9d2psG19Svtz01/qRL+Hk63LAswx4PHgsHrkM KLbS9kB7sJRhxxyXMoBGg== X-UI-Out-Filterresults: notjunk:1;V01:K0:d7g65XteAfE=:8vkb2x9QEQfeaZfKOgOtd6 PtvP26rxM25d1ysrNyzHLDCk0CdoXTRzB5tRwGipgN+KkPRstBVBQHSz+NGrjrV1rXY8o3t+O +TsTZQN5jaJDJHjwTQDvmGgD7WMTk6yqaCKF/LxsmqwtAB/eN1qwlLDoMakvKrbiheGUMZDwu oPTYJIP9Lew63p5FlCLXbMV/H+Y1bqN3kC0oTFVgACpzgmEpKZVEnaYgwjf8ypnnXjbgUBIew wxUm3oBqp2w9ufWNq7iWa3n+CGobctmeciycYHCuvjvpU57gg4nj+DDes2GQ15YqG51J/B3al LBvvOMmOgE0aUZaMO5jeo6QIgT7MEXNiwKkKOgX3F3sER9Ek7IGupg//BLpjbpfSqvYMF3wOf 8dX5C+BAKPN9h4fWbQyNHUM+nnS2PsnVOI59fMCpa1EriV5x0QRQgjOVbUuIFyY1og0+9a7in b8PKm85mmohpfOTBweTaAI++QG7UkrtRJWmraCgx/BfiPLmIK71LJKPtNCv5xeBwiUHz2MbrJ BKPuzaLAXtPyUqMySMz7LocjAd4EaFi66k/3xPUB3MFWfzovSaantliSJMKUJoANdK9IRKucR ivfQIK/YAogZBa0o1lxg7popDLWQPUMyWlUPlsDi+ngZLb15fQpt8fUZJc51ebKRutoQDKB2p f9a/Pl+/2svhToC7aGUinA8ig4OVe5NQEEK4p52GRW94J+ENQdcYGKUAgob/lymyaF3CT2Axu Mz0angAOGZk3L1RY/A9UFKtWsRgE+zNPLtjeJi8/F5FllhAzazYhpOzlATzlwPyxAiGJVdkMx Ra80D/a3P1wx0goGQF8yLdpj3dmqVBYsaZe5waO7dmJYoM+DdXQswvpEkCGpgpxCsk1A/HT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 30285 Cc: 30285@debbugs.gnu.org, jidanni@jidanni.org, Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) > Agreed. Simplicity is the hallmark of Emacs. Wouldn't this - (let* ((files (dired-get-marked-files t arg)) + (let* ((files (or (dired-get-marked-files t arg) + (user-error "No files specified"))) call for an extra argument to 'dired-get-marked-files' to emit the user error right there? If it's TRT in your cases, it might give coders a heads-up that it's TRT in their cases as well. martin From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 04 17:00:10 2018 Received: (at 30285) by debbugs.gnu.org; 4 Feb 2018 22:00:10 +0000 Received: from localhost ([127.0.0.1]:57428 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiSKY-00034y-EN for submit@debbugs.gnu.org; Sun, 04 Feb 2018 17:00:10 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:35066 helo=homiemail-a20.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiSKW-00034q-PL for 30285@debbugs.gnu.org; Sun, 04 Feb 2018 17:00:09 -0500 Received: from homiemail-a20.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTP id CB9797EC064; Sun, 4 Feb 2018 14:00:07 -0800 (PST) Received: from localhost.linkov.net (m91-129-107-8.cust.tele2.ee [91.129.107.8]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPSA id E9C417EC060; Sun, 4 Feb 2018 14:00:05 -0800 (PST) From: Juri Linkov To: martin rudalics Subject: Re: bug#30285: dired-do-chmod vs. top line of dired Organization: LINKOV.NET References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> <87k1vwcwy1.fsf@mail.linkov.net> <5620cf82-9402-4895-bdd1-fdf5401c8172@default> <871si475qh.fsf@mail.linkov.net> <87mv0pk7m5.fsf@mail.linkov.net> <5A76DA29.8030305@gmx.at> Date: Sun, 04 Feb 2018 23:44:09 +0200 In-Reply-To: <5A76DA29.8030305@gmx.at> (martin rudalics's message of "Sun, 04 Feb 2018 11:02:17 +0100") Message-ID: <874lmwtpmu.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: jidanni@jidanni.org, 30285@debbugs.gnu.org, Drew Adams , Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain >> Agreed. Simplicity is the hallmark of Emacs. > > Wouldn't this > > - (let* ((files (dired-get-marked-files t arg)) > + (let* ((files (or (dired-get-marked-files t arg) > + (user-error "No files specified"))) > > call for an extra argument to 'dired-get-marked-files' to emit the > user error right there? If it's TRT in your cases, it might give > coders a heads-up that it's TRT in their cases as well. Usually we have an arg NOERROR to not signal an error when it's non-nil. But since we should keep backward-compatibility, the arg should be opt-in rather than opt-out here: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=dired-get-marked-files-user-error.2.patch diff --git a/lisp/dired.el b/lisp/dired.el index eade11b..ef069d2 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -645,7 +645,7 @@ dired-map-over-marks ;; save-excursion loses, again (dired-move-to-filename))) -(defun dired-get-marked-files (&optional localp arg filter distinguish-one-marked) +(defun dired-get-marked-files (&optional localp arg filter distinguish-one-marked error) "Return the marked files' names as list of strings. The list is in the same order as the buffer, that is, the car is the first marked file. @@ -662,7 +662,10 @@ dired-get-marked-files If DISTINGUISH-ONE-MARKED is non-nil, then if we find just one marked file, return (t FILENAME) instead of (FILENAME). -Don't use that together with FILTER." +Don't use that together with FILTER. + +If ERROR is non-nil, signal an error when the list of found files is empty. +ERROR can be a string with the error message." (let ((all-of-them (save-excursion (delq nil (dired-map-over-marks @@ -672,13 +675,17 @@ dired-get-marked-files (when (equal all-of-them '(t)) (setq all-of-them nil)) (if (not filter) - (if (and distinguish-one-marked (eq (car all-of-them) t)) - all-of-them - (nreverse all-of-them)) + (setq result + (if (and distinguish-one-marked (eq (car all-of-them) t)) + all-of-them + (nreverse all-of-them))) (dolist (file all-of-them) (if (funcall filter file) - (push file result))) - result))) + (push file result)))) + (when (and (null result) error) + (user-error (if (stringp error) error "No files specified"))) + result)) + ;; The dired command diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 55b68a3..6e3e336 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -301,7 +301,7 @@ dired-do-chxxx ;; PROGRAM is the program used to change the attribute. ;; OP-SYMBOL is the type of operation (for use in `dired-mark-pop-up'). ;; ARG describes which files to use, as in `dired-get-marked-files'. - (let* ((files (dired-get-marked-files t arg)) + (let* ((files (dired-get-marked-files t arg nil nil t)) ;; The source of default file attributes is the file at point. (default-file (dired-get-filename t t)) (default (when default-file @@ -361,7 +361,7 @@ dired-do-chmod Type M-n to pull the file attributes of the file at point into the minibuffer." (interactive "P") - (let* ((files (dired-get-marked-files t arg)) + (let* ((files (dired-get-marked-files t arg nil nil t)) ;; The source of default file attributes is the file at point. (default-file (dired-get-filename t t)) (modestr (when default-file @@ -476,7 +476,7 @@ dired-do-print `lpr-switches' as default." (interactive "P") (require 'lpr) - (let* ((file-list (dired-get-marked-files t arg)) + (let* ((file-list (dired-get-marked-files t arg nil nil t)) (lpr-switches (if (and (stringp printer-name) (string< "" printer-name)) @@ -666,7 +666,7 @@ dired-do-async-shell-command The output appears in the buffer `*Async Shell Command*'." (interactive - (let ((files (dired-get-marked-files t current-prefix-arg))) + (let ((files (dired-get-marked-files t current-prefix-arg nil nil t))) (list ;; Want to give feedback whether this file or marked files are used: (dired-read-shell-command "& on %s: " current-prefix-arg files) @@ -727,7 +727,7 @@ dired-do-shell-command ;;Functions dired-run-shell-command and dired-shell-stuff-it do the ;;actual work and can be redefined for customization. (interactive - (let ((files (dired-get-marked-files t current-prefix-arg))) + (let ((files (dired-get-marked-files t current-prefix-arg nil nil t))) (list ;; Want to give feedback whether this file or marked files are used: (dired-read-shell-command "! on %s: " current-prefix-arg files) @@ -1030,7 +1030,7 @@ dired-do-compress-to Choose the archiving command based on the archive file-name extension and `dired-compress-files-alist'." (interactive) - (let* ((in-files (dired-get-marked-files)) + (let* ((in-files (dired-get-marked-files nil nil nil nil t)) (out-file (expand-file-name (read-file-name "Compress to: "))) (rule (cl-find-if (lambda (x) @@ -1153,7 +1153,7 @@ dired-mark-confirm ;; Pass t for DISTINGUISH-ONE-MARKED so that a single file which ;; is marked pops up a window. That will help the user see ;; it isn't the current line file. - (let ((files (dired-get-marked-files t arg nil t)) + (let ((files (dired-get-marked-files t arg nil t t)) (string (if (eq op-symbol 'compress) "Compress or uncompress" (capitalize (symbol-name op-symbol))))) (dired-mark-pop-up nil op-symbol files #'y-or-n-p @@ -1845,7 +1845,7 @@ dired-do-create-files The rest of into-dir are optional arguments. For any other return value, TARGET is treated as a directory." (or op1 (setq op1 operation)) - (let* ((fn-list (dired-get-marked-files nil arg)) + (let* ((fn-list (dired-get-marked-files nil arg nil nil t)) (rfn-list (mapcar #'dired-make-relative fn-list)) (dired-one-file ; fluid variable inside dired-create-files (and (consp fn-list) (null (cdr fn-list)) (car fn-list))) @@ -2799,14 +2799,14 @@ dired-do-isearch "Search for a string through all marked files using Isearch." (interactive) (multi-isearch-files - (dired-get-marked-files nil nil 'dired-nondirectory-p))) + (dired-get-marked-files nil nil 'dired-nondirectory-p nil t))) ;;;###autoload (defun dired-do-isearch-regexp () "Search for a regexp through all marked files using Isearch." (interactive) (multi-isearch-files-regexp - (dired-get-marked-files nil nil 'dired-nondirectory-p))) + (dired-get-marked-files nil nil 'dired-nondirectory-p nil t))) ;;;###autoload (defun dired-do-search (regexp) @@ -2827,7 +2827,7 @@ dired-do-query-replace-regexp (query-replace-read-args "Query replace regexp in marked files" t t))) (list (nth 0 common) (nth 1 common) (nth 2 common)))) - (dolist (file (dired-get-marked-files nil nil 'dired-nondirectory-p)) + (dolist (file (dired-get-marked-files nil nil 'dired-nondirectory-p nil t)) (let ((buffer (get-file-buffer file))) (if (and buffer (with-current-buffer buffer buffer-read-only)) @@ -2851,7 +2851,7 @@ dired-do-find-regexp (require 'grep) (defvar grep-find-ignored-files) (defvar grep-find-ignored-directories) - (let* ((files (dired-get-marked-files)) + (let* ((files (dired-get-marked-files nil nil nil nil t)) (ignores (nconc (mapcar (lambda (s) (concat s "/")) grep-find-ignored-directories) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index a90f1f4..fa36083 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -1335,7 +1335,8 @@ dired-do-find-marked-files To keep Dired buffer displayed, type \\[split-window-below] first. To display just marked files, type \\[delete-other-windows] first." (interactive "P") - (dired-simultaneous-find-file (dired-get-marked-files) noselect)) + (dired-simultaneous-find-file (dired-get-marked-files nil nil nil nil t) + noselect)) (defun dired-simultaneous-find-file (file-list noselect) "Visit all files in FILE-LIST and display them simultaneously. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 04 18:08:30 2018 Received: (at 30285) by debbugs.gnu.org; 4 Feb 2018 23:08:30 +0000 Received: from localhost ([127.0.0.1]:57475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiTOg-0006Yt-IW for submit@debbugs.gnu.org; Sun, 04 Feb 2018 18:08:30 -0500 Received: from mail-pg0-f52.google.com ([74.125.83.52]:33641) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiTOf-0006Yc-7O for 30285@debbugs.gnu.org; Sun, 04 Feb 2018 18:08:29 -0500 Received: by mail-pg0-f52.google.com with SMTP id u1so16891554pgr.0 for <30285@debbugs.gnu.org>; Sun, 04 Feb 2018 15:08:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=acuhZPUNDB4u7y38u+nnsu4T13wF5k+PsE7828RD9jY=; b=r5OfsbXrxTRk4bKugYSNukgk2UZgwkYvVUnZdsYXej3yMvvTUEqfnz5Bckh6sGHp5F C+dhsVCMCh1pMSMGtQMIHko7OWyzYIf+XJUkR4Kj0JXAhXfOR/2cRAXltRvPlg7cAviZ OWEyFNaB+aQ2sKJY+qQSYIs7z+IH1MDqiKTu0YzpnAiwsryyjdrvim5UpC+bmsmh1r5Z HdopY+ahhqxxGHlRDyOHxEqyx0uS6FS91/BWkb0aWxQOpAc6x8uYMNXuac3wRmsuBaVJ wWbz3VfX7QnIWI+GZK06E6HGUuM9GsSggjwDL/FdTrNylUp/ztQbIC7EE3E26Ha1jmpS Q0OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=acuhZPUNDB4u7y38u+nnsu4T13wF5k+PsE7828RD9jY=; b=V0X34PATcEzdTUJ1kaj91zbvJxh7tzL9A0GiYb4HFsIoZX3xsKsgmV/abEuSI9JYEg rLUzAeoYSl2vaKFNWb3aHpKuo8g94b6G1aDCoRwbKxvnxweEzcboLzZj761YD4XehuUl XtpgOOvdIFvwtp+esZ33SJTEqzhu4FduQG5IIyiDFpyEJD3XD9351uWIR7UXQuTM3r1D AJbkYp1h1YIN/Aw69VuLR6EI89iQnWzjZQ+O83fWOxcIAjY65EUtdZ2rN4Ix8POCeHW7 G/cH57idLsKMGAPoFNjoNJfCJRhjWVBQAOmTVaPfVlirWS59ZhM03EdHGKPwegS19HeI idxA== X-Gm-Message-State: AKwxytfveS1Lp3OjVfC+OybwFXk0UxKwo4xwc+qCxwRAEB8969oqSDBk CPQywKA1t7vTldtsapfP3ng= X-Google-Smtp-Source: AH8x226Ohq/Yhhx2MkiXI7BKV7ELB5aMpP2il4cwZbzIZNJxwXFEH29ewZhhHEOYA92sYHqJTdd+NQ== X-Received: by 10.101.91.140 with SMTP id i12mr35605783pgr.297.1517785703540; Sun, 04 Feb 2018 15:08:23 -0800 (PST) Received: from calancha-pc (FL1-125-193-170-29.tky.mesh.ad.jp. [125.193.170.29]) by smtp.gmail.com with ESMTPSA id j23sm13822604pfj.42.2018.02.04.15.08.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Feb 2018 15:08:22 -0800 (PST) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Mon, 5 Feb 2018 08:08:19 +0900 (JST) X-X-Sender: calancha@calancha-pc To: Juri Linkov Subject: Re: bug#30285: dired-do-chmod vs. top line of dired In-Reply-To: <871si475qh.fsf@mail.linkov.net> Message-ID: References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> <87k1vwcwy1.fsf@mail.linkov.net> <5620cf82-9402-4895-bdd1-fdf5401c8172@default> <871si475qh.fsf@mail.linkov.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-435734874-1517785702=:18633" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: jidanni@jidanni.org, Eli Zaretskii , 30285@debbugs.gnu.org, Drew Adams , Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --8323329-435734874-1517785702=:18633 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Thu, 1 Feb 2018, Juri Linkov wrote: > Oh, and I discovered that the current state is much worse than I thought: > > 1. load dired-x > 2. type ‘M-<’ to go to the first line > 3. type ‘!’ (dired-do-shell-command) > > “Wrong type argument: stringp, nil” Is it too much ask you to read my commit messages in case you dont have time/motivation to test my patches? Then, you dont need to rediscover things already reported by others. Thanks. Some people say here they dont have time to tes my patches (even to read my commit messages), but at the same time they write the Bible in their emails (by the way, not refering to you now). I do sleep 3 hours every day, more busy that all of you together and I still tested your patch and read (entirely) others emails. PD: By the way, I have tested your patch, and it looks good to me. It fixes the issue in a quite simple way. --8323329-435734874-1517785702=:18633-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 04 18:12:23 2018 Received: (at 30285) by debbugs.gnu.org; 4 Feb 2018 23:12:23 +0000 Received: from localhost ([127.0.0.1]:57479 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiTSR-0006eK-2i for submit@debbugs.gnu.org; Sun, 04 Feb 2018 18:12:23 -0500 Received: from mail-pg0-f54.google.com ([74.125.83.54]:42201) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiTSO-0006e1-RG for 30285@debbugs.gnu.org; Sun, 04 Feb 2018 18:12:21 -0500 Received: by mail-pg0-f54.google.com with SMTP id m28so368387pgc.9 for <30285@debbugs.gnu.org>; Sun, 04 Feb 2018 15:12:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=loxXO8Kog+dmbKrjeafv2Dt+rgY5EyO21MpoLJXMiy4=; b=TRLERhFO6fnKrKB+UwbT0cSb7yWTGFO9ax+z6o73uFbixFo6gpLlw91pbMONtowrfC 4dmJ8ZJZFXSN0kxJWVSXoLVAG0RYYRr6PE9Bg7euDR0PVYDrqC+5XwParHYNdEeKCAPf WxpKtcsSCTDQ6QXZlVDZDZr710ULP90qf1H2FH/pRbDb69Mztrse4X3ks7MjpGGgNYqG mCtnu8kl91i0K5tmA6pJVJMfxv5qv9pWMJjCemYXbl1RnfKjBiE9WQZTbGhE9ioo5nwk VQ11LzznUYfaYkAK1mMuWKQl0bPV0iPPl1NiMi9EXypsX96gLkBzirrigTttFVzrpiTU cWfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=loxXO8Kog+dmbKrjeafv2Dt+rgY5EyO21MpoLJXMiy4=; b=qN7FZq1MaKDXoc5i9DQXN8neWaPFUDaZvtbTQZRIKTCgTad32Jk9X+oHvM95hIlPV+ WLJDxQnNKih2JzaKQdoULHzGS+9hzz9H5QRCzLpV1WHkNl0aThqf+5bQpcBQtozufP5K A3KdrvasgjK3mHystFZKjQkWcBX+BGnqmmPz8Q9OV64hxJO/1SvEQgYpPtJztyYLUORs ol8IWF3MrvLRBU0+ziT91xvyNMeIurOC7YE74n5310DQoZ9jZgSx9WYW8XvpxOodzQuu 7AeZIIxQW9r3ukPGuEH6LEwsjpGkMSMUvnbAQ4OhJz9RoIntMYNBq2yDjpRjn8r7PvUd MSdg== X-Gm-Message-State: APf1xPB92CFZ3wVQEAHn7YA0KHhd19PKC74JONZB0i6WNqhH3BkDosZ1 9jyH7ckqzupgiJZXuLVG+Nc= X-Google-Smtp-Source: AH8x227u3cvs9+4pe/o0+hzUKUs/nc84XkGYJhZ0KURnBrNkSIpK3+SefM0kr/HUcIlr7EsgdbOVNg== X-Received: by 10.99.116.22 with SMTP id p22mr4280376pgc.89.1517785935412; Sun, 04 Feb 2018 15:12:15 -0800 (PST) Received: from calancha-pc (FL1-125-193-170-29.tky.mesh.ad.jp. [125.193.170.29]) by smtp.gmail.com with ESMTPSA id l188sm11609085pgl.72.2018.02.04.15.12.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Feb 2018 15:12:14 -0800 (PST) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Mon, 5 Feb 2018 08:12:11 +0900 (JST) X-X-Sender: calancha@calancha-pc To: Drew Adams Subject: RE: bug#30285: dired-do-chmod vs. top line of dired In-Reply-To: Message-ID: References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: Eli Zaretskii , Juri Linkov , 30285@debbugs.gnu.org, jidanni@jidanni.org, Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Thu, 1 Feb 2018, Drew Adams wrote: >> I would like all `dired-do...' commands behave the same under the >> 'X condition': * called from the top line ** no marked files. > > I've already said that it's not only about the top line. > It's about the ordinary Dired situation of not being on a > file line. Plenty of Dired code already deals (simply) > with this "X condition". Sorry for the confussion: I thought it was prety obvious that 'X condition' was akind of summary of what the patch was doing. It would be as easy as to read my commit message to realize that; or take a quick look in the diff I provided (dont need even to test it). Then, you would be talking about my work, not about what you guess it is my work. For the future, please try to at least read my commit messages before make lot of observations about one patch that you didn't even read at all. Thanks! :-) From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 05 11:45:33 2018 Received: (at 30285) by debbugs.gnu.org; 5 Feb 2018 16:45:33 +0000 Received: from localhost ([127.0.0.1]:58953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eijtd-0005t8-8x for submit@debbugs.gnu.org; Mon, 05 Feb 2018 11:45:33 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:53986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eijtc-0005sw-6y for 30285@debbugs.gnu.org; Mon, 05 Feb 2018 11:45:32 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w15Gfh3o153518; Mon, 5 Feb 2018 16:45:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=FemFA6Yc+i3UeE31uMGmScF7y5KAphYUs18qDcBTwUE=; b=HlwQ282sdhzWAlXAHSyQBDuaCdyaB304ONEAlk4N4WoRUsi/rN+sZX8eYg/E+HijyJGY xU5niNj0JGjE562GtcmDa2huoGB5SakActSatzR4/1YIGUWVAy3Ewe1A5Uuk+6UnMJXO s+KTKY83kfY/OBsBr2s+/Ej5w5Yo+SxUuhiG1iFXRdxAYqAdnUj8oBRLTyKu6Ife9dCK b/mOZZEqxyX4QsQPLm0nyxx04FD2QYdsV63/mJkWBEXYRBPGb/YymrlRRBc+VN2VrpYc nD61rpli8GGwU5oaA7ZkvPmDuImjOv3L08qz818ApR7wB+313EMy0n30LP8owTZqlaUK Cg== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2fxt490e78-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Feb 2018 16:45:25 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w15GjNec001039 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 5 Feb 2018 16:45:24 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w15GjMJS030531; Mon, 5 Feb 2018 16:45:22 GMT MIME-Version: 1.0 Message-ID: <62b07a53-d019-4909-9d67-b8ce211b2150@default> Date: Mon, 5 Feb 2018 08:45:21 -0800 (PST) From: Drew Adams To: Tino Calancha Subject: RE: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4639.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8796 signatures=668662 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802050210 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: Eli Zaretskii , 30285@debbugs.gnu.org, jidanni@jidanni.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > >> I would like all `dired-do...' commands behave the same under the > >> 'X condition': * called from the top line ** no marked files. > > > > I've already said that it's not only about the top line. > > It's about the ordinary Dired situation of not being on a > > file line. Plenty of Dired code already deals (simply) > > with this "X condition". > > Sorry for the confussion: I thought it was prety obvious > that 'X condition' was akind of summary of what the patch > was doing. I don't think there was any confusion there. It was clear what you meant by "X condition". You said it meant: "* called from the top line [and] ** no marked files" My point was that Dired code already deals, in various places, with the condition of not being on a file line and no files being marked. That condition is easy to deal with. And I think that's the only problem that this bug report needs to fix - in the case of the commands, like `dired-do-chmod', that don't yet deal with it. > It would be as easy as to read my commit message to realize that; or > take > a quick look in the diff I provided (dont need even to test it). Then, > you would be talking about my work, not about what you guess it > is my work. For the future, please try to at least read my commit > messages before make lot of observations about one patch that you didn't > even read at all. Thanks! :-) I guess you are angry or frustrated. Sorry if I caused that. I had already said, a day or two earlier in reply to your request that I provide an alternative patch, that I'm OK with whatever you decide. I offered suggestions about this bug, and I made clear that it's up to you and I wouldn't be getting into the implementation details: > May I ask you to provide an alternative patch to compare > with mine? Then, people here might do further feedback > based on those 2 alternatives. Sorry; I don't have time to work on this. I've already provided my suggestions - hope they help. Whatever you decide is fine by me. Thx. I consider this bug to be trivial, and I hope for a simple fix that doesn't complicate Dired generally. But whatever fix you provide is OK by me. Sorry if my suggestions made you feel like I was discounting your efforts. I too have already spent more time on this bug than I can afford to. Please fix this bug as you see best. And thanks for your work on Dired and other Emacs features. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 05 16:35:47 2018 Received: (at 30285) by debbugs.gnu.org; 5 Feb 2018 21:35:47 +0000 Received: from localhost ([127.0.0.1]:59097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eioQU-0006QL-Th for submit@debbugs.gnu.org; Mon, 05 Feb 2018 16:35:47 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:42273 helo=homiemail-a20.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eioQT-0006QD-Df for 30285@debbugs.gnu.org; Mon, 05 Feb 2018 16:35:45 -0500 Received: from homiemail-a20.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTP id 34BBB7EC064; Mon, 5 Feb 2018 13:35:44 -0800 (PST) Received: from localhost.linkov.net (m91-129-107-8.cust.tele2.ee [91.129.107.8]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPSA id B3A487EC063; Mon, 5 Feb 2018 13:35:42 -0800 (PST) From: Juri Linkov To: Tino Calancha Subject: Re: bug#30285: dired-do-chmod vs. top line of dired Organization: LINKOV.NET References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> <87k1vwcwy1.fsf@mail.linkov.net> <5620cf82-9402-4895-bdd1-fdf5401c8172@default> <871si475qh.fsf@mail.linkov.net> Date: Mon, 05 Feb 2018 23:01:04 +0200 In-Reply-To: (Tino Calancha's message of "Mon, 5 Feb 2018 08:08:19 +0900 (JST)") Message-ID: <87tvuvwvzb.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: Eli Zaretskii , 30285@debbugs.gnu.org, Drew Adams , jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) >> Oh, and I discovered that the current state is much worse than I thoug= ht: >> >> 1. load dired-x >> 2. type =E2=80=98M-<=E2=80=99 to go to the first line >> 3. type =E2=80=98!=E2=80=99 (dired-do-shell-command) >> >> =E2=80=9CWrong type argument: stringp, nil=E2=80=9D > Is it too much ask you to read my commit messages in case you dont > have time/motivation to test my patches? Then, you dont need to > rediscover things already reported by others. Thanks. Where did you get the idea that I don't read your patches? This is not true. Now I re-read again your previous emails, and see nowhere a mention of the error =E2=80=9CWrong type argument: stringp, nil=E2=80=9D= . This is what I pointed out that unlike a useless message =E2=80=9C[0 file= s]=E2=80=9D discussed before, the current code is actually worse because it contains a plain bug. > Some people say here they dont have time to tes my patches (even > to read my commit messages), but at the same time they write > the Bible in their emails (by the way, not refering to you now). I'm always trying to write my emails as concise as possible to save time of people who will read it. > I do sleep 3 hours every day, more busy that all of you together > and I still tested your patch and read (entirely) others emails. I really appreciate all fresh ideas that you bring into development, and your tireless efforts to implement them. Thanks for all your contributio= ns! From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 05 16:57:43 2018 Received: (at 30285) by debbugs.gnu.org; 5 Feb 2018 21:57:43 +0000 Received: from localhost ([127.0.0.1]:59128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eioli-0006w0-Ov for submit@debbugs.gnu.org; Mon, 05 Feb 2018 16:57:42 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:60782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiolg-0006vl-JN for 30285@debbugs.gnu.org; Mon, 05 Feb 2018 16:57:41 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w15Luw7d089109; Mon, 5 Feb 2018 21:57:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=ciyuSSHeUwyjzLOnGTp06xFxSxIb+sliOYg11iugUF0=; b=GgHu1J8neuNWTcRmv4BnezIgGsmx8rsrgq/0rtNJgAKV64cNBSdEcYYANGWSE+0No9aX GZ8McesfXkrePcUXrUWSzzbe9AHfYRV47s2hYZwg7Knw4gBR5uQcOec97TWaR3P4i8Rw dNsbKsxiULqVvbYfd2S1Z1+kfs4tNSP0DrtKuXGDwh4MTrTOO79QTYLPkIxY+GkRC9SA rVMAfSXM8s6ECz3nUSZYk3sgaxFphPXmvVUehMqSDdNdQ4ImDE4BJ32Qx+uWBSArZIsM ndhTbiTNLJtmQNia6KIwP0uU3kZDrpEyuhaeyeBVYOQX+ZQNw4v0v1NtBrftGiYJv6Qc 3w== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2fxyhqg1we-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 05 Feb 2018 21:57:34 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w15LqVZx021157 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 5 Feb 2018 21:52:31 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w15LqT53002628; Mon, 5 Feb 2018 21:52:29 GMT MIME-Version: 1.0 Message-ID: <9de0a90c-c99d-4fc7-9cfa-f1dbe336c801@default> Date: Mon, 5 Feb 2018 13:52:27 -0800 (PST) From: Drew Adams To: Juri Linkov , Tino Calancha Subject: RE: bug#30285: dired-do-chmod vs. top line of dired References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> <87k1vwcwy1.fsf@mail.linkov.net> <5620cf82-9402-4895-bdd1-fdf5401c8172@default> <871si475qh.fsf@mail.linkov.net> <87tvuvwvzb.fsf@mail.linkov.net> In-Reply-To: <87tvuvwvzb.fsf@mail.linkov.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4639.0 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8796 signatures=668662 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802050270 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285 Cc: Eli Zaretskii , 30285@debbugs.gnu.org, jidanni@jidanni.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > > Is it too much ask you to read my commit messages in case you dont > > have time/motivation to test my patches? Then, you dont need to > > rediscover things already reported by others. Thanks. >=20 > Where did you get the idea that I don't read your patches? This is > not true. =20 I'm guessing that Tino replied to you after getting angry by my message saying that I didn't have time to read his patch etc. I imagine his frustration was not really directed at you. If so, that's understandable, even if you might not have deserved it. Just a guess. > I really appreciate all fresh ideas that you bring into development, and > your tireless efforts to implement them. Thanks for all your > contributions! Ditto - for both of you, in fact. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 06 16:32:46 2018 Received: (at 30285-done) by debbugs.gnu.org; 6 Feb 2018 21:32:46 +0000 Received: from localhost ([127.0.0.1]:60637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejAr8-0004sq-7w for submit@debbugs.gnu.org; Tue, 06 Feb 2018 16:32:46 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:35458 helo=homiemail-a20.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejAr6-0004sj-TH for 30285-done@debbugs.gnu.org; Tue, 06 Feb 2018 16:32:45 -0500 Received: from homiemail-a20.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTP id 3987D7EC078; Tue, 6 Feb 2018 13:32:44 -0800 (PST) Received: from localhost.linkov.net (m91-129-107-8.cust.tele2.ee [91.129.107.8]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPSA id B82217EC076; Tue, 6 Feb 2018 13:32:42 -0800 (PST) From: Juri Linkov To: martin rudalics Subject: Re: bug#30285: dired-do-chmod vs. top line of dired Organization: LINKOV.NET References: <87mv0wg80c.fsf@jidanni.org> <87efm8snnr.fsf@gmail.com> <83efm8irac.fsf@gnu.org> <87d11sl08v.fsf@gmail.com> <87fu6lwxxu.fsf@mail.linkov.net> <87k1vwcwy1.fsf@mail.linkov.net> <5620cf82-9402-4895-bdd1-fdf5401c8172@default> <871si475qh.fsf@mail.linkov.net> <87mv0pk7m5.fsf@mail.linkov.net> <5A76DA29.8030305@gmx.at> Date: Tue, 06 Feb 2018 23:32:21 +0200 In-Reply-To: <5A76DA29.8030305@gmx.at> (martin rudalics's message of "Sun, 04 Feb 2018 11:02:17 +0100") Message-ID: <87wozpx0re.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30285-done Cc: jidanni@jidanni.org, 30285-done@debbugs.gnu.org, Drew Adams , Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > Wouldn't this > > - (let* ((files (dired-get-marked-files t arg)) > + (let* ((files (or (dired-get-marked-files t arg) > + (user-error "No files specified"))) > > call for an extra argument to 'dired-get-marked-files' to emit the > user error right there? If it's TRT in your cases, it might give > coders a heads-up that it's TRT in their cases as well. This is now pushed to master and closed. From unknown Tue Aug 19 21:02:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 07 Mar 2018 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator