unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
To: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Cc: help-guix@gnu.org
Subject: Re: Erlang + Emacs profile
Date: Tue, 30 Jun 2020 20:41:21 +0200	[thread overview]
Message-ID: <17cbeb3d-8950-3f96-6106-ad2dbde661db@posteo.de> (raw)
In-Reply-To: <871rm4mcm1.fsf@gmail.com>

Hi Maxim,

Sorry for the incomplete previous e-mail, somehow I hit send, instead of
changing formatting.

So here I go again:

I got around to trying it your way, I think.

I have the manifest file `manifest.scm`:

~~~~
(specifications->manifest
 '("erlang"
   "emacs"
   "emacs-org"
   "emacs-erlang"
   "emacs-ob-erlang"))
~~~~

Then I run the command you wrote: `guix environment -m manifest.scm`,
which created the environment just fine.

Then I created a little Bash script, to make sure to start the separate
Emacs without looking at the normal `~/.emacs.d/init.el` file:

~~~~
#!/usr/bin/env bash

set -Eeuxo pipefail

emacs --no-init-file --no-desktop --maximized
~~~~

And Emacs starts up just fine.

Then I run the Elisp code in the *scratch* buffer:

~~~~
  (require 'org-tempo)			
  (require 'ob-erlang)
  (org-babel-do-load-languages
   'org-babel-load-languages
   '((erlang . t)))
~~~~

Then I try to run the org-mode source block hello world Erlang:

~~~~
start() ->
        io:format("hello world").
~~~~

Here however, I get an error logged in my *Messages* buffer:

~~~~
executing Erlang code block...
append-export-all: Symbol’s function definition is void: string-join
~~~~

Is there anything I missed?

Best regards,
Zelphir

On 24.06.20 22:29, Maxim Cournoyer wrote:
> Hello Zelphir,
>
> Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> 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


  parent reply	other threads:[~2020-06-30 18:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 22:49 Erlang + Emacs profile Zelphir Kaltstahl
2020-06-24 20:29 ` Maxim Cournoyer
2020-06-25 19:25   ` Zelphir Kaltstahl
2020-06-28  4:41     ` Maxim Cournoyer
2020-06-29  8:50     ` zimoun
2020-06-29 19:37       ` Zelphir Kaltstahl
2020-06-29 20:24         ` Ricardo Wurmus
2020-06-29 20:37           ` Zelphir Kaltstahl
2020-06-29 20:49         ` zimoun
2020-06-29 21:12           ` Zelphir Kaltstahl
2020-06-29 22:08             ` zimoun
2020-06-29 20:26   ` Zelphir Kaltstahl
2020-06-30 18:34   ` Zelphir Kaltstahl
2020-06-30 18:41   ` Zelphir Kaltstahl [this message]
2020-07-06  3:50     ` Maxim Cournoyer
2020-07-07 10:23       ` Zelphir Kaltstahl
2020-07-07 15:55         ` Maxim Cournoyer
2020-07-16 21:34       ` Zelphir Kaltstahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17cbeb3d-8950-3f96-6106-ad2dbde661db@posteo.de \
    --to=zelphirkaltstahl@posteo.de \
    --cc=help-guix@gnu.org \
    --cc=maxim.cournoyer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).