hasu / notdeft

NotDeft note manager for Emacs
https://tero.hasu.is/notdeft/
170 stars 14 forks source link

Automate installation #12

Closed MaxSt closed 4 years ago

MaxSt commented 4 years ago

Hey,

First of all, thank you for creating this package!

In order to simplify the installation, I added the function notdeft-make-notdeft-xapian-when-not-found, which automatically builds the xapian-notdeft application, when it is not already built and the variable notdeft-disable-notdeft-xapian-compilation is nil (default). I added this function to the notdeft-load-hook in order to automate the installation process of this package.

Having this functionality would make this package compatible with emacs package managers like use-package or straight and simplify the installation.

Here is an example of configuring notdeft with straight:

(use-package notdeft
     :straight (:host github
                :repo "hasu/notdeft"
                :branch "xapian"
                :files ("*" (:exclude "images" "Makefile" "web" "README.org"))))

This PR would also enable publishing this package to melpa:

;; melpa recipe
(notdeft :fetcher github
     :repo "hasu/notdeft"
         :branch "xapian"
         :files ("*" (:exclude "images" "Makefile" "web" "README.org")))

Here is more information about adding this package to melpa if you are interested in doing so.

hasu commented 4 years ago

Thank you, Max, for the idea and the implementation, and the information about those different installation mechanisms.

Is it OK to credit you for the code? And to release it under the BSD license used by the package?

I'm going to merge your change as is, and it's already on a feature branch, which I'll be using to try out some of the things you mention.

I'm also working on a follow-up change. I think I'll move this functionality into a separate feature, as there are really no API interdependencies with `notdeft-xapian'. Automatic compilation can then also be avoided simply by not loading the feature, without having to set any variable to disable.

I might also have notdeft-xapian-program' be set automatically in the hook after a successful compilation, which would then be one dependency on thenotdeft-xapian' feature.

It may also be useful to make the C++ compilation command configurable on the Emacs Lisp side.

MaxSt commented 4 years ago

Is it OK to credit you for the code? And to release it under the BSD license used by the package?

yes :+1:, go ahead.

I'm also working on a follow-up change. I think I'll move this functionality into a separate feature, as there are really no API interdependencies with `notdeft-xapian'. Automatic compilation can then also be avoided simply by not loading the feature, without having to set any variable to disable.

I might also have notdeft-xapian-program be set automatically in the hook after a successful compilation, which would then be one dependency on the notdeft-xapian feature.

I really like the proposed changes! To be honest, I totally forgot about setting the notdeft-xapian-proram variable :see_no_evil: , but I also think that automatically setting it after a successful compilation is a good idea.

What do you think about introducing a variable, that defines whether or not the notdeft-xapian feature should be loaded? This way the users do not have to require it themselves and can configure this package by setting this configuration variable.

hasu commented 4 years ago

I'm not sure how much more convenient a variable is than just adding the hook with an autoload. I suppose if it was a variable then it could also be made configurable through the `customize' facility, so it's worth considering.