help-guix
[Top][All Lists]
Advanced

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

Emacs config for "traditional" or Guix environment?


From: Giovanni Biscuolo
Subject: Emacs config for "traditional" or Guix environment?
Date: Tue, 06 Oct 2020 11:46:47 +0200

Hello Simon,

thank you for your patience and tips!

This is a follow-up of things discussed in bug#43243 (now resolved). I'm
posting this to help-guix in case someone finds it useful.

This is a *very* quick summary of my bug report: I had a strange error
with elfeed-org and after some investigation I realized I was still
using old packages loaded from my ~/.emacs.d/elpa directory, installed
using "use-package" before migrating to Guix's Emacs; I removed that
directory and all is running as before.

During the investigation I sent my redacted init.el, Simon commented
it. The following is my follow-up.

zimoun <zimon.toutoune@gmail.com> writes:

> Dear,
>
> On Fri, 02 Oct 2020 at 20:08, Giovanni Biscuolo <g@xelera.eu> wrote:

[...]

>> ;; -*- mode: emacs-lisp -*-
>> (unless (require 'guix-emacs nil 'noerror)
>>  (package-initialize))
>> (unless (require 'guix-emacs nil 'noerror)
>>  ;; package archives
>>  (when (>= emacs-major-version 24)
>>    (require 'package)
>>    (setq package-archives
>>        '(("GNU_ELPA"     . "https://elpa.gnu.org/packages/";)
>>          ("org"          . "https://orgmode.org/elpa/";)
>>          ("MELPA_Stable" . "https://stable.melpa.org/packages/";)
>>          ("MELPA"        . "https://melpa.org/packages/";))
>>        package-archive-priorities
>>        '(("GNU_ELPA"     . 15)
>>          ("org"          . 10)
>>      ("MELPA_Stable" . 5)
>>          ("MELPA"        . 0)))))
>
> From my experience, I do not mix packages from Emacs archives and from
> Guix because it often leads to weirdness –– unexpected behaviour at
> least…

Yes I perfectly understand that: *never* mix packages.

What you see (and still I am using) is my attempt for a smooth migration
from my "Debian+use-package" Emacs installation to a pure Guix one;
since I'm using the same environment (packages+config) on all my
machines *and* I'm quite conservative I wanted a configuration that
"Just Worked" in all my environments (via git controlled dotfolder).

This "multi enviroment" trick was suggested by a smart Emacs user:

--8<---------------cut here---------------start------------->8---
(if (require 'guix-emacs nil 'noerror)
 ; Code for Guix Emacs
 ; Code for non-Guix Emacs
)
--8<---------------cut here---------------end--------------->8---

and I adapted it to my needs without actually fully understand how it
works :-O

...and it actually worked during my transition to a full Guix Emacs
install, being a transition from a Debian+use-package 26.3 to the same
version on Guix.

Anyway, as far as I see, my current usage of "(unless (require
'guix-emacs nil 'noerror)..." actually prevents any code to be evaluated
in my Guix Emacs environment.

> Personally, I have removed the use of all the ‘package.el’
> functions and only use packages ’emacs-*’ from Guix and then configure
> them using ’with-eval-after-load’.

I'm considering this, also, since now I do not need my old "multi env"
config anymore and I like simple and clean solutions, easier to
debug.  Guix is the solution to package management, I migrated, forget
the past. Full stop. :-D

[...]

> (Note I do not know about TRAMP, so maybe ’tramp-remote-path’ should be
> evaluated at init time and not at use time.  Aside the fact that TRAMP
> is part of vanilla Emacs, AFAICT.)

Yes it is part of vanilla Emacs but the upstream author suggested me to
install the upstream version, that solved an issue I had with /adb:/ on
26.3 vanilla Emacs from Guix.

[...]

> From my understanding, you are misusing ’use-package’.  Or you could
> rewrite:
>
>         (with-eval-after-load 'org
>           (require 'org-tempo))
>
> (And I am personally doing that.)

[...]

> Last, your starting time should be pretty long, right?  Hum?  IMHO, it
> could be really faster if you use ’with-eval-after-load’ or
> ’(use-package foo :defer t …)’ and so enjoy the speedup by “lazy”
> evaluation.

Thank you, I'll study with-eval-after-load.

Fast starting time is absolutely not a priority for me, I usually use
Emacs in daemon mode for several days... but it surely helps. 

[...]

Thanks a lot! Giovanni.

-- 
Giovanni Biscuolo

Xelera IT Infrastructures

Attachment: signature.asc
Description: PGP signature


reply via email to

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