unofficial mirror of help-guix@gnu.org 
 help / color / Atom feed
* Erlang + Emacs profile
@ 2020-06-23 22:49 Zelphir Kaltstahl
  2020-06-24 20:29 ` Maxim Cournoyer
  0 siblings, 1 reply; 14+ messages in thread
From: Zelphir Kaltstahl @ 2020-06-23 22:49 UTC (permalink / raw)
  To: help-guix

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

I did not see any separate OTP package on `guix search`. Is this already
included in the `erlang` package or is this missing from Guix package
repositories?

Here is my current manifest.scm file for creating a profile (currently
not much in there):

~~~~
(specifications->manifest
 '("erlang@21.3.8.13"))
~~~~

Note, that Emacs is not in here, because I have it in my global or base
profile. I'd rather not have a separate Emacs for this project, but
simply use the one installed already. I am also aware, that Guix has
packages for Emacs packages, but so far I've always installed those
inside Emacs using M-x list-pack. This probably means, that Guix is not
aware of them being installed, but I had no problems with it so far.

Regards,
Zelphir


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Erlang + Emacs profile
  2020-06-23 22:49 Erlang + Emacs profile Zelphir Kaltstahl
@ 2020-06-24 20:29 ` Maxim Cournoyer
  2020-06-25 19:25   ` Zelphir Kaltstahl
                     ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Maxim Cournoyer @ 2020-06-24 20:29 UTC (permalink / raw)
  To: Zelphir Kaltstahl; +Cc: help-guix

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Erlang + Emacs profile
  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 20:26   ` Zelphir Kaltstahl
                     ` (2 subsequent siblings)
  3 siblings, 2 replies; 14+ messages in thread
From: Zelphir Kaltstahl @ 2020-06-25 19:25 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: help-guix

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.

Thanks,
Zelphir

On 6/24/20 10:29 PM, 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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Erlang + Emacs profile
  2020-06-25 19:25   ` Zelphir Kaltstahl
@ 2020-06-28  4:41     ` Maxim Cournoyer
  2020-06-29  8:50     ` zimoun
  1 sibling, 0 replies; 14+ messages in thread
From: Maxim Cournoyer @ 2020-06-28  4:41 UTC (permalink / raw)
  To: Zelphir Kaltstahl; +Cc: help-guix

Hello,

Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> writes:

> 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?

Badly, unless you've carefully crafted .init.el to load modules only
when they're present (it's doable, and some packages even aim to
simplify this kind of thing).

Otherwise you'd have to launch emacs with the -q switch to prevent
reading your main ~/.emacs.el (or .init.el).

> * This approach seems to install everything only temporary, reinstalling
> every single time. But I can use a profile, so that's fine.

Yes, you can change the 'guix environment -m' command for a 'guix
package -m' one for a persistent result (or use the -r option of 'guix
environment').

> How did you package emacs-ob-erlang? (I did not yet package a single
> package for Guix, so I assume no prior knowledge.)

'guix edit emacs-ob-erlang' should bring you right to the definition of
the package.

> Or is it a rather
> lengthy procedure to do so?

No, it probably took me less than 15 minutes total; it was a small and
straightforward package.  The emacs-build-system is remarkably simple.

> 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.

Yes, that's one of my favorite things about Guix. It's hackable.

> 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.

Such as configuration would need to be possible in ob-erlang, but it's
not [0].  You could define a bunch of defvars and contribute a patch
upstream, if you are so inclined.

> 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.

The collection is growing, and as mentioned earlier, it's rather easy to
add new items to it :-). Managing everything the same way makes for a
better experience in my opinion (isn't that what Guix is about? :-)).

> 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.

Note that you could also choose to install erlang in your main profile
along Emacs and emacs-ob-erlang; that'd remove the need to mess with
PATH.

Maxim


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Erlang + Emacs profile
  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
  1 sibling, 1 reply; 14+ messages in thread
From: zimoun @ 2020-06-29  8:50 UTC (permalink / raw)
  To: Zelphir Kaltstahl, Maxim Cournoyer; +Cc: help-guix

Dear,

On Thu, 25 Jun 2020 at 21:25, Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> wrote:

> * It requires keeping multiple Emacs on my system. How will they
> interact with the same ~/.emacs.d/.init.el?

Emacs reads init.el when it starts so yes all Emacs will interact with
this file if you do not specify explicitly to not do it.  Well, if you
use 'with-eval-after-load' in your Emacs configuration files, it should
not be a problem. Otherwise give a look at "emacs-guix" or try "emacs -q
-l /path/to/your/specific/config.el", as Maxim pointed.

> 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.

For this specific package, I do not know because I have not checked but
the first step when a package is not in Guix is: try the importer! :-)

  guix import elpa -a melpa -r foo

where foo is the name of package in MELPA.  This works very well.

> 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 did that (installing with 'use-package') too but then I switched all
to manifest.scm file and 'with-eval-after-load' tracking channels.scm
(guix describe -f channels).  This way, I have a working setup
everywhere and everytime.  Anyway! :-)

The point is that Guix has a really large collection of Emacs packages:

--8<---------------cut here---------------start------------->8---
$ du -sh gnu/packages/*.scm | sort -nr | head -n5
908K    gnu/packages/crates-io.scm
884K    gnu/packages/emacs-xyz.scm
784K    gnu/packages/cran.scm
732K    gnu/packages/python-xyz.scm
636K    gnu/packages/bioinformatics.scm
--8<---------------cut here---------------end--------------->8---

and if your needs is not there then "guix import elpa" eases the task
for adding it. :-)


All the best,
simon


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Erlang + Emacs profile
  2020-06-29  8:50     ` zimoun
@ 2020-06-29 19:37       ` Zelphir Kaltstahl
  2020-06-29 20:24         ` Ricardo Wurmus
  2020-06-29 20:49         ` zimoun
  0 siblings, 2 replies; 14+ messages in thread
From: Zelphir Kaltstahl @ 2020-06-29 19:37 UTC (permalink / raw)
  To: zimoun, Maxim Cournoyer; +Cc: help-guix

Hi Simon and Maxim!

I am not sure I understand all things you wrote.

On 29.06.20 10:50, zimoun wrote:
> Dear,
>
> On Thu, 25 Jun 2020 at 21:25, Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> wrote:
>
>> * It requires keeping multiple Emacs on my system. How will they
>> interact with the same ~/.emacs.d/.init.el?
> Emacs reads init.el when it starts so yes all Emacs will interact with
> this file if you do not specify explicitly to not do it.  Well, if you
> use 'with-eval-after-load' in your Emacs configuration files, it should
> not be a problem. Otherwise give a look at "emacs-guix" or try "emacs -q
> -l /path/to/your/specific/config.el", as Maxim pointed.

OK, so basically the way would then be to have 2 Emacs, but always start
one of them with with the `-l <path>` argument, so that it makes use of
another config file.

>> 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.
> For this specific package, I do not know because I have not checked but
> the first step when a package is not in Guix is: try the importer! :-)
>
>   guix import elpa -a melpa -r foo
>
> where foo is the name of package in MELPA.  This works very well.

OK nice! I'll try it for a package! I noticed, that there are only 3
Emacs Org-Babel packages available (or visible)
at: https://guix.gnu.org/packages/E/page/9/. I'l try with some of those
I need. And I see
at https://guix.gnu.org/manual/en/html_node/Invoking-guix-import.html#Invoking-guix-import,
that there are already some repositories understood, which I would
probably use.

Also the edit thing `guix edit emacs-ob-erlang` sounds interesting.

I just did the edit thing and I am not sure how to then "upload" a
package. But I will read the docs a little and will probably all clear up.

>> 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 did that (installing with 'use-package') too but then I switched all
> to manifest.scm file and 'with-eval-after-load' tracking channels.scm
> (guix describe -f channels).  This way, I have a working setup
> everywhere and everytime.  Anyway! :-)
>
> The point is that Guix has a really large collection of Emacs packages:
>
> --8<---------------cut here---------------start------------->8---
> $ du -sh gnu/packages/*.scm | sort -nr | head -n5
> 908K    gnu/packages/crates-io.scm
> 884K    gnu/packages/emacs-xyz.scm
> 784K    gnu/packages/cran.scm
> 732K    gnu/packages/python-xyz.scm
> 636K    gnu/packages/bioinformatics.scm
> --8<---------------cut here---------------end--------------->8---
>
> and if your needs is not there then "guix import elpa" eases the task
> for adding it. :-)

So if I understand this correctly, there are different channels for
different types of packages, for example for Rust packages we have
`gnu/packages/crates-io.scm` and for Emacs packages we have
`gnu/packages/emacs-xyz.scm`.

The command `guix describe -f channels` does not work for me:

~~~~
xiaolong@xlx200:~$ guix describe -f channels
guix describe: error: failed to determine origin
hint: Perhaps this `guix' command was not obtained with `guix pull'? Its version string is
36da62f1b9c78a2729658143a7df1845cd532afa.
~~~~

I did another `guix pull` and `guix package -u` and this is after a
fresh Guix package manager install and and installing the following
packages:

~~~~
xiaolong@xlx200:~$ sudo -i guix package -I
glibc-utf8-locales	2.31	out	/gnu/store/z7a6sbvqzb5zapwpznmjkq2rsxil6i67-glibc-utf8-locales-2.31

xiaolong@xlx200:~$ sudo -i guix package -I
glibc-utf8-locales	2.31	out	/gnu/store/z7a6sbvqzb5zapwpznmjkq2rsxil6i67-glibc-utf8-locales-2.31
xiaolong@xlx200:~$ guix package -I
guile	3.0.4	out	/gnu/store/ah16zr8mmfkqy23rr7jy5a842ca1q9h1-guile-3.0.4
erlang	21.3.8.13	out	/gnu/store/6x8ycgi8hv5rh8gq3vrdbcq5sh3qfq7i-erlang-21.3.8.13
emacs-ob-erlang	20180827-1.f1a8c66	out	/gnu/store/czg6wqga0hvc57axbz1cjp892k5r8ybp-emacs-ob-erlang-20180827-1.f1a8c66
icecat	68.9.0-guix0-preview1	out	/gnu/store/7qakza7zdiz57l5hldd8162324fwbw8s-icecat-68.9.0-guix0-preview1
libreoffice	6.4.4.2	out	/gnu/store/swk410ahw9v4k0hjmsd4f33bqw5fdyqa-libreoffice-6.4.4.2
lyx	2.3.5.1	out	/gnu/store/p7z5436jhgjlgdbx44np44vzjhrwi2ns-lyx-2.3.5.1
python	3.8.2	out	/gnu/store/6sr11m4i1d3vbqlmbpzmfj1lihbc5iz4-python-3.8.2
rust	1.39.0	out	/gnu/store/24pbvvdwaj9kbsdfi6kgxkvxkjayfz74-rust-1.39.0
openvpn	2.4.9	out	/gnu/store/3rh4i3wbkdwkrmrxy30d3f3nbg6kdl02-openvpn-2.4.9
emacs	26.3	out	/gnu/store/528p0v6gg5gx53jd0x52dmghb01bfhc5-emacs-26.3
glibc-utf8-locales	2.31	out	/gnu/store/z7a6sbvqzb5zapwpznmjkq2rsxil6i67-glibc-utf8-locales-2.31
guile-colorized	0.1	out	/gnu/store/5h0jfssgyx49cq82wrmw57an7ngb7kkz-guile-colorized-0.1
~~~~

The other command to show the count of packages also does not work for me:

~~~~
xiaolong@xlx200:/$ sudo du -sh gnu/packages/*.scm | sort -nr | head -n5
du: cannot access 'gnu/packages/*.scm': No such file or directory
~~~~

Do I need to create channels, like a custom way of structuring packages
for myself, before running these commands?

> All the best,
> simon

Thanks for all your help!
Best regards,
Zelphir

-- 
repositories: https://notabug.org/ZelphirKaltstahl


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Erlang + Emacs profile
  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
  1 sibling, 1 reply; 14+ messages in thread
From: Ricardo Wurmus @ 2020-06-29 20:24 UTC (permalink / raw)
  To: Zelphir Kaltstahl; +Cc: help-guix


Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> writes:

> I just did the edit thing and I am not sure how to then "upload" a
> package. But I will read the docs a little and will probably all clear up.

“guix edit” only opens the source file containing a package definition
in your editor.

To contribute packages please see the Contributing section in the manual.

>> The point is that Guix has a really large collection of Emacs packages:
>>
>> --8<---------------cut here---------------start------------->8---
>> $ du -sh gnu/packages/*.scm | sort -nr | head -n5
>> 908K    gnu/packages/crates-io.scm
>> 884K    gnu/packages/emacs-xyz.scm
>> 784K    gnu/packages/cran.scm
>> 732K    gnu/packages/python-xyz.scm
>> 636K    gnu/packages/bioinformatics.scm
>> --8<---------------cut here---------------end--------------->8---
>>
>> and if your needs is not there then "guix import elpa" eases the task
>> for adding it. :-)
>
> So if I understand this correctly, there are different channels for
> different types of packages, for example for Rust packages we have
> `gnu/packages/crates-io.scm` and for Emacs packages we have
> `gnu/packages/emacs-xyz.scm`.

No, these are not channels.  These are all modules that are part of the
default channel called “guix”.

> The command `guix describe -f channels` does not work for me:
>
> ~~~~
> xiaolong@xlx200:~$ guix describe -f channels
> guix describe: error: failed to determine origin
> hint: Perhaps this `guix' command was not obtained with `guix pull'? Its version string is
> 36da62f1b9c78a2729658143a7df1845cd532afa.
> ~~~~

“guix describe” will work when you use a “guix” that was obtained with
“guix pull”.  It will usually be in ~/.config/guix/current/bin/guix.

> I did another `guix pull` and `guix package -u` and this is after a
> fresh Guix package manager install and and installing the following
> packages:
>
> ~~~~
> xiaolong@xlx200:~$ sudo -i guix package -I
> glibc-utf8-locales	2.31	out	/gnu/store/z7a6sbvqzb5zapwpznmjkq2rsxil6i67-glibc-utf8-locales-2.31
>
> xiaolong@xlx200:~$ sudo -i guix package -I
> glibc-utf8-locales	2.31	out	/gnu/store/z7a6sbvqzb5zapwpznmjkq2rsxil6i67-glibc-utf8-locales-2.31
> xiaolong@xlx200:~$ guix package -I
> guile	3.0.4	out	/gnu/store/ah16zr8mmfkqy23rr7jy5a842ca1q9h1-guile-3.0.4
> erlang	21.3.8.13	out	/gnu/store/6x8ycgi8hv5rh8gq3vrdbcq5sh3qfq7i-erlang-21.3.8.13
> emacs-ob-erlang	20180827-1.f1a8c66	out	/gnu/store/czg6wqga0hvc57axbz1cjp892k5r8ybp-emacs-ob-erlang-20180827-1.f1a8c66
> icecat	68.9.0-guix0-preview1	out	/gnu/store/7qakza7zdiz57l5hldd8162324fwbw8s-icecat-68.9.0-guix0-preview1
> libreoffice	6.4.4.2	out	/gnu/store/swk410ahw9v4k0hjmsd4f33bqw5fdyqa-libreoffice-6.4.4.2
> lyx	2.3.5.1	out	/gnu/store/p7z5436jhgjlgdbx44np44vzjhrwi2ns-lyx-2.3.5.1
> python	3.8.2	out	/gnu/store/6sr11m4i1d3vbqlmbpzmfj1lihbc5iz4-python-3.8.2
> rust	1.39.0	out	/gnu/store/24pbvvdwaj9kbsdfi6kgxkvxkjayfz74-rust-1.39.0
> openvpn	2.4.9	out	/gnu/store/3rh4i3wbkdwkrmrxy30d3f3nbg6kdl02-openvpn-2.4.9
> emacs	26.3	out	/gnu/store/528p0v6gg5gx53jd0x52dmghb01bfhc5-emacs-26.3
> glibc-utf8-locales	2.31	out	/gnu/store/z7a6sbvqzb5zapwpznmjkq2rsxil6i67-glibc-utf8-locales-2.31
> guile-colorized	0.1	out	/gnu/store/5h0jfssgyx49cq82wrmw57an7ngb7kkz-guile-colorized-0.1
> ~~~~

I don’t know what this is supposed to demonstrate.  “sudo -i guix” runs
Guix as the root user, which has a different default profile.

> The other command to show the count of packages also does not work for me:
>
> ~~~~
> xiaolong@xlx200:/$ sudo du -sh gnu/packages/*.scm | sort -nr | head -n5
> du: cannot access 'gnu/packages/*.scm': No such file or directory
> ~~~~

That’s not a general command to count packages.  This was just simon’s
way of showing you that the file containing package definitions for
Emacs packages in the Guix repository is among the largest modules.

To show all available packages use “guix package --list-available”.

> Do I need to create channels, like a custom way of structuring packages
> for myself, before running these commands?

No.  The command line that simon showed you is a simple combination of
coreutils commands that operate on the Guix source code.  If you want to
run the same command you need to do this in the directory containing a
checkout of the Guix source code.

-- 
Ricardo


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Erlang + Emacs profile
  2020-06-24 20:29 ` Maxim Cournoyer
  2020-06-25 19:25   ` Zelphir Kaltstahl
@ 2020-06-29 20:26   ` Zelphir Kaltstahl
  2020-06-30 18:34   ` Zelphir Kaltstahl
  2020-06-30 18:41   ` Zelphir Kaltstahl
  3 siblings, 0 replies; 14+ messages in thread
From: Zelphir Kaltstahl @ 2020-06-29 20:26 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: help-guix

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 <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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Erlang + Emacs profile
  2020-06-29 20:24         ` Ricardo Wurmus
@ 2020-06-29 20:37           ` Zelphir Kaltstahl
  0 siblings, 0 replies; 14+ messages in thread
From: Zelphir Kaltstahl @ 2020-06-29 20:37 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: help-guix

Hi Ricardo!


On 29.06.20 22:24, Ricardo Wurmus wrote:
> Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> writes:
>
>> I just did the edit thing and I am not sure how to then "upload" a
>> package. But I will read the docs a little and will probably all clear up.
> “guix edit” only opens the source file containing a package definition
> in your editor.
>
> To contribute packages please see the Contributing section in the manual.
>
>>> The point is that Guix has a really large collection of Emacs packages:
>>>
>>> --8<---------------cut here---------------start------------->8---
>>> $ du -sh gnu/packages/*.scm | sort -nr | head -n5
>>> 908K    gnu/packages/crates-io.scm
>>> 884K    gnu/packages/emacs-xyz.scm
>>> 784K    gnu/packages/cran.scm
>>> 732K    gnu/packages/python-xyz.scm
>>> 636K    gnu/packages/bioinformatics.scm
>>> --8<---------------cut here---------------end--------------->8---
>>>
>>> and if your needs is not there then "guix import elpa" eases the task
>>> for adding it. :-)
>> So if I understand this correctly, there are different channels for
>> different types of packages, for example for Rust packages we have
>> `gnu/packages/crates-io.scm` and for Emacs packages we have
>> `gnu/packages/emacs-xyz.scm`.
> No, these are not channels.  These are all modules that are part of the
> default channel called “guix”.
>
>> The command `guix describe -f channels` does not work for me:
>>
>> ~~~~
>> xiaolong@xlx200:~$ guix describe -f channels
>> guix describe: error: failed to determine origin
>> hint: Perhaps this `guix' command was not obtained with `guix pull'? Its version string is
>> 36da62f1b9c78a2729658143a7df1845cd532afa.
>> ~~~~
> “guix describe” will work when you use a “guix” that was obtained with
> “guix pull”.  It will usually be in ~/.config/guix/current/bin/guix.
>
>> I did another `guix pull` and `guix package -u` and this is after a
>> fresh Guix package manager install and and installing the following
>> packages:
>>
>> ~~~~
>> xiaolong@xlx200:~$ sudo -i guix package -I
>> glibc-utf8-locales	2.31	out	/gnu/store/z7a6sbvqzb5zapwpznmjkq2rsxil6i67-glibc-utf8-locales-2.31
>>
>> xiaolong@xlx200:~$ sudo -i guix package -I
>> glibc-utf8-locales	2.31	out	/gnu/store/z7a6sbvqzb5zapwpznmjkq2rsxil6i67-glibc-utf8-locales-2.31
>> xiaolong@xlx200:~$ guix package -I
>> guile	3.0.4	out	/gnu/store/ah16zr8mmfkqy23rr7jy5a842ca1q9h1-guile-3.0.4
>> erlang	21.3.8.13	out	/gnu/store/6x8ycgi8hv5rh8gq3vrdbcq5sh3qfq7i-erlang-21.3.8.13
>> emacs-ob-erlang	20180827-1.f1a8c66	out	/gnu/store/czg6wqga0hvc57axbz1cjp892k5r8ybp-emacs-ob-erlang-20180827-1.f1a8c66
>> icecat	68.9.0-guix0-preview1	out	/gnu/store/7qakza7zdiz57l5hldd8162324fwbw8s-icecat-68.9.0-guix0-preview1
>> libreoffice	6.4.4.2	out	/gnu/store/swk410ahw9v4k0hjmsd4f33bqw5fdyqa-libreoffice-6.4.4.2
>> lyx	2.3.5.1	out	/gnu/store/p7z5436jhgjlgdbx44np44vzjhrwi2ns-lyx-2.3.5.1
>> python	3.8.2	out	/gnu/store/6sr11m4i1d3vbqlmbpzmfj1lihbc5iz4-python-3.8.2
>> rust	1.39.0	out	/gnu/store/24pbvvdwaj9kbsdfi6kgxkvxkjayfz74-rust-1.39.0
>> openvpn	2.4.9	out	/gnu/store/3rh4i3wbkdwkrmrxy30d3f3nbg6kdl02-openvpn-2.4.9
>> emacs	26.3	out	/gnu/store/528p0v6gg5gx53jd0x52dmghb01bfhc5-emacs-26.3
>> glibc-utf8-locales	2.31	out	/gnu/store/z7a6sbvqzb5zapwpznmjkq2rsxil6i67-glibc-utf8-locales-2.31
>> guile-colorized	0.1	out	/gnu/store/5h0jfssgyx49cq82wrmw57an7ngb7kkz-guile-colorized-0.1
>> ~~~~
> I don’t know what this is supposed to demonstrate.  “sudo -i guix” runs
> Guix as the root user, which has a different default profile.


I made a typo when pasting the output from terminal. There are two
package -I outputs I posted, if you check. The one with fewer packages
is the root profile, of which you can see the command I used. The one
with more packages is not the root profile, but the `guix package -I`.
Perhaps I could have split it into two parts to make it more clear.

This is supposed to show, that I already installed some software,
instead of starting completely from a clean install, in case, that the
error I got could be caused by anything I installed already. I don't
know how it works internally, so perhaps it would be of use to someone
knowing more than me about Guix package manager. Better to put all the
info out there, than making others ask for it, because it's missing.
That was the idea I had behind that.


>> The other command to show the count of packages also does not work for me:
>>
>> ~~~~
>> xiaolong@xlx200:/$ sudo du -sh gnu/packages/*.scm | sort -nr | head -n5
>> du: cannot access 'gnu/packages/*.scm': No such file or directory
>> ~~~~
> That’s not a general command to count packages.  This was just simon’s
> way of showing you that the file containing package definitions for
> Emacs packages in the Guix repository is among the largest modules.
>
> To show all available packages use “guix package --list-available”.
>
>> Do I need to create channels, like a custom way of structuring packages
>> for myself, before running these commands?
> No.  The command line that simon showed you is a simple combination of
> coreutils commands that operate on the Guix source code.  If you want to
> run the same command you need to do this in the directory containing a
> checkout of the Guix source code.

OK I see, thanks!

Regards,
Zelphir

-- 
repositories: https://notabug.org/ZelphirKaltstahl



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Erlang + Emacs profile
  2020-06-29 19:37       ` Zelphir Kaltstahl
  2020-06-29 20:24         ` Ricardo Wurmus
@ 2020-06-29 20:49         ` zimoun
  2020-06-29 21:12           ` Zelphir Kaltstahl
  1 sibling, 1 reply; 14+ messages in thread
From: zimoun @ 2020-06-29 20:49 UTC (permalink / raw)
  To: Zelphir Kaltstahl, Maxim Cournoyer; +Cc: help-guix

Dear,

On Mon, 29 Jun 2020 at 21:37, Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> wrote:
>> On Thu, 25 Jun 2020 at 21:25, Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> wrote:
>>
>>> * It requires keeping multiple Emacs on my system. How will they
>>> interact with the same ~/.emacs.d/.init.el?
>> Emacs reads init.el when it starts so yes all Emacs will interact with
>> this file if you do not specify explicitly to not do it.  Well, if you
>> use 'with-eval-after-load' in your Emacs configuration files, it should
>> not be a problem. Otherwise give a look at "emacs-guix" or try "emacs -q
>> -l /path/to/your/specific/config.el", as Maxim pointed.
>
> OK, so basically the way would then be to have 2 Emacs, but always start
> one of them with with the `-l <path>` argument, so that it makes use of
> another config file.

I am not sure to understand what you want.  Could you describe what is
your desired workflow to hack Erlang?

> OK nice! I'll try it for a package! I noticed, that there are only 3
> Emacs Org-Babel packages available (or visible)
> at: https://guix.gnu.org/packages/E/page/9/. I'l try with some of
> those

First, in case you do not know this web interface for searching
packages:

https://hpc.guix.info/browse

Second, I am not following closely Org Babel extensions but what
languages appear to you missing?


> Also the edit thing `guix edit emacs-ob-erlang` sounds interesting.

It depends if you use Guix System or Guix as package manager solely.
For the latter, the 'edit' is read-only.

> I just did the edit thing and I am not sure how to then "upload" a
> package. But I will read the docs a little and will probably all clear
> up.

What do you mean by "upload"?
If you mean contribute, you might be interested by this section of the
manual:

https://guix.gnu.org/manual/devel/en/guix.html#Contributing



> So if I understand this correctly, there are different channels for
> different types of packages, for example for Rust packages we have
> `gnu/packages/crates-io.scm` and for Emacs packages we have
> `gnu/packages/emacs-xyz.scm`.

Channel is not the right term, in Guix parlance.  To be clear, channel
means a collection of packages living in files.  The previous different
types of packages are all in the same channel, i.e., the default
channel.

https://guix.gnu.org/manual/devel/en/guix.html#Channels

For channels examples, you can give a look at:

https://gitlab.inria.fr/guix-hpc/guix-hpc
ahttps://gitlab.inria.fr/guix-hpc/guix-past


>
> The command `guix describe -f channels` does not work for me:
>
> ~~~~
> xiaolong@xlx200:~$ guix describe -f channels
> guix describe: error: failed to determine origin
> hint: Perhaps this `guix' command was not obtained with `guix pull'? Its version string is
> 36da62f1b9c78a2729658143a7df1845cd532afa.
> ~~~~

How did you install Guix?  Have you run "guix pull" before trying "guix
describe"?


> I did another `guix pull` and `guix package -u` and this is after a
> fresh Guix package manager install and and installing the following
> packages:
>
> ~~~~
> xiaolong@xlx200:~$ sudo -i guix package -I

Note that once you have configured your system (if you use Guix System),
you can run "guix pull" as a regular user and install package as regular
user, independently of what your system-wide is.

> The other command to show the count of packages also does not work for me:
>
> ~~~~
> xiaolong@xlx200:/$ sudo du -sh gnu/packages/*.scm | sort -nr | head -n5
> du: cannot access 'gnu/packages/*.scm': No such file or directory
> ~~~~

You need to be in the Guix repo, i.e., you need to git clone
https://git.savannah.gnu.org/git/guix.git and the subfolder
gnu/packages/ contains all the packages stored by thematic. 


> Do I need to create channels, like a custom way of structuring packages
> for myself, before running these commands?

To test and install your own packages, you have 3 choices:

 1. ./pre-inst-env
 2. local channel
 3. --load-path

The point #1 means you use the Contribution section, build Guix from
source, then add your package to the file gnu/packages/emacs-xyz.scm (of
the Git clone) and then run (from the Git cloned repo):

  ./pre-inst-env guix install emacs-foo

The point #2 means you use a local Git repo containing your definitions
of packages.  You have the channels.scm file:

--8<---------------cut here---------------start------------->8---
(cons*
 (channel
  (name 'my-stuff)
  (url "file:////path/to/my/stuff.git")
  (branch "master"))
 %default-channels)
--8<---------------cut here---------------end--------------->8---

then "guix pull -C path/to/channels.scm" and you should be able to
install your package emacs-foo with "guix install emacs-foo".  Note that
the Git repo can be also https:// or other protocols.

The point #3 mean you use a local folder containing your definitions as
for point #2.  Then you simply run:

   guix install -L path/to/your/folder/containing/stuff emacs-foo


Hope that helps,
simon


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Erlang + Emacs profile
  2020-06-29 20:49         ` zimoun
@ 2020-06-29 21:12           ` Zelphir Kaltstahl
  2020-06-29 22:08             ` zimoun
  0 siblings, 1 reply; 14+ messages in thread
From: Zelphir Kaltstahl @ 2020-06-29 21:12 UTC (permalink / raw)
  To: zimoun; +Cc: help-guix

Hi Simon!

On 29.06.20 22:49, zimoun wrote:
> Dear,
>
> On Mon, 29 Jun 2020 at 21:37, Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> wrote:
>>> On Thu, 25 Jun 2020 at 21:25, Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> wrote:
>>>
>>>> * It requires keeping multiple Emacs on my system. How will they
>>>> interact with the same ~/.emacs.d/.init.el?
>>> Emacs reads init.el when it starts so yes all Emacs will interact with
>>> this file if you do not specify explicitly to not do it.  Well, if you
>>> use 'with-eval-after-load' in your Emacs configuration files, it should
>>> not be a problem. Otherwise give a look at "emacs-guix" or try "emacs -q
>>> -l /path/to/your/specific/config.el", as Maxim pointed.
>> OK, so basically the way would then be to have 2 Emacs, but always start
>> one of them with with the `-l <path>` argument, so that it makes use of
>> another config file.
> I am not sure to understand what you want.  Could you describe what is
> your desired workflow to hack Erlang?

I'm only trying to understand how it would work with 2 Emacs, one in the
main profile and one in another profile, which can be created from
manifest. What I would like to achieve is, that I can do some literate
programming in org-mode, while following along an online course about
Erlang. In the past I had some pretty good experience with that approach
to understanding some code and making sure I also write down what I
understand, so that later on, I can go back and read again. I am not
asking, whether this is a good or typical approach to any Erlang
development.

>> OK nice! I'll try it for a package! I noticed, that there are only 3
>> Emacs Org-Babel packages available (or visible)
>> at: https://guix.gnu.org/packages/E/page/9/. I'l try with some of
>> those
> First, in case you do not know this web interface for searching
> packages:
>
> https://hpc.guix.info/browse
Indeed I did not know that one yet and always clicked through the pages,
estimating, how many pages ahead I would need to go, to approximately
find a package. :D
> Second, I am not following closely Org Babel extensions but what
> languages appear to you missing?

I was thinking, that `ob-python` was missing, because I only found
`emacs-ob-ipython`, but apparently `ob-python` does not exist and is
instead built in? Because it works without me installing any `ob-python`
Emacs package. Same seems to be true for `ob-scheme`. Only needed to
install `geiser` I think.

For now it seems nothing is missing.

>> Also the edit thing `guix edit emacs-ob-erlang` sounds interesting.
> It depends if you use Guix System or Guix as package manager solely.
> For the latter, the 'edit' is read-only.
>
>> I just did the edit thing and I am not sure how to then "upload" a
>> package. But I will read the docs a little and will probably all clear
>> up.
> What do you mean by "upload"?
> If you mean contribute, you might be interested by this section of the
> manual:
>
> https://guix.gnu.org/manual/devel/en/guix.html#Contributing
>
>
>
>> So if I understand this correctly, there are different channels for
>> different types of packages, for example for Rust packages we have
>> `gnu/packages/crates-io.scm` and for Emacs packages we have
>> `gnu/packages/emacs-xyz.scm`.
> Channel is not the right term, in Guix parlance.  To be clear, channel
> means a collection of packages living in files.  The previous different
> types of packages are all in the same channel, i.e., the default
> channel.
>
> https://guix.gnu.org/manual/devel/en/guix.html#Channels
>
> For channels examples, you can give a look at:
>
> https://gitlab.inria.fr/guix-hpc/guix-hpc
> ahttps://gitlab.inria.fr/guix-hpc/guix-past
>
>
>> The command `guix describe -f channels` does not work for me:
>>
>> ~~~~
>> xiaolong@xlx200:~$ guix describe -f channels
>> guix describe: error: failed to determine origin
>> hint: Perhaps this `guix' command was not obtained with `guix pull'? Its version string is
>> 36da62f1b9c78a2729658143a7df1845cd532afa.
>> ~~~~
> How did you install Guix?  Have you run "guix pull" before trying "guix
> describe"?

I installed it on Trisquel 8 using the recommended install script. I did
`guix pull` just like the error hinted, but still got the error. Now, a
few terminals closed and opened later, it seems to work and give some
output.

~~~~
(list (channel
        (name 'guix)
        (url "https://git.savannah.gnu.org/git/guix.git")
        (commit
          "6ebf300959a58fd1eda875205c75d21137862285")))
~~~~

I think that is the normal intended output.

>> I did another `guix pull` and `guix package -u` and this is after a
>> fresh Guix package manager install and and installing the following
>> packages:
>>
>> ~~~~
>> xiaolong@xlx200:~$ sudo -i guix package -I
> Note that once you have configured your system (if you use Guix System),
> you can run "guix pull" as a regular user and install package as regular
> user, independently of what your system-wide is.

Yep, sorry for that copy&paste error in my e-mail! The longer output was
actually the output of the non-root profile already.

>> The other command to show the count of packages also does not work for me:
>>
>> ~~~~
>> xiaolong@xlx200:/$ sudo du -sh gnu/packages/*.scm | sort -nr | head -n5
>> du: cannot access 'gnu/packages/*.scm': No such file or directory
>> ~~~~
> You need to be in the Guix repo, i.e., you need to git clone
> https://git.savannah.gnu.org/git/guix.git and the subfolder
> gnu/packages/ contains all the packages stored by thematic.
>
>
>> Do I need to create channels, like a custom way of structuring packages
>> for myself, before running these commands?
> To test and install your own packages, you have 3 choices:
>
>  1. ./pre-inst-env
>  2. local channel
>  3. --load-path
>
> The point #1 means you use the Contribution section, build Guix from
> source, then add your package to the file gnu/packages/emacs-xyz.scm (of
> the Git clone) and then run (from the Git cloned repo):
>
>   ./pre-inst-env guix install emacs-foo
>
> The point #2 means you use a local Git repo containing your definitions
> of packages.  You have the channels.scm file:
>
> --8<---------------cut here---------------start------------->8---
> (cons*
>  (channel
>   (name 'my-stuff)
>   (url "file:////path/to/my/stuff.git")
>   (branch "master"))
>  %default-channels)
> --8<---------------cut here---------------end--------------->8---
>
> then "guix pull -C path/to/channels.scm" and you should be able to
> install your package emacs-foo with "guix install emacs-foo".  Note that
> the Git repo can be also https:// or other protocols.
>
> The point #3 mean you use a local folder containing your definitions as
> for point #2.  Then you simply run:
>
>    guix install -L path/to/your/folder/containing/stuff emacs-foo
>
>
> Hope that helps,
> simon

Thanks Simon, it helps!

I will need to read more about various terms in the Guix universe in its
docs. I've not read that much yet and that is, why some terms and
concepts are unclear to me.

Regards,
Zelphir

-- 
repositories: https://notabug.org/ZelphirKaltstahl


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Erlang + Emacs profile
  2020-06-29 21:12           ` Zelphir Kaltstahl
@ 2020-06-29 22:08             ` zimoun
  0 siblings, 0 replies; 14+ messages in thread
From: zimoun @ 2020-06-29 22:08 UTC (permalink / raw)
  To: Zelphir Kaltstahl; +Cc: help-guix

On Mon, 29 Jun 2020 at 23:12, Zelphir Kaltstahl <zelphirkaltstahl@posteo.de> wrote:

> I'm only trying to understand how it would work with 2 Emacs, one in the
> main profile and one in another profile, which can be created from
> manifest. What I would like to achieve is, that I can do some literate
> programming in org-mode, while following along an online course about
> Erlang. In the past I had some pretty good experience with that approach
> to understanding some code and making sure I also write down what I
> understand, so that later on, I can go back and read again. I am not
> asking, whether this is a good or typical approach to any Erlang
> development.

Having 2 Emacs instances, one in your default profile and one in your
Erlang dev profile does not mean you need complicated init.el file.  As
I wrote you earlier, you can use 'with-eval-after-load' and everything
will be fine, even using only one ~/.emacs.d.


> Thanks Simon, it helps!

Welcome!  Feel free to ask. :-)

All the best,
simon


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Erlang + Emacs profile
  2020-06-24 20:29 ` Maxim Cournoyer
  2020-06-25 19:25   ` Zelphir Kaltstahl
  2020-06-29 20:26   ` Zelphir Kaltstahl
@ 2020-06-30 18:34   ` Zelphir Kaltstahl
  2020-06-30 18:41   ` Zelphir Kaltstahl
  3 siblings, 0 replies; 14+ messages in thread
From: Zelphir Kaltstahl @ 2020-06-30 18:34 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: help-guix

Hi Maxim!

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"))
~~~~

~~~~
~~~~

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

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Erlang + Emacs profile
  2020-06-24 20:29 ` Maxim Cournoyer
                     ` (2 preceding siblings ...)
  2020-06-30 18:34   ` Zelphir Kaltstahl
@ 2020-06-30 18:41   ` Zelphir Kaltstahl
  3 siblings, 0 replies; 14+ messages in thread
From: Zelphir Kaltstahl @ 2020-06-30 18:41 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: help-guix

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, back to index

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

unofficial mirror of help-guix@gnu.org 

Archives are clonable:
	git clone --mirror https://yhetil.org/guix-user/0 guix-user/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-user guix-user/ https://yhetil.org/guix-user \
		help-guix@gnu.org
	public-inbox-index guix-user

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.user
	nntp://news.gmane.io/gmane.comp.gnu.guix.user


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git