From: Tassilo Horn <tsdh@gnu.org>
To: "Basil L. Contovounesios" <contovob@tcd.ie>
Cc: emacs-devel@gnu.org
Subject: Re: master 7b50ed5: Ask if dir and subdir dired buffers be killed when deleting dir
Date: Sat, 12 Jun 2021 14:53:33 +0200 [thread overview]
Message-ID: <877diznsod.fsf@gnu.org> (raw)
In-Reply-To: <878s3fuwsc.fsf@tcd.ie>
"Basil L. Contovounesios" <contovob@tcd.ie> writes:
Hi Basil,
>> branch: master
>> commit 7b50ed553faa6de6d51bf07d12d106ca61ab3ac4
>> Author: Tassilo Horn <tsdh@gnu.org>
>> Commit: Tassilo Horn <tsdh@gnu.org>
> [...]
>> (dired-in-this-tree-p): Make obsolete in favor of file-in-directory-p
>> which actually does what the name suggest whereas dired-in-this-tree-p
>> is just string-matching on filenames which will fail with symlinks
>> filenames including ./ or ../.
>
> There are still a few uses of dired-in-this-tree-p in dired-aux.el,
> which give rise to byte-compilation warnings.
Oh, I somehow missed those.
> Is the attached patch TRT, or are there any subtle differences between
> the functions that still need to be addressed?
Yes, I think they are equivalent in all cases dired cares about and
file-in-directory-p stays correct also in cases where
dired-in-this-tree-p will give a wrong answer.
But sorry, I've read your mail on my phone without noticing the patch.
I've done basically the same right now before actually reading your mail
again in a proper MUA.
I haven't done this:
--8<---------------cut here---------------start------------->8---
diff --git a/lisp/dired.el b/lisp/dired.el
index bb428e2198..8c7bff31cb 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2912,10 +2912,10 @@ dired-unadvertise
;;; utility functions
(defun dired-in-this-tree-p (file dir)
- ;;"Is FILE part of the directory tree starting at DIR?"
+ "Return non-nil if FILE is part of the directory tree starting at DIR."
+ (declare (obsolete file-in-directory-p "28.1"))
(let (case-fold-search)
(string-match-p (concat "^" (regexp-quote dir)) file)))
-(make-obsolete 'dired-in-this-tree-p 'file-in-directory-p "28.1")
(define-obsolete-function-alias 'dired-in-this-tree
'dired-in-this-tree-p "27.1")
--8<---------------cut here---------------end--------------->8---
Can you tell me the difference between this and `make-obsolete'? And
will that also trigger a warning during byte-compilation of code using
the function or only when it is actually called? Feel free to do that
change if you think it is better.
Bye,
Tassilo
next prev parent reply other threads:[~2021-06-12 12:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210604200934.4659.34841@vcs0.savannah.gnu.org>
[not found] ` <20210604200935.87641209AA@vcs0.savannah.gnu.org>
2021-06-12 11:50 ` master 7b50ed5: Ask if dir and subdir dired buffers be killed when deleting dir Basil L. Contovounesios
2021-06-12 12:53 ` Tassilo Horn [this message]
2021-06-12 23:09 ` Basil L. Contovounesios
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877diznsod.fsf@gnu.org \
--to=tsdh@gnu.org \
--cc=contovob@tcd.ie \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).