emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 7b50ed5: Ask if dir and subdir dired buffers be killed when d


From: Tassilo Horn
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
User-agent: mu4e 1.5.13; emacs 28.0.50

"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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]