[Top][All Lists]

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

Re: Erlang + Emacs profile

From: Zelphir Kaltstahl
Subject: Re: Erlang + Emacs profile
Date: Thu, 25 Jun 2020 21:25:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

Hi Maxim!

Thanks for your message! I'll try it out. It implies some things I'd
rather not do though:

* It requires keeping multiple Emacs on my system. How will they
interact with the same ~/.emacs.d/.init.el?
* This approach seems to install everything only temporary, reinstalling
every single time. But I can use a profile, so that's fine.

How did you package emacs-ob-erlang? (I did not yet package a single
package for Guix, so I assume no prior knowledge.) Or is it a rather
lengthy procedure to do so? I think this might be one of the next things
I learn about Guix, which is very useful, because if a package is
missing, one can add it oneself, without having to rely on others to add it.

It's an OK-ish solution to simply modify my PATH to make ob-erlang find
erl, however, I was hoping for a configuration value in ob-emacs itself,
so that I can set everything inside that plugin.

I usually install Emacs packages inside Emacs, instead of using Guix for
it. I do this, because probably not all packages I want are available in
Guix, but I have not checked this assumption at all.

I think I'll be fine with adapting my PATH for now, just need to do it
in a way, that will keep working when I update Guix packages.


On 6/24/20 10:29 PM, 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
>>, 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:
> 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:
> 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:
> 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").
> And it produced:
> : hello world
> --8<---------------cut here---------------end--------------->8---
> Hope this helps!
> Maxim

reply via email to

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