Eli Zaretskii <eliz@gnu.org> writes: >> From: Philip Kaludercic <philipk@posteo.net> >> Cc: monnier@iro.umontreal.ca, rms@gnu.org, emacs-devel@gnu.org >> Date: Mon, 07 Nov 2022 08:42:18 +0000 >> >> Eli Zaretskii <eliz@gnu.org> writes: >> >> >> From: Philip Kaludercic <philipk@posteo.net> >> >> Cc: monnier@iro.umontreal.ca, rms@gnu.org, emacs-devel@gnu.org >> >> Date: Sun, 06 Nov 2022 18:35:10 +0000 >> >> >> >> Eli Zaretskii <eliz@gnu.org> writes: >> >> >> >> > And if you think many do, why not clone the repository directly into >> >> > ~/.emacs.d/elpa/? >> >> >> >> Because that won't take care of scraping for autoloads, byte >> >> compilation and installing missing dependencies. >> > >> > I don't see why. Please elaborate how having the repository inside >> > ~/.emacs.d gets in the way of these activities. >> >> It doesn't get in the way, the issue just is that if you were to just >> clone a package right into .emacs.d, you would still have to do all >> these steps individually and manually. > > Which steps are those, and why do we have to do it manually? Let us assume `default-directory' is (locate-user-emacs-file "elpa"). If I run "M-! git clone https://some.git.host.com/path/to/repo/foo.git";, then I'll just have a directory called "foo", right? If I want to byte compile the files I'd e.g. have to open foo in Dired, mark all Emacs Lisp files, byte compile them, then run something like `make-directory-autoloads' myself. Then I'd have to find the main file, check the dependency list and run M-x package-install on every one that is missing, again one-by-one. You don't have to do this for `package-install', because it invokes `package-unpack' that takes care of those details. As package-vc-install doesn't use prepared tarballs, the equivalent process is a bit different (thus we have `package-vc-unpack'), but the intention is the same. Bundle all the repetitive task into a single command. >> >> You mean as in only allowing for packages to distribute lisp code in the >> >> root directory of the repository? That would pointlessly break too many >> >> packages that decide to structure their file hierarchy for whatever >> >> reason. >> > >> > Is that what :lisp-dir is about? then the doc strings in package-vc.el >> > doesn't even hint about that. In particular, there's nothing there >> > about the root directory of the repository. >> >> The docstring for `package-vc--archive-spec-alist' has the following >> (I'm still looking for a better way to document this): >> >> `:lisp-dir' (string) >> The repository-relative name of the directory to use for loading the Lisp >> sources. If not given, the value defaults to the root directory >> of the repository. > > Ah, it's a misunderstanding. See below. > >> > (Not that I understand >> > why having Lisp files in a subdirectory of the repository would be a >> > problem that needs an explicit configuration of the package, probably >> > missing something else again.) >> >> Maybe I am mistaken, but having a directory in `load-path' doesn't mean >> all sub-directories are automatically indexed, right? > > We have a standard solution for that: > normal-top-level-add-subdirs-to-load-path. We install in any > directory that needs this a file called subdirs.el with the following > contents: > > (if (fboundp 'normal-top-level-add-subdirs-to-load-path) > (normal-top-level-add-subdirs-to-load-path)) > > Example of directories which need this is the site-lisp directory. I was not familiar with this function. > Why cannot we do something like this in this case? I would have to try this out, but my worry is that in some cases this could add too many non-lisp directories. It still seems more elegant to encode what the lisp directory is in the package description.
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