From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Project out of sources compilation Date: Tue, 16 Apr 2024 16:56:28 +0200 Message-ID: References: <1fd527fc-9643-49d2-8fae-d7e7fd043fe1@gutov.dev> <87le5x34l6.fsf@gmail.com> <27rton4k4r6sacysluk7iikj57ai2tyiak4ldd5nzpts7thmhg@nriej75catir> <09a8189d-07e3-4bc5-a4f4-127dcdcec2d1@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23665"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 16 16:57:25 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rwkFR-0005yn-9r for ged-emacs-devel@m.gmane-mx.org; Tue, 16 Apr 2024 16:57:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwkEl-0006rO-6N; Tue, 16 Apr 2024 10:56:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rwkEi-0006r6-80 for emacs-devel@gnu.org; Tue, 16 Apr 2024 10:56:40 -0400 Original-Received: from sonic314-13.consmr.mail.bf2.yahoo.com ([74.6.132.123]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rwkEe-0004S4-RY for emacs-devel@gnu.org; Tue, 16 Apr 2024 10:56:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1713279393; bh=5G+FTKBQj3TaE/SB1smRAzaNhg0vu1qvTBEKSmLqQt4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=e1TPovELkM0oiFa5UD4xeypPotHSdoQRWW2qQQ7DmiNAHEOYrN7ZS8LE3i/78+wQ4EhBG2zRx9fMwSn8jg3ctSkRYPr1oviSt4SC7c73ApHLLWOQ91PSG/Mm1VG5sZWWmOLsNuFkCZcmJ+IEsdogWoFTE6zvuB9IXw6I/LhebhGXwzjPNEGVwFBvkjURnHJ8NV35W+BUuneWLfGopEb9+OnUeCThlr2JGDpILEswat0Su+Tsc8yP4/46PhFjIbqGqoAFU0oJqOv252y32KMrf5G6jsdtGq4EUbXfiEcPLm/2ilha20KntRMjK3mPPe8nwLJCDTECg4Qa0OoxM2TDmw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1713279393; bh=i+mcsbHSuqEqFoV6p6/+YEMMT5Tzbt2zinYv378K2Ze=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=QGcw4P0gnegkjuxZNooDpWeuRNLgzIbpB6iPgfICyQ5s+9UT2Co8KN5xaDjj3yFq7RwpmyDbPIWasMoQ2+4tz3c6wPpeNdPT9R2AP4Kjn5XLVoPiyJpoJIdqlN6LMP0hdBU+juiD6rxIYYpLuGHj1xq0j+UGdja0vzIlIiniluWr/yNkXziYQjGZzJIXEUaMg4VqHEfzE2DCvsPDwM2qz5LS4YDUCbwq/vmIqHEeTX0OgpN+7CTHBa+vNE4MlzxYkRzNZOYQuoYueHMFVl53GmJbGHvTSkkud+5mQm6mlZM/nk5T3MAIjwZXfppD3d7f3LIuKRLkxuumEcJC5W2QJQ== X-YMail-OSG: hmFVi4QVM1nIyVhRm_pHojjED4HGIgL23fujtWf6xzPrSsscndCcg.55QrLjJQV qS9RBJdRflcFZxqbEFMhYOloxR718fnyJabduqY25N8OJfFTI_rQz8QcqSunLZv1JwybpekTlx8b ERmKhwM1.j1WZM.ioEiFacc_v7mXGBwxjFStLtVkAoMqjNG9z9SnLysJKEC.7iTwkNrxwpG3FLHe dxpfhaMzjJTFGu_.lSZf7rvMMx2eCU6lfuhUpRNPGORB2VKRelVZbnsAfa13Xnv0tumtSYCr35le z6IMxd4rzWSUtRVdHsWXfrPFlZp8LSa3hYv192fYvy.4HWqYgBY_iQBlLl6g9_ubmbgWUGY1x3Zq OUCnDMIZwM3uag3fj_kBi5MYYTwxA0KoBFxcQ980YfS_F.SxaVZ4vXGafUU9BgzIwbxhVw3U.GhC pi5iIm1sDSG8C8XYub0XjCw36jpXFjU4N2V_bkVSulry7hkOGTjbIvCkfsWjkK003swD.6OjHVuI uoNnnkT1OJHTETPJ4nyQGy_MBBrJqok9whXg3AbDQmT2kbIy64e.I6CGmZp_Qhv4EA1YdhlaPKVK VZLa2NM8a10RKWrUzBz1.JS4JQkZp9_VFVfjRmuACygLfW0Bd2Pu98I0K4BmIE6opbqOWy.N0ZtJ d5SieqKAePFjQVByi5kwWcUewyK0Yj0zMEt52jtCJLAZ4D5xrJh2HO5Ki7cWvUSPPEYWILByWHf. UH5Nj7wLO8vODziS3kN3bj5soR0bCKtR4L0suRTLN1YHgbpJM.yrJkzHPBUcc.A5hROeqqrMt5Mk r.BoCJhrC1Z4ZCjFzsUMEBrHbmQvvMIeHXJkvclQ_K X-Sonic-MF: X-Sonic-ID: 80596c41-12d5-400b-be9a-29de99180f1e Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.bf2.yahoo.com with HTTP; Tue, 16 Apr 2024 14:56:33 +0000 Original-Received: by hermes--production-ir2-7b99fc9bb6-cnd7l (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID f6736ab5a9ba997ae7c92851c8faf756; Tue, 16 Apr 2024 14:56:29 +0000 (UTC) Content-Disposition: inline In-Reply-To: X-Mailer: WebService/1.1.22205 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.132.123; envelope-from=spacibba@aol.com; helo=sonic314-13.consmr.mail.bf2.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:317752 Archived-At: 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.