emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Project out of sources compilation


From: Ergus
Subject: Re: [PATCH] Project out of sources compilation
Date: Tue, 16 Apr 2024 16:56:28 +0200

Hi Dmitry:

Sorry for th delay with this

On Sun, Apr 14, 2024 at 04:44:36AM +0300, Dmitry Gutov wrote:
Hi Ergus!

On 06/04/2024 05:05, Ergus wrote:

Here I attach a new patch with what I think is the best approach to
handle the extra info for projects. This implementation is pretty simple
for both sides (user, project.el and backends) and uses your main idea
of the generics + a custom.

However I decided not to use only the custom as you suggested, because
considering the project initialization it will require a complex and
error prone approach to initalize the backend variables correctly (for
example, when some buffers are already open).

With this implementation the backends only need to define the optional
generic specializations and the policy is pretty simple to explain (see
the doc strings).

I also modifies the backend project on github to match this new api, so,
you can check it as well.

How about the idea with the orthogonal hook, then, as in the attached patch? Something I described before.

I think your github code would be easy enough to adapt to use it.

WDYT?

The main idea is somehow the same, but IMHO I think that this approach
complicates the user config and backend implementation being also less
efficient and scalable (we will need a new hook for every new similar
feature).

There is no need to separate the backend from the build, and after some
tests, I find the cl-defgeneric behavior more predictable and simpler to
debug than using a function hook.

Your initial idea implemented like
(cl-defgeneric project-extra-info (_project _info)
  ...)

In my opinion is simpler and more scalable (while could be recycled to
provide also other existing functionalities like
project-compilation-buffer-name-function. All the generic
implementations become then optional which is very desired for the
general purpose.


reply via email to

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