From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePwiD-0001Nr-UY for guix-patches@gnu.org; Fri, 15 Dec 2017 15:36:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePwiA-0003XX-Op for guix-patches@gnu.org; Fri, 15 Dec 2017 15:36:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:55700) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePwiA-0003XN-KG for guix-patches@gnu.org; Fri, 15 Dec 2017 15:36:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ePwiA-0001GA-Dc for guix-patches@gnu.org; Fri, 15 Dec 2017 15:36:02 -0500 Subject: [bug#28832] [PATCH 1/3] gnu: Add emacs-json-reformat. Resent-Message-ID: From: Alex Kost References: <87lgke3vlz.fsf@gmail.com> <20171014102915.11778-1-go.wigust@gmail.com> <87y3o6uheo.fsf@gnu.org> <87d13yiw6w.fsf@gnu.org> <87609cluzf.fsf@gmail.com> <87zi6os3u3.fsf@gnu.org> <87fu8famhm.fsf@gmail.com> <877etofi3n.fsf@gmail.com> Date: Fri, 15 Dec 2017 23:35:17 +0300 In-Reply-To: <877etofi3n.fsf@gmail.com> (Oleg Pykhalov's message of "Fri, 15 Dec 2017 12:36:28 +0300") Message-ID: <87vah7lofu.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Oleg Pykhalov Cc: 28832@debbugs.gnu.org Hello, I have only one addition to the Ludovic's comments. Oleg Pykhalov (2017-12-15 12:36 +0300) wrote: [...] > +(define* (setup-environment #:key inputs #:allow-other-keys) > + "Export the variable EMACSLOADPATH, which are based on INPUTS respectively." > + (let* ((filtered-inputs (emacs-inputs inputs)) > + (emacs-input-dir (cdr (assoc "emacs" filtered-inputs))) > + (inputs-dirs (cdr filtered-inputs))) > + ;; EMACSLOADPATH is where Emacs looks for the source code of the build's > + ;; dependencies. > + (setenv "EMACSLOADPATH" > + (string-append emacs-input-dir "/share/emacs/" > + (store-directory->package-version emacs-input-dir) > + "/lisp")) > + (for-each > + (lambda (input) > + (let ((store-item (cdr input))) > + (setenv "EMACSLOADPATH" > + (string-append > + (or (getenv "EMACSLOADPATH") "") > + ":" store-item %install-suffix "/" > + ((compose string-drop-emacs store-directory->package-name) > + store-item))))) > + ((compose (lambda (inputs) (alist-delete "emacs" inputs)) > + (lambda (inputs) (alist-delete "source" inputs))) "emacs" and "source" may not be the only inputs that should be deleted. For example, 'emacs-exwm-x' package also has "xhost" and "dbus" inputs. And your 'string-drop-emacs' will fail on these names, right? Since there is 'emacs-package?' function in this module, perhaps it would be better to use it instead (to add only emacs packages to EMACSLOADPATH), WDYT? P.S. Actually, I didn't test your patch, so maybe I just didn't understand the code properly :-) -- Alex