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: Basil L. Contovounesios
Subject: Re: master 7b50ed5: Ask if dir and subdir dired buffers be killed when deleting dir
Date: Sun, 13 Jun 2021 00:09:08 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Tassilo Horn <tsdh@gnu.org> writes:

> "Basil L. Contovounesios" <contovob@tcd.ie> writes:

> 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.

Thanks, that's all that matters :).

> I haven't done this:
>
> 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")
>
> Can you tell me the difference between this and `make-obsolete'?

The only difference AFAIK is that the former is translated into the
latter; see defun-declarations-alist, in particular
byte-run--set-obsolete.  You can verify this by invoking
'M-x pp-macroexpand-last-sexp' with point after the relevant defun.

So it's just an aesthetic preference of mine for keeping function
properties within the function's definition if possible, as it feels
more atomic and declarative.

> And will that also trigger a warning during byte-compilation of code
> using the function or only when it is actually called?

The same byte-compilation warnings should be omitted as with
make-obsolete.

> Feel free to do that change if you think it is better.

Not a big deal; it was just an opportunistic change ;).

Thanks,

-- 
Basil



reply via email to

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