emacs-eldev / eldev

Elisp development tool
https://emacs-eldev.github.io/eldev/
GNU General Public License v3.0
230 stars 17 forks source link

Adding new paths to Eldev #44

Open contrapunctus-1 opened 3 years ago

contrapunctus-1 commented 3 years ago

My project's files are located in elisp/. When I run eldev init in the project root, it says -

$ eldev init
This directory doesn’t seem to contain a valid Elisp package (yet)
If it does have main ‘.el’ file, headers in it are likely corrupt or incomplete
Try evaluating ‘(package-buffer-info)’ in a buffer with the file
Continue anyway? (y or n)

...which is perhaps to be expected, if it is not looking in elisp/.

Now, I've not been able to get (setq eldev-main-fileset ...) to take any apparent effect whatsoever. I've tried setting it to "elisp/", ("elisp/"), ("elisp"), ("./elisp"), ("./elisp/"), ("./elisp/*.el"), and "./elisp/*.el". Each time, I got -

$ eldev -t compile
Started up on Sun Jun 6 21:53:24 2021
Running on GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2021-03-28, modified by Debian
Project directory: ‘/home/user/.emacs.d/my/project-dir/’
No file ‘/home/anon/.eldev/config’, not applying user-specific configuration
Loading file ‘Eldev’...
No file ‘Eldev-local’, not customizing build
Executing command ‘compile’...

No .el files with package headers in ‘/home/user/.emacs.d/my/project-dir/’
Headers in the project’s main file are likely corrupt or incomplete
Try evaluating ‘(package-buffer-info)’ in a buffer with the file

FWIW the elisp/ directory contains Org literate programs, with the tangled source files (present in the same directory) checked into Git. (package-buffer-info) is perfectly happy with these.

What's going on?

doublep commented 3 years ago

You can probably do (setf eldev-project-main-file "elisp/PROJECTS-MAIN-FILE.el") in Eldev. Adjusting eldev-main-fileset is likely unnecessary in this case, since Eldev searches for files recursively with default settings anyway. However, it needs the project to be recognized by Emacs package system, which is by default done using package-dir-info invocation, which does not search in subdirectories. The main file can be specified explicitly too (i.e. via eldev-project-main-file), however, I'm not sure if Eldev will work fine with the main file being in a subdirectory — never tried such a setup.

contrapunctus-1 commented 3 years ago

Thank you for your response. Another thing is that my program has a few extensions, most of them part of the same repository in the same elisp/ subdirectory...so it doesn't really have a single main file, it has three. One of the projects I saw using Eldev has separate files for the secondary projects, supposed to be loaded with -S...I guess I could try that, although I'd prefer to handle it all with a single file. Would you consider adding support for such programs to Eldev?

doublep commented 3 years ago

Would you consider adding support for such programs to Eldev?

Yes, but this is a case where I don't know how this should be handled. If you can provide an outline of how you imagine it would work, we can discuss it and decide what would be the best way. Also, if your project is public, a link to it would be helpful.

contrapunctus-1 commented 3 years ago

Hm...I'd like to possess a greater understanding of Eldev before I attempt that ^^' Here's my project - https://tildegit.org/contrapunctus/chronometrist