From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id P3iAKptO+l61LAAA0tVLHw (envelope-from ) for ; Mon, 29 Jun 2020 20:27:07 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id OKzcJZtO+l6VHwAAB5/wlQ (envelope-from ) for ; Mon, 29 Jun 2020 20:27:07 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 200F6940144 for ; Mon, 29 Jun 2020 20:27:07 +0000 (UTC) Received: from localhost ([::1]:52058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jq0Ms-0000ns-2B for larch@yhetil.org; Mon, 29 Jun 2020 16:27:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jq0Mj-0000nB-JO for help-guix@gnu.org; Mon, 29 Jun 2020 16:26:57 -0400 Received: from mout02.posteo.de ([185.67.36.66]:36299) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jq0Mg-0003DN-Rb for help-guix@gnu.org; Mon, 29 Jun 2020 16:26:57 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 0C65E240101 for ; Mon, 29 Jun 2020 22:26:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1593462412; bh=VqAwvturWM4oxOtavVQs4SCv6aUvNSoi7ove6AhpaHw=; h=Subject:To:Cc:From:Date:From; b=q0jfR9f3qmra7bhk4z7es7dDwBwPr//wBQC7vYkWNyeq8NibPtCv1Nlema1xhsw+F gio6rCLodCtu0LkidRExbmCaRlYzMibZcyiHkyIzkbqnYa1PzYZ8S2PexNGfVM018/ 412Zk1zQLtbWAEeqpT5mrodgRk1aoak3FzEnvGxjZbdT/ErfDPD9RxvjWGbAtUkaBQ yk60nlEOzUQzBeQ0iD1kc3Qm1K85lOrWearVuj+KWOG/P7i4aWqckCtZ/b2vD6ircp T32PZzp44N7lIKZgAhS9WBPT3j8ob7dtSWaGh7AKCpO01vHH6nzyuhEPw5MUbMTra+ 9DS5nr+xe+vzQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 49wfCv3QyDz9rxD; Mon, 29 Jun 2020 22:26:51 +0200 (CEST) Subject: Re: Erlang + Emacs profile To: Maxim Cournoyer References: <3801410f-667e-9cac-74f3-d56a519adcc2@posteo.de> <871rm4mcm1.fsf@gmail.com> From: Zelphir Kaltstahl Message-ID: Date: Mon, 29 Jun 2020 22:26:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Icedove/68.8.0 MIME-Version: 1.0 In-Reply-To: <871rm4mcm1.fsf@gmail.com> Content-Language: en-US Received-SPF: pass client-ip=185.67.36.66; envelope-from=zelphirkaltstahl@posteo.de; helo=mout02.posteo.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/29 15:38:01 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=posteo.de header.s=2017 header.b=q0jfR9f3; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.de (policy=none); spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: iXn0Gxu4mpLm Hi Maxim! Although I installed emacs-ob-erlang in my main profile, where Emacs is installed, I get an error, when I try to evaluate Erlang code in Org-mode. A new buffer *Org-Babel Error Output* opens and displays: ~~~~ bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell ~~~~ When I open an `eshell` and do `which`: ~~~~ Welcome to the Emacs shell $ which erl /home/xiaolong/.guix-profile/bin/erl $ which erlc /home/xiaolong/.guix-profile/bin/erlc $ ~~~~ So it can definitely find Erlang. I am not sure what the problem is. I did not exactly follow the approach of using a manifest and instead installed everything in the main profile, but to my understanding, that should also work the same way, as long as it is all in the same profile. The whole file I have for trying it: ~~~~ #+BEGIN_SRC python :results output print(1+1) #+END_SRC #+RESULTS: : 2 #+BEGIN_SRC scheme (define abc (lambda (a) a)) (abc 123) #+END_SRC #+RESULTS: : 123 #+begin_src elisp ;; (require 'org-tempo) (require 'ob-erlang) (org-babel-do-load-languages 'org-babel-load-languages '((erlang . t))) #+end_src #+RESULTS: #+BEGIN_SRC erlang :module tryerlang start() -> io:format("hello world"). #+END_SRC #+RESULTS: ~~~~ So Python works, Scheme (Guile in this case) works, and Elisp simply had no output but worked and was run before the Erlang one. Only Erlang did not work. Do you know what causes this error? I've seen it with other org-babel source blocks, but usually accompanied by some more error telling me, what is wrong. For example, when there is no Python at the specified executable path of Python in Emacs settings / config, it would tell me that there is no such file or directory or something like that. Best regards, Zelphir On 24.06.20 22:29, Maxim Cournoyer wrote: > Hello Zelphir, > > Zelphir Kaltstahl writes: > >> Hello Guix users! >> >> What is your way of setting up a profile for Erlang development? >> >> There are some things I would like to have, some of which I already >> managed to get: >> >> * [X] Erlang installed through Guix package manager in a separate profile >> * [X] `erl` REPL available in that separate profile >> * [X] an Emacs Erlang mode (installed it through M-x list-pack RET and >> searched for erlang there) >> * [_] org-mode babel erlang for literate programming in org-mode, >> using the Guix installed erlang executable – I found >> https://github.com/xfwduke/ob-erlang, which also seems to work, but >> I do not know how to point it to the Guix installed Erlang, so that >> it can actually run code. Currently it complains about not finding >> Erlang. Does anyone know how to point it to the Erlang executable? I >> created this issue: https://github.com/xfwduke/ob-erlang/issues/1 > It just looks up erl from your PATH, so the problem must be that you > started Emacs from your user profile, which doesn't know about the > separate Guix profile you created which contains Erlang. > > You'd have to start Emacs from an shell where your separate profile was > sourced, or fiddle with M-x setenv to fix this. emacs-guix also has > some guix-set-emacs-environment procedure that can be used to augment > Emacs environment variables given a profile, but it seems broken at the > moment. > > I just tried the following approach, where everything is managed by Guix > in a separate profile: > > --8<---------------cut here---------------start------------->8--- > ;; file: manifest.scm > (specifications->manifest > '("erlang" > "emacs" > "emacs-org" > "emacs-erlang" > "emacs-ob-erlang")) ;; freshly packaged for you ;-) > --8<---------------cut here---------------end--------------->8--- > > Then spawn an environment with > > guix environment -m manifest.scm > > And then ran the following experiment: > > --8<---------------cut here---------------start------------->8--- > # file: test.org > > Put this in your ~/.emacs or evaluate it ad-hoc before running the > rest. > > #+begin_src elisp > (require 'org-tempo) > (require 'ob-erlang) > (org-babel-do-load-languages > 'org-babel-load-languages > '((erlang . t))) > #+end_src > > Example taken from: https://github.com/xfwduke/ob-erlang > With your cursor on the code block, I ran M-x org-babel-execute-src-block > #+BEGIN_SRC erlang :module tryerlang > start() -> > io:format("hello world"). > #+END_SRC > > And it produced: > #+RESULTS: > : hello world > --8<---------------cut here---------------end--------------->8--- > > Hope this helps! > > Maxim -- repositories: https://notabug.org/ZelphirKaltstahl