A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg00465.html below:

Re: feature/package-vc has been merged

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] 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




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4