emacs-devel
[Top][All Lists]
Advanced

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

Re: feature/package-vc has been merged


From: Stefan Monnier
Subject: Re: feature/package-vc has been merged
Date: Tue, 08 Nov 2022 16:35:15 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>      (loaddefs-generate
> -     pkg-dir output-file
> -     nil
> -     "(add-to-list 'load-path (directory-file-name
> -                         (or (file-name-directory #$) (car load-path))))")
> +     (file-name-concat pkg-dir lisp-dir)
> +     output-file nil
> +     (prin1-to-string
> +      `(add-to-list 'load-path
> +                    (directory-file-name
> +                     ,(file-name-concat pkg-dir lisp-dir)))))
>      (let ((buf (find-buffer-visiting output-file)))
>        (when buf (kill-buffer buf)))
>      auto-name))
> --8<---------------cut here---------------end--------------->8---
>
> Git tells me that Lars was wrote the "(or (file-name-directory #$) (car
> load-path))" bit, so I've added him to the CC's: Can you explain what
> the intention was here, and if my suggested replacement would break
> anything?

I suspect he just copy/pasted the code from elsewhere.
The point is to make the file work regardless of where it is whereas
your replacement makes it work only in the location we used to
generate it.

You can/should replace #$ with `load-file-name`, which will make it
behave better w.r.t byte-compilation.


        Stefan




reply via email to

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