Subject: Re: bug#43243: emacs-elfeed-org, mapc: Symbol’sfunction definition is void

From: zimoun <[email-masked]>
Date: Sat, 03 Oct 2020 14:40:51 +0200

Dear,

On Fri, 02 Oct 2020 at 20:08, Giovanni Biscuolo <[email-masked]> wrote:

> I'm not very good in the triage of this bug: after a lot of trial and
> error I was almost sure I found a conflicting package (emacs-hl-todo,
> required by emacs-magit-todos) BUT I was NOT able to reproduce the bug
> in a pure environment

[...]

> In that environment's emacs session I get an init.el loading error, but
> I'm able to eval-buffer this:

That's because your init.el and guix.scm do not match.  For example, you
are using ’use-package’ inside ’init.el’ without installing it, I mean
it does not appear neither inside ’guix.scm’ –– I do not understand from
where it comes from.  Therefore, I am not sure about the option ’–pure’
but the option ’–container’ should raise an error.  Do I miss something?

> ;; -*- 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…  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’.

> (unless (require 'guix-emacs nil 'noerror)
>  (use-package emojify

>From where the package ’use-package’ comes from?

>    :ensure t
>    :pin "GNU_ELPA"))

If you use a manifest.scm file, why do you need ’use-package’ and ELPA.
If ’emojify’ is not in Guix, please try to submit a patch – using “guix
import elpa” helps.

> (unless (require 'guix-emacs nil 'noerror)
>  (use-package tramp
>    :ensure t
>    :pin "GNU_ELPA"))

Well, ’use-package’ does lazy evaluations if I remember correctly.  So
why do you explicitly ’require’ it just after?

> (require 'tramp)

AFAIU, it should be better to do:

        (use-package tramp
          :ensure t
          :defer t
          :pin “GNU_ELPA

          :init
          ;; eval at init time

          :config
          ;; eval at use time
          ;; your TRAMP config
          (setq tramp-remote-path …)
          …)

or to add ’emacs-tramp’ to your manifest.scm file and then write:

        (with-eval-after-load ’tramp
          ;; your TRAMP config
          (setq tramp-remote-path …)
          …)

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

> (unless (require 'guix-emacs nil 'noerror)
>  (use-package org
>    :mode (("\\.org$" . org-mode))
>    :ensure org-plus-contrib
>    :pin org))

[...]

> (require 'org-id)
> (require 'org-toc)
> (require 'org-tempo)

Because of this mess about evaluating order, I am not sure this is
correct.  Instead, you should write something like:

        (use-package org
          …
          :config
          (require 'org-tempo))

or instead the ’(require 'org-tempo)’ in your init.el, something like:

        (use-package org-tempo
          :ensure t
          :defer t
          :after org)

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

> ;; This file is automatically generated via init.org
> ;; PLEASE do not edit this, edit init.org
> (specifications->manifest
>  '("gs-fonts"
>    "font-dejavu"
>    "font-gnu-freefont"
>    "unicode-emoji"
>    "emacs"
>  "emacs-emojify"

And you have ’(use-package emojify :ensure t)’, it appears to me a bad
idea.  And I am pretty sure that leads to issues.  Choose if the
packages come from ELPA&co _or_ Guix, IMHO.

> ))

I could have misread, but no ’emacs-use-package’.

Hope that helps,
simon