unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Giovanni Biscuolo <g@xelera.eu>
To: zimoun <zimon.toutoune@gmail.com>
Cc: help-guix@gnu.org
Subject: Emacs config for "traditional" or Guix environment?
Date: Tue, 06 Oct 2020 11:46:47 +0200	[thread overview]
Message-ID: <87lfgjit4o.fsf@roquette.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <86o8ljeb3g.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4301 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 849 bytes --]

           reply	other threads:[~2020-10-06  9:48 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <86o8ljeb3g.fsf@gmail.com>]

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=87lfgjit4o.fsf@roquette.i-did-not-set--mail-host-address--so-tickle-me \
    --to=g@xelera.eu \
    --cc=help-guix@gnu.org \
    --cc=zimon.toutoune@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).