From unknown Sun Jun 22 17:13:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#32892: 27.0.50; End predicate `dired-in-this-tree' with '-p' Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Oct 2018 11:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 32892 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 32892@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15383922007402 (code B ref -1); Mon, 01 Oct 2018 11:10:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Oct 2018 11:10:00 +0000 Received: from localhost ([127.0.0.1]:60765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6w5Q-0001vK-BH for submit@debbugs.gnu.org; Mon, 01 Oct 2018 07:10:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6w5N-0001v3-NY for submit@debbugs.gnu.org; Mon, 01 Oct 2018 07:09:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6w5H-0003qH-KA for submit@debbugs.gnu.org; Mon, 01 Oct 2018 07:09:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43365) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g6w5H-0003q8-Er for submit@debbugs.gnu.org; Mon, 01 Oct 2018 07:09:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6w5G-0006kU-A6 for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 07:09:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6w5F-0003mm-2i for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 07:09:50 -0400 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]:37883) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6w5E-0003mV-T5 for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2018 07:09:49 -0400 Received: by mail-oi1-x235.google.com with SMTP id e17-v6so9922604oib.4 for ; Mon, 01 Oct 2018 04:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=7Thz55IKoEmWh6YyaOnveCjOjYeqAzFOFagdwg20a4A=; b=smJaZbC4CMbIyQN4GsT11YpLFrZhjrJyDYTtQ7nN8hJAW/ZulV1edUsborOFQc7UGq kA6uF05754YYzukL2VFT1oxkWQ0zLwC+14QuUH1ZbQZOgS46q0KyubZ6C/DeiQ9HW/TL zsRTPKWNjaCfvWs41ZNUR/ZRAq158cyUEKZQBtTzFUR4LC/Q01pt4q6d0VF/f6cHg9EF aFvDmNji8+rFTvMzv5j/fyCdT05b6r4E8OOMdaTQT3lC6b6RCTYatMyVrdyil2MoZKUM FUEE9nXaI+rfI6FpoFS9Mv/UE1l2aW/wld9ucsJy96D9NMMXd97bdKs19hQZGIZ9k3m0 uT0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=7Thz55IKoEmWh6YyaOnveCjOjYeqAzFOFagdwg20a4A=; b=liVEIgaIUXbo3dMmhy9zn7f9tucG8FZ3dpcMvTNtUYaY4NsZRRrstHX4AERa13bJM/ 3U0/W5XBZX+fVz/xzCZdkcjwucvmkTYvxzuTDwltY8aK9eCFmD2GekrnpTeG7zSShh+p zplTjx+QQ62TEfw318NuHGP4tv0DfDfSXbgRGonUrlVCTtrcnIT9alFbtiwYkIeGhC7/ FCDoZTUMVo6ri9MCGNW8+qPBVx6uLwC44kO7P3sW///dOqk53hMx/8FSg6HKwWZN1gSg oDtR782krxz4fu9XhkBLbY8pQWwePisj25TDr28dCog9Yfkx/Cv++DI61MeDD1H03xgN L3zQ== X-Gm-Message-State: ABuFfohMsIjFA53orH26XUtq9+3xEQ2Ofh0Dod5uDxbONY986WJXbPEu XbWKD3zl4IPmmZJfAkoA0e4YvAr+mJIcStS35hN0g5U6 X-Google-Smtp-Source: ACcGV60PfjVg5OBhDHHvC0du92SYFEeB5J0skBzcvbfkvcsISRFy36TjSvx+b40MsGAFnTIf1FOtuP21kM9JKjYcjhs= X-Received: by 2002:aca:db05:: with SMTP id s5-v6mr5194668oig.173.1538392187346; Mon, 01 Oct 2018 04:09:47 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:8a45:0:0:0:0:0 with HTTP; Mon, 1 Oct 2018 04:09:46 -0700 (PDT) From: Tino Calancha Date: Mon, 1 Oct 2018 20:09:46 +0900 Message-ID: Content-Type: text/plain; charset="UTF-8" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) 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 (-----) Severity: wishlist `dired-in-this-tree' is used as a predicate elsewhere. I suggest to follow the convention on predicates, i.e., to end its name with '-p'. --8<-----------------------------cut here---------------start------------->8--- commit 278c6d78c7d27eeb9bba19c5781cc43a5809a0ad Author: Tino Calancha Date: Mon Oct 1 19:59:24 2018 +0900 End predicate `dired-in-this-tree' with '-p' Rename `dired-in-this-tree-p' from `dired-in-this-tree'. * lisp/dired.el(dired-in-this-tree-p): Rename from `dired-in-this-tree'. Add docstring. (dired-in-this-tree): Define an alias to `dired-in-this-tree-p'. (dired-buffers-for-dir): Change comment into docstring. (dired-buffers-for-dir) * lisp/dired-aux.el (dired-tree-down, dired-kill-tree) (dired-insert-subdir, dired-rename-subdir): Update all callers. diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 1f13204b7c..9925615202 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1622,7 +1622,7 @@ dired-rename-subdir (while blist (with-current-buffer (car blist) (if (and buffer-file-name - (dired-in-this-tree buffer-file-name expanded-from-dir)) + (dired-in-this-tree-p buffer-file-name expanded-from-dir)) (let ((modflag (buffer-modified-p)) (to-file (dired-replace-in-string (concat "^" (regexp-quote from-dir)) @@ -1641,7 +1641,7 @@ dired-rename-subdir-1 (while alist (setq elt (car alist) alist (cdr alist)) - (if (dired-in-this-tree (car elt) expanded-dir) + (if (dired-in-this-tree-p (car elt) expanded-dir) ;; ELT's subdir is affected by the rename (dired-rename-subdir-2 elt dir to))) (if (equal dir default-directory) @@ -2392,7 +2392,7 @@ dired-insert-subdir (setq switches (dired-replace-in-string "R" "" switches)) (dolist (cur-ass dired-subdir-alist) (let ((cur-dir (car cur-ass))) - (and (dired-in-this-tree cur-dir dirname) + (and (dired-in-this-tree-p cur-dir dirname) (let ((cur-cons (assoc-string cur-dir dired-switches-alist))) (if cur-cons (setcdr cur-cons switches) @@ -2404,7 +2404,7 @@ dired-insert-subdir (defun dired-insert-subdir-validate (dirname &optional switches) ;; Check that it is valid to insert DIRNAME with SWITCHES. ;; Signal an error if invalid (e.g. user typed `i' on `..'). - (or (dired-in-this-tree dirname (expand-file-name default-directory)) + (or (dired-in-this-tree-p dirname (expand-file-name default-directory)) (error "%s: not in this directory tree" dirname)) (let ((real-switches (or switches dired-subdir-switches))) (when real-switches @@ -2445,7 +2445,7 @@ dired-kill-tree (setq dir (car (car s-alist)) s-alist (cdr s-alist)) (and (or kill-root (not (string-equal dir dirname))) - (dired-in-this-tree dir dirname) + (dired-in-this-tree-p dir dirname) (dired-goto-subdir dir) (setq m-alist (nconc (dired-kill-subdir remember-marks) m-alist)))) m-alist)) @@ -2683,7 +2683,7 @@ dired-tree-down (while rest (setq elt (car rest) rest (cdr rest)) - (if (dired-in-this-tree (directory-file-name (car elt)) dir) + (if (dired-in-this-tree-p (directory-file-name (car elt)) dir) (setq rest nil pos (dired-goto-subdir (car elt)))))) (if pos diff --git a/lisp/dired.el b/lisp/dired.el index 5c7bb9599c..63d8d4f52c 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2607,12 +2607,12 @@ dired-copy-filename-as-kill ;; Keeping Dired buffers in sync with the filesystem and with each other (defun dired-buffers-for-dir (dir &optional file) -;; Return a list of buffers for DIR (top level or in-situ subdir). -;; If FILE is non-nil, include only those whose wildcard pattern (if any) -;; matches FILE. -;; The list is in reverse order of buffer creation, most recent last. -;; As a side effect, killed dired buffers for DIR are removed from -;; dired-buffers. + "Return a list of buffers for DIR (top level or in-situ subdir). +If FILE is non-nil, include only those whose wildcard pattern (if any) +matches FILE. +The list is in reverse order of buffer creation, most recent last. +As a side effect, killed dired buffers for DIR are removed from +dired-buffers." (setq dir (file-name-as-directory dir)) (let (result buf) (dolist (elt dired-buffers) @@ -2621,7 +2621,7 @@ dired-buffers-for-dir ((null (buffer-name buf)) ;; Buffer is killed - clean up: (setq dired-buffers (delq elt dired-buffers))) - ((dired-in-this-tree dir (car elt)) + ((dired-in-this-tree-p dir (car elt)) (with-current-buffer buf (and (assoc dir dired-subdir-alist) (or (null file) @@ -2694,11 +2694,13 @@ dired-unadvertise ;;; utility functions -(defun dired-in-this-tree (file dir) - ;;"Is FILE part of the directory tree starting at DIR?" +(defun dired-in-this-tree-p (file dir) + "Return non-nil if FILE belongs to the directory tree starting at DIR." (let (case-fold-search) (string-match-p (concat "^" (regexp-quote dir)) file))) +(defalias 'dired-in-this-tree 'dired-in-this-tree-p) + (defun dired-normalize-subdir (dir) ;; Prepend default-directory to DIR if relative file name. ;; dired-get-filename must be able to make a valid file name from a --8<-----------------------------cut here---------------end--------------->8--- In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2018-08-20 built on calancha-pc.dy.bbexcite.jp Repository revision: 6217746dd64b43a2a2b3b66ab50cfbbfc984f36c From unknown Sun Jun 22 17:13:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#32892: 27.0.50; End predicate `dired-in-this-tree' with '-p' Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jul 2019 02:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32892 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Tino Calancha Cc: 32892@debbugs.gnu.org Received: via spool by 32892-submit@debbugs.gnu.org id=B32892.15629834688957 (code B ref 32892); Sat, 13 Jul 2019 02:05:01 +0000 Received: (at 32892) by debbugs.gnu.org; 13 Jul 2019 02:04:28 +0000 Received: from localhost ([127.0.0.1]:41010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hm7Om-0002KP-26 for submit@debbugs.gnu.org; Fri, 12 Jul 2019 22:04:28 -0400 Received: from quimby.gnus.org ([80.91.231.51]:53272) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hm7Ok-0002KE-A4 for 32892@debbugs.gnu.org; Fri, 12 Jul 2019 22:04:26 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hm7Of-0004Iy-U2; Sat, 13 Jul 2019 04:04:24 +0200 From: Lars Ingebrigtsen References: Date: Sat, 13 Jul 2019 04:04:21 +0200 In-Reply-To: (Tino Calancha's message of "Mon, 1 Oct 2018 20:09:46 +0900") Message-ID: <87tvbq1yhm.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Tino Calancha writes: > `dired-in-this-tree' is used as a predicate elsewhere. > I suggest to follow the convention on predicates, i.e., to end > its name with '-p'. Makes sense; I've now applied it to the trunk. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) 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: -1.0 (-) Tino Calancha writes: > `dired-in-this-tree' is used as a predicate elsewhere. > I suggest to follow the convention on predicates, i.e., to end > its name with '-p'. Makes sense; I've now applied it to the trunk. > (dired-buffers-for-dir): Change comment into docstring. Except this bit, which seemed unrelated. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 12 22:04:32 2019 Received: (at control) by debbugs.gnu.org; 13 Jul 2019 02:04:32 +0000 Received: from localhost ([127.0.0.1]:41013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hm7Oq-0002Kh-BC for submit@debbugs.gnu.org; Fri, 12 Jul 2019 22:04:32 -0400 Received: from quimby.gnus.org ([80.91.231.51]:53286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hm7Oo-0002KX-41 for control@debbugs.gnu.org; Fri, 12 Jul 2019 22:04:30 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hm7Ol-0004J5-Kr for control@debbugs.gnu.org; Sat, 13 Jul 2019 04:04:29 +0200 Date: Sat, 13 Jul 2019 04:04:27 +0200 Message-Id: <87sgra1yhg.fsf@mouse.gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #32892 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 32892 fixed close 32892 27.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control 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: -1.0 (-) tags 32892 fixed close 32892 27.1 quit